Loading...
Grok Imagine 2.0 API
xAI's current Grok Imagine — the same irreverence at higher fidelity, from a prompt or from up to three source images.
Endpoint
POST https://api.hedra.com/v3/models/grok-imagine-20
Example request
curl -X POST "https://api.hedra.com/v3/models/grok-imagine-20" \
-H "Authorization: Key $HEDRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": {"prompt": "a cinematic shot of a city at dusk", "aspect_ratio": "<aspect_ratio>", "resolution": "<resolution>"}}'Parameters
- promptstringrequired
Generation prompt. At most 8000 characters.
- num_outputsinteger
Number of outputs generated per job. Only 1 is supported.
- enhance_promptboolean
Rewrite the prompt before generation. An LLM expands it into a fuller description and the model receives that text instead of the submitted one; the result's `prompt` reports what ran.
- imagesarray
Images to edit or blend; omit to render from the prompt alone. 1 to 3 images, each at most 30 MB.
- aspect_ratiostringrequired
Output aspect ratio.
- resolutionstringrequired
Output resolution.
- output_formatstring
Output image format.