Skip to main content
POST
Create an image

Authorizations

Authorization
string
header
required

Your one-api.ai API key.

Query Parameters

wait
integer
default:0

Hold the call open until the task finishes, for at most this many seconds. Prefer: wait=<seconds> does the same.

Required range: 0 <= x <= 60

Body

application/json
model
enum<string>
required
Available options:
z-image-turbo
prompt
string
required

What to draw.

Required string length: 1 - 2000
size
enum<string>
default:1:1

Aspect ratio.

Available options:
1:1,
4:3,
3:4,
16:9,
9:16,
3:2,
2:3
resolution
enum<string>
default:1K

Resolution tier. Not case-sensitive.

Available options:
1K,
2K
seed
integer

Seed for a reproducible result.

output_format
enum<string>
default:jpg
Available options:
jpg,
png,
webp
n
enum<integer>
default:1

Images per request. Only 1 is accepted.

Available options:
1

Response

The task was accepted. Without wait, the entry holds the task id and submitted. With wait, it also holds the task as it stood when the wait ended.

code
integer
required
Example:

200

data
object[]
required
Required array length: 1 element