POST
/v1/flows/image
ElevenLabs APICreate Image Generation
- Base URL
- https://api.elevenlabs.io
- Auth
- xi-api-key: <ELEVENLABS_API_KEY>
- Last verified
- 2026-09-03 · upstream hash matched
Actions
Agents: curl -H "Accept: text/markdown" this URL
→ 215 tokens · Vary: Accept
→ 215 tokens · Vary: Accept
Critical gotchas
Authentication uses the non-standard xi-api-key header, not Authorization: Bearer. Sending a Bearer token returns HTTP 401.
Text-to-speech responses are raw binary audio, not JSON. Write the body to a file (--output speech.mp3) rather than parsing it.
cURL
curl -X POST 'https://api.elevenlabs.io/v1/flows/image' \ -H "xi-api-key: $ELEVENLABS_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "webhook": { "type": "all" }, "prompt": "string", "images": [ { "type": "string", "generation_id": "string" } ], "mask": { "type": "string", "generation_id": "string" }, "quality": "medium", "background": "auto", "aspect_ratio": "1:1", "model_id": "string"}'Get a free ElevenLabs API key → sponsored
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| webhook | body | object | No | Include to send the generation's result to the workspace's configured flows webhooks once it completes or fails. The webhook payload matches the terminal response of the corresponding GET endpoint. |
| prompt | body | string | Yes | A text description of the image to generate. |
| images | body | object[] | No | Up to 5 reference images to edit or draw from. |
| mask | body | object | No | An image whose fully transparent areas mark where the first reference image may be edited; requires `images`. |
| quality | body | string | No | The quality of the output image. |
| background | body | string | No | The background of the output image. With `auto`, the model picks the background that suits the image. |
| aspect_ratio | body | string | No | The aspect ratio of the output image. |
| model_id | body | string | Yes | The model to use for the generation. |
Response 200 OK
{
"id": "JWr5N6X9ZTqf8jD2LmQb",
"status": "pending"
}