Upload via presign

POSThttps://sangtao.ai/api/v2/images/presign

Upload an image up to 25 MB and get a URL back, for use as a reference image.

Two calls: ask for a link, then send the file to it. The bytes go straight to storage rather than through our servers, so this route takes files up to 25 MB.

Headers

X-Api-Keystringrequired

Your API key. Create one on the API Key page in your account.

Content-Typestringrequired

application/json

Request

fileNamestringrequired

Any name you like — only the extension matters, since it decides how the file is served back.

contentTypestringrequired

image/png · image/jpeg · image/webp

Response

sasUrlstring

Where to PUT the file. The signature is already in the URL, so that request needs no X-Api-Key — but it does need both x-ms-blob-type: BlockBlob and Content-Type. The link expires within minutes, so upload as soon as you have it.

publicUrlstring

The address the image will live at once uploaded. This is what you pass as referenceImages.

blobPathstring

Where the file sits in storage. Useful if you keep your own index of what you uploaded; not needed to generate an image.

POST/images/presign
curl -X POST \
  https://sangtao.ai/api/v2/images/presign \
  -H "X-Api-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fileName": "design.png",
    "contentType": "image/png"
  }'
{
  "success": true,
  "data": {
    "sasUrl": "https://sangtaoai.blob.core.windows.net/content/.../design.png?sv=...&sig=...",
    "blobPath": "284c42a4-.../745c53c6-....png",
    "publicUrl": "https://sangtaoai.blob.core.windows.net/content/.../design.png"
  },
  "error": null,
  "errorCode": null
}