Docs / API Reference / Generate Image
POST
/v1/images/generationsGenerate Image
OpenAI-compatible image generation. The response contains image URLs directly; no task polling is involved.
#Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Image model ID: grok-imagine-image or grok-imagine-image-quality |
prompt | string | Yes | Text description of the image |
n | integer | No | Number of images to generate. Default: 1 |
size | string | No | Output size, model-dependent (e.g. "1024x1024") |
#Example request
terminalbash
curl https://relaydance.com/v1/images/generations \
-H "Authorization: Bearer $RELAYDANCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image",
"prompt": "A photorealistic sunset over snow-capped mountains",
"n": 1
}'#Response
response.jsonjson
{
"data": [
{ "url": "https://..." }
]
}The OpenAI SDK works too:
client.images.generate(...) with the base URL set to https://relaydance.com/v1. See the Image Generation guide for SDK samples.