Grok AI Image Generator
POST /api/v1/grok-ai-image-generator/submit
prompt is required.
Required inputs
promptstring- Text prompt describing the image to generate (max 20000 chars). For an unspecified character or figurine, use an original non-branded character with no logos and no resemblance to existing copyrighted superheroes; preserve any character the user explicitly names.
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/grok-ai-image-generator/submit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ${VIDMAGE_IDEMPOTENCY_KEY}" \
-H "Content-Type: application/json" \
-d '{"prompt":"A retro-futuristic electric motorcycle parked beneath neon signs on a rainy city street","aspectRatio":"1:1","resolution":"1k","numImages":"1","outputFormat":"jpeg"}'
# -> { "success": true, "taskId": "...", "creditsConsumed": ... }Parameters and input rules6 fields
| Field | Type | Required | Default | Meaning and limits |
|---|---|---|---|---|
prompt | string | Yes | Not specified | Text prompt describing the image to generate (max 20000 chars). For an unspecified character or figurine, use an original non-branded character with no logos and no resemblance to existing copyrighted superheroes; preserve any character the user explicitly names. Minimum length: 1 · Maximum length: 20000 |
imageUrl | string | No | Not specified | Optional input image URL. When provided, the task runs in image edit mode. In that mode, output ratio is inferred from the input image. No additional field constraint listed. |
aspectRatio | string | No | "1:1" | Output aspect ratio for modes that expose a ratio parameter. Ignored when imageUrl selects a mode whose ratio is inferred from the input image. Values: "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3" · Default: "1:1" |
resolution | string | No | "1k" | Output resolution tier. Ignored when imageUrl selects a mode that does not expose resolution. Values: "1k", "2k" · Default: "1k" |
numImages | string | No | "1" | Number of image variations to generate. Values: "1", "2", "3", "4" · Default: "1" |
outputFormat | string | No | "jpeg" | Output image file format. Values: "jpeg", "png", "webp" · Default: "jpeg" |
Mode-specific fields & media limits
Text To Image rules
| Control | Mode-specific rule |
|---|---|
prompt | Required; minimum 1 characters; maximum 4000 characters |
aspectRatio | Values: "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"; mode default: "1:1" |
resolution | Values: "1k", "2k"; mode default: "1k" |
numImages | Values: "1", "2", "3", "4"; Default: "1" |
outputFormat | Values: "jpeg", "png", "webp"; Default: "jpeg" |
Image Edit rules
| Control | Mode-specific rule |
|---|---|
prompt | Required; minimum 5 characters; maximum 20000 characters |
imageUrl | Image input |
Retrieve the result
Save taskId from the accepted submission and send it to this endpoint:
POST /api/v1/grok-ai-image-generator/query
Use the same Bearer API key. On completion, read the imageUrl result field.
curl -X POST "https://vidmage.ai/api/v1/grok-ai-image-generator/query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "taskId": "TASK_ID_FROM_SUBMIT" }'
# -> { "success": true, "data": { "status": "...", "imageUrl": "https://..." } }