sangtao.ai
API key

Characters

Upload a reference image

Upload a reference image to a character: JPEG, PNG or WEBP, up to 10 MB.

POSThttps://api.sangtao.ai/v2/characters/{id}/ref-images

Authorization

  • X-Api-Keystring · headerrequired

    Your API key, from the API keys page of your account.

Path parameters

  • idstringrequired

    The ID in the path.

Sent as multipart/form-data, the file in the field file — e.g. curl -F "[email protected]". The playground cannot send a file, so the code column shows only the address.

Body

  • filefile · multipart/form-datarequired

    The image: JPEG, PNG or WEBP, up to 10 MB

Response

The image added: { id, imageUrl, thumbnailUrl, sortOrder } — as the refImages[] items under List characters. At most 3 images per character.

Errors

StatuserrorCodeWhen
400VALIDATION_ERRORNo file, not a JPEG, PNG or WEBP, over 10 MB, or the character already has 3 images (the 4th is refused)
404CHARACTER_NOT_FOUNDNo such character, or it is not yours

An error has success: false, errorCode as above, and error is a sentence saying what went wrong.

POST/characters/{id}/ref-images
curl -X POST "https://api.sangtao.ai/v2/characters/ch_3kT9qPz0B/ref-images" \
  -H "X-Api-Key: YOUR_API_KEY"
{
  "success": true,
  "data": {
    "id": "ci_8hQ2mZr4K",
    "imageUrl": "https://…/a.png",
    "thumbnailUrl": "https://…/a_thumb.webp",
    "sortOrder": 0
  }
}