Skip to main content
POST
This API endpoint allows you to generate images from text prompts using various image generation models.
Images stored via URL are only available for 1 hour after generation. Make sure to download and save important images locally.

Create Image Generation

To generate an image, use the following endpoint: POST /v1/images/generations

Request Body

string
required
The image generation model to use (e.g., “flux-1-schnell”)
string
required
The text prompt for image generation
string
Provider-specific quality preset
string
Target image resolution (e.g., “1024x1024”)
integer
Number of images to generate (default: 1)

Authorizations

Authorization
string
header
required

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

Headers

x-api-key
string

Body

application/json
model
string
required

Image generation model (e.g., flux-1-schnell)

prompt
string
required

The text prompt for image generation

quality
string | null

Provider-specific quality preset

size
string | null

Target image resolution (e.g., 1024x1024)

n
integer | null
default:1

Number of images to generate

response_format
enum<string>
default:url

Output format per image

Available options:
url,
b64_json
steps
integer | null

Number of diffusion steps

seed
integer | null

Random seed for reproducibility

negative_prompt
string | null

Negative prompt for image generation

guidance
number | null

Guidance scale for image generation

async
boolean
default:false

Queue the request and return a task ID instead of waiting for the image result

Response

Successful Response

created
integer
required

Unix timestamp of request creation

data
ImageData · object[]
required

Array of generated image objects