RelayDanceRelayDance
HomeModelsPricingDocsGet API Key

Docs / API Reference / Generate Image

POST/v1/images/generations

Generate Image

OpenAI-compatible image generation. The response contains image URLs directly; no task polling is involved.

#Request body

ParameterTypeRequiredDescription
modelstringYesImage model ID: grok-imagine-image or grok-imagine-image-quality
promptstringYesText description of the image
nintegerNoNumber of images to generate. Default: 1
sizestringNoOutput 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.