Upload directly

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

Send a small image in a single request and get a URL back. Refused above about 1 MB.

One call instead of two, for a screenshot or a logo. Anything from about 1 MB up is refused with a 413 — and a photograph from a phone is larger than that, so use the presigned route for those.

Headers

X-Api-Keystringrequired

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

Content-Typestringrequired

multipart/form-data — not JSON. Most HTTP clients set this for you when you attach a file.

Request

Filebinaryrequired

The image itself, as a form field named exactly "File". JPEG, PNG or WebP. Measured on production: 1.4 MB comes back 413, so anything from about 1 MB up needs the presigned route instead.

Response

imageUrlstring

Where the image now lives. This is what you pass as referenceImages.

imageIdstring

Measured on production: the same string as imageUrl, not a separate id. Use imageUrl — the name of this field promises something it does not deliver.

imageTypestring

Always "UPLOADED" for this endpoint. It tells apart images you sent from ones the platform generated.

POST/images/upload
curl -X POST   https://sangtao.ai/api/v2/images/upload   -H "X-Api-Key: YOUR_KEY"   -F "[email protected]"
{
  "success": true,
  "data": {
    "imageId": "https://cdn.sangtao.ai/content/284c42a4-.../0a900d6.png",
    "imageUrl": "https://cdn.sangtao.ai/content/284c42a4-.../0a900d6.png",
    "imageType": "UPLOADED"
  },
  "error": null,
  "errorCode": null
}