Skip to main content
POST
/
v3
/
images
/
generations
Image Generations
curl --request POST \
  --url https://api.edenai.run/v3/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "n": 5,
  "size": "<string>",
  "user": "<string>",
  "metadata": {},
  "extra_headers": {},
  "quality": "<string>",
  "response_format": "<string>"
}
'
{
  "cost": 123,
  "provider": "<string>",
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ],
  "usage": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

OpenAI-compatible POST /v1/images/generations request body.

model
string
required

provider/model, e.g. 'openai/gpt-image-2'

prompt
string
required
Required string length: 1 - 32000
n
integer | null
Required range: 1 <= x <= 10
size
string | null

Provider-specific size string. OpenAI accepts '1024x1024', '1536x1024', '1024x1536', 'auto'. Vertex Imagen accepts square or aspect-ratio strings. Validation is delegated to the provider.

user
string | null

End-user identifier for abuse tracking.

metadata
Metadata · object

Arbitrary metadata attached to the request.

extra_headers
Extra Headers · object

Additional HTTP headers forwarded to the provider API. Credential headers (Authorization, x-api-key, ...) are rejected.

quality
string | null

Provider-specific quality string (e.g. 'low', 'medium', 'high', 'standard', 'hd', 'auto'). Accepted values depend on the model.

response_format
string | null

Legacy DALL-E parameter. Ignored by gpt-image-* and forwarded to the provider for any model that still honors it.

Response

Successful Response

OpenAI-compatible image response + Eden cost / provider fields.

Shared by POST /v3/images/generations and POST /v3/images/edits — the wire shape is identical.

cost
number | null
provider
string | null
created
integer | null
data
ImageDataItem · object[]
usage
Usage · object