Skip to content
WRAITHERIXDocsENRU

Generate image

POST
/v1/images/generations
curl --request POST \
--url https://api.wraitherix.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "model": "gpt-image-2.5", "prompt": "A watercolor fox in a misty forest", "size": "1024x1024" }'

Creates images from a text prompt. Billed per image.

Media typeapplication/json
object
model
required
string
prompt
required
string
n
integer
default: 1
size
string
quality
string
Allowed values: low medium high auto
background
string
Allowed values: transparent opaque auto

Example

{
"model": "gpt-image-2.5",
"prompt": "A watercolor fox in a misty forest",
"size": "1024x1024"
}

Generated images (base64).

Media typeapplication/json
object
created
integer
data
Array<object>
object
b64_json
string
url
string
revised_prompt
string

Example generated

{
"created": 1,
"data": [
{
"b64_json": "example",
"url": "example",
"revised_prompt": "example"
}
]
}

The request is malformed or a parameter is invalid.

Media typeapplication/json
object
error
object
message
string
type
string
param
string
code
string

Example

{
"error": {
"message": "Invalid request body",
"type": "invalid_request_error",
"param": "",
"code": "invalid_request"
}
}

Missing or invalid API key.

Media typeapplication/json
object
error
object
message
string
type
string
param
string
code
string

Example

{
"error": {
"message": "Invalid API key",
"type": "api_error",
"param": "",
"code": ""
}
}

Not enough credits on the account, or the key has reached its own credit limit.

Media typeapplication/json
object
error
object
message
string
type
string
param
string
code
string

Example

{
"error": {
"message": "Insufficient balance",
"type": "api_error",
"param": "",
"code": "insufficient_user_quota"
}
}