POST
https://api.vaelor.chat/v1/imagesGenerates one image from a text prompt and stores it in your library. The request returns when the image is ready, usually within 10–20 seconds.
Body#
promptstringRequiredWhat to draw, from 1 to 2,000 characters. Describe the subject, setting, style and lighting.
modelenumRequiredrecraft-ai/recraft-v4.1/text-to-image for Flash quality, or recraft-ai/recraft-v4.1-pro/text-to-image for High quality.
widthintegerRequiredWidth in pixels. Must form an allowed size with height (see below).
heightintegerRequiredHeight in pixels.
Allowed sizes#
| Quality | Model | Square | Landscape | Portrait | Cost |
|---|---|---|---|---|---|
| Flash | recraft-v4.1 | 1024×1024 | 1024×576 | 576×1024 | 20 credits |
| High | recraft-v4.1-pro | 2048×2048 | 2048×1152 | 1152×2048 | 60 credits |
Response#
idstringUnique image ID.
promptstringThe prompt you sent.
modelstringThe model that generated the image.
widthintegerWidth in pixels.
heightintegerHeight in pixels.
urlstringA signed download URL, valid for 1 hour. Call List images for a fresh one.
creditCostintegerCredits charged.
usageRemainingintegerYour remaining balance after the charge.
nextRefreshAtstringWhen your plan credits next refresh, in ISO 8601.
createdAtstringCreation time, in ISO 8601.
Example#
curl https://api.vaelor.chat/v1/images \
-H "Authorization: Bearer $VAELOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A lighthouse on a basalt cliff at dusk, long exposure, teal and amber palette",
"model": "recraft-ai/recraft-v4.1/text-to-image",
"width": 1024,
"height": 576
}'const response = await fetch('https://api.vaelor.chat/v1/images', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VAELOR_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'A lighthouse on a basalt cliff at dusk, long exposure, teal and amber palette',
model: 'recraft-ai/recraft-v4.1/text-to-image',
width: 1024,
height: 576
})
})
const image = await response.json()image = requests.post(
"https://api.vaelor.chat/v1/images",
headers={"Authorization": f"Bearer {os.environ['VAELOR_API_KEY']}"},
json={
"prompt": "A lighthouse on a basalt cliff at dusk, long exposure, teal and amber palette",
"model": "recraft-ai/recraft-v4.1/text-to-image",
"width": 1024,
"height": 576,
},
).json()Response200
JSON
{
"id": "3b8f7a2e-91c4-4d0a-8f6e-0c5d2a9e7b14",
"prompt": "A lighthouse on a basalt cliff at dusk, long exposure, teal and amber palette",
"model": "recraft-ai/recraft-v4.1/text-to-image",
"width": 1024,
"height": 576,
"url": "https://files.vaelor.chat/images/3b8f7a2e.webp?X-Amz-Expires=3600&X-Amz-Signature=…",
"creditCost": 20,
"usageRemaining": 280,
"nextRefreshAt": "2026-10-20T12:00:00.000Z",
"createdAt": "2026-10-20T09:41:07.000Z"
}Errors#
| Status | When |
|---|---|
400 | The prompt is empty or too long, or the size isn't allowed for the model. |
402 | Not enough credits for the image. |
502 | The image provider failed. You weren't charged. |
503 | Image generation is temporarily unavailable. |