Create image
Creates one or more images from a text prompt.
Response headers
Inference-Id— Unique ID for this request. Include this when contacting support.
Error codes
| Status | Meaning |
|---|---|
402 | Insufficient credits |
429 | Rate limited |
504 | No backend available |
529 | No healthy backends are available for the requested model |
Authorization
BearerAuth API key passed as Bearer token
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v1/images/generations" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "prompt": "string" }'{
"created": 0,
"data": [
{
"b64_json": "string",
"url": "string",
"revised_prompt": "string"
}
]
}Edit image
Edits an existing image based on a text prompt. Accepts `multipart/form-data` with the original image attached as `image`. **Response headers** - `Inference-Id` — Unique ID for this request. Include this when contacting support. **Error codes** | Status | Meaning | |--------|---------| | `402` | Insufficient credits | | `429` | Rate limited | | `504` | No backend available | | `529` | No healthy backends are available for the requested model |
Models
List the open source models available to your account through the OpenAI-compatible models endpoint.