Upload via presign
https://sangtao.ai/api/v2/images/presignUpload 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-KeystringrequiredYour API key. Create one on the API Key page in your account.
Content-Typestringrequiredapplication/json
Request
fileNamestringrequiredAny name you like — only the extension matters, since it decides how the file is served back.
contentTypestringrequiredimage/png · image/jpeg · image/webp
Response
sasUrlstringWhere 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.
publicUrlstringThe address the image will live at once uploaded. This is what you pass as referenceImages.
blobPathstringWhere the file sits in storage. Useful if you keep your own index of what you uploaded; not needed to generate an image.
/images/presigncurl -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
}/images/presigncurl -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
}