Generate image
/v1/image-generatorGenerates an image from a text prompt and stores it as an asset you can drop straight into a project scene. Some models accept a reference image to carry over a look, a subject, or a layout.
- Only the models marked as supporting a reference image read reference_image_url.
- Credits:
- 1 image credit
- Rate limit:
- Default tier, 2/s and 50/min
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| prompt | body | string | Yes | What to generate. Max 2,000 characters. |
| model | body | string | No | Which model renders the image.default black-forest-labs/flux-schnellblack-forest-labs/flux-schnellbytedance/seedream-4.5bytedance/seedream-5-liteideogram-ai/ideogram-v3-turbobria/image-3.2google/nano-bananagoogle/nano-banana-pro |
| aspect_ratio | body | string | No | Output shape.default 1:11:116:99:164:33:4 |
| reference_image_url | body | string | No | Public https URL of an image to steer the result. Must be https on port 443. Plain http and non-standard ports are rejected. |
Request
curl -X POST "https://api.crayo.ai/v1/image-generator" \
-H "Authorization: Bearer $CRAYO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a golden retriever surfing a wave at sunset, cinematic",
"model": "black-forest-labs/flux-schnell",
"aspect_ratio": "9:16"
}'Response
{
"image": "https://cdn-crayo.com/user-uploads/cm7x0v8qa0000abcd/9f1.../image.png",
"asset": {
"id": "cm7x1j0aa0000abcd",
"name": "image",
"key": "user-uploads/cm7x0v8qa0000abcd/9f1.../image.png",
"url": "https://cdn-crayo.com/user-uploads/cm7x0v8qa0000abcd/9f1.../image.png",
"type": "image",
"category": "generation",
"size": 482913,
"createdAt": "2026-08-21T14:02:11.000Z"
}
}Errors
- 400VALIDATION_ERRORprompt is missing, or aspect_ratio is not a supported value.
- 401MISSING_API_KEYNo Authorization header was sent, or it does not carry a crayo_sk_ key.
- 401UNAUTHORIZEDThe key sent is malformed, expired, or revoked.
- 402INSUFFICIENT_CREDITSYou have no image credits left.
- 429RATE_LIMITEDOver the rate limit. Wait Retry-After seconds.
- 500SERVER_ERRORSomething failed on our side. Retry with backoff.