Skip to main content
POST
Node.js

Authorizations

Authorization
string
header
required

Send your API key as a bearer token: Authorization: Bearer sk_<secret>.

Body

application/json
model
string
required

AI model ID. See supported models.

prompt
string
required

Description of the image to generate or an editing instruction.

Required string length: 1 - 4096
images
object[]
Maximum array length: 8
aspect_ratio
string

Optional output aspect ratio. See supported values by model.

resolution
string

Optional output resolution. See supported values by model.

output_format
enum<string>
default:jpeg

Output image format.

Available options:
png,
jpeg,
webp

Response

Image generation completed.

id
string
required

The ID of the generation request.

status
string
required
Allowed value: "completed"
model
string
required

The model used for the generation.

data
object[]
required

The media items for the generation.

usage
object
required