POST
/
images
/
generations
Create image
curl --request POST \
  --url https://api.together.xyz/v1/images/generations \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "prompt": "cat floating in space, cinematic",
  "model": "stabilityai/stable-diffusion-xl-base-1.0",
  "steps": 20,
  "seed": 123,
  "n": 1,
  "height": 1024,
  "width": 1024,
  "negative_prompt": "<string>"
}'
{
  "id": "<string>",
  "model": "<string>",
  "object": "list",
  "data": [
    {
      "index": 123,
      "b64_json": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
default:default
required

Body

application/json

Response

200 - application/json

Image generated successfully

The response is of type object.