Generate AI images for avatars, banners, and scenes.
Every route and HTTP method below was checked directly against the live ts-api source on August 13, 2026. Response bodies are illustrative examples, never captured responses.
Base URL
https://api.dyva.ai/v1/v1/images/generateGenerate an image from a text prompt. Costs 10 Sparks, deducted from your account balance; returns 402 if the balance is insufficient. Requires an Idempotency-Key header.
Route and method verified directly against the live ts-api source on August 13, 2026.
Request body (3)
promptstringRequiredstylestringOptionalaspect_ratiostringOptionalResponse
Illustrative example, not a captured response{
"url": "https://cdn.dyva.ai/generated/EXAMPLE00001.webp",
"prompt": "A wise old wizard with a long silver beard, mystical blue eyes",
"credits_used": 10
}Examples (3)
curl -X POST https://api.dyva.ai/v1/images/generate \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Idempotency-Key: YOUR_UNIQUE_REQUEST_ID" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A wise old wizard with a long silver beard, mystical blue eyes",
"style": "avatar",
"aspect_ratio": "1:1"
}'