Skip to content

DocsAPI reference

Images

POST /v1/images/generations — photorealistic images with legible text from Z-Image-Turbo on your own GPU, in OpenAI's images format.

HTTP
POST https://osarai.xyz/v1/images/generations

Generates images from a text prompt in OpenAI's images format. Deploy Z-Image-Turbo (z-image-turbo): photorealistic images with legible English and Chinese text, in 8 steps.

Request

Terminal
curl "https://osarai.xyz/v1/images/generations" \
  -H "Authorization: Bearer $OSARAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "A red fox in fresh snow at sunrise, soft light, 35 mm photo",
    "size": "1024x1024",
    "n": 1,
    "response_format": "b64_json"
  }' | jq -r '.data[0].b64_json' | base64 --decode > fox.png
FieldNotes
modelz-image-turbo
promptWhat to draw. Put text you want in the image in quotes
size512x512, 768x768, 1024x1024, 1280x720, 720x1280
nNumber of images, 1 to 4
response_formatb64_json

Response

JSON
{
  "created": 1793952000,
  "data": [{ "b64_json": "iVBORw0KGgoAAAANSUhEUgAA…" }]
}

Each image is a base64-encoded PNG. Images are not stored: save them from the response.