Text to Image
POST /api/v1/text-to-image/submit
prompt is required.
Required inputs
promptstring- Text description of the image to generate.
Edit the sample inputs for your own task before submitting.
# Set VIDMAGE_IDEMPOTENCY_KEY to a unique value for this task; preserve it for transport retries.
curl -X POST "https://vidmage.ai/api/v1/text-to-image/submit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ${VIDMAGE_IDEMPOTENCY_KEY}" \
-H "Content-Type: application/json" \
-d '{"prompt":"A cozy reading nook beside a rain-streaked window, warm lamplight, realistic interior photography","aspectRatio":"9:16","width":"1080","height":"1920"}'
# -> { "success": true, "taskId": "...", "creditsConsumed": ... }Parameters and input rules4 fields
| Field | Type | Required | Default | Meaning and limits |
|---|---|---|---|---|
prompt | string | Yes | Not specified | Text description of the image to generate. No additional field constraint listed. |
aspectRatio | string | No | "9:16" | Preferred output aspect ratio. Exact pixel dimensions are chosen by the provider. Values: "auto", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5", "21:9" · Default: "9:16" |
width | string | No | "1080" | Legacy width hint used with height to infer aspect ratio when aspectRatio is omitted. It does not guarantee exact output pixels. Default: "1080" |
height | string | No | "1920" | Legacy height hint used with width to infer aspect ratio when aspectRatio is omitted. It does not guarantee exact output pixels. Default: "1920" |
Retrieve the result
Save taskId from the accepted submission and send it to this endpoint:
POST /api/v1/text-to-image/query
Use the same Bearer API key. On completion, read the imageUrl result field.
curl -X POST "https://vidmage.ai/api/v1/text-to-image/query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "taskId": "TASK_ID_FROM_SUBMIT" }'
# -> { "success": true, "data": { "status": "...", "imageUrl": "https://..." } }