Skip to main content
POST
/
v3
/
images
Generate an image
curl --request POST \
  --url https://api.opper.ai/v3/images \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>"
}
'
{
  "created": 123,
  "data": [
    {
      "b64_json": "<string>",
      "file_id": "<string>",
      "mime_type": "<string>",
      "revised_prompt": "<string>",
      "url": "<string>"
    }
  ],
  "id": "<string>",
  "model": "<string>",
  "usage": {
    "cost": 123,
    "images": 123
  }
}
See the Images guide for runnable examples, edit / image-to-image, and model discovery.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Body

application/json
model
string
required
prompt
string
required
aspect_ratio
string
image
string
mask
string
n
integer
parameters
object
quality
string
reference_images
string[]
response_format
string
size
string
store
boolean

Persist each generated image to /v3/files and return a reusable file_id per image. Defaults to true; set false to skip.

style
string

Response

Successful response

created
integer
required
data
object[]
required
id
string
required
model
string
required
usage
object
required