Skip to main content
Submit an APIMart-compatible GPT Image 2 text-to-image task

Authorizations

Authorization
string
header
required

Use Authorization: Bearer <YIR_API_KEY>. Upstream provider keys are not accepted.

Headers

Idempotency-Key
string

Optional caller-generated key. Reusing a key with a different request is rejected.

Maximum string length: 255

Body

application/json

The JSON body must be no larger than 256 KiB. Unknown fields are rejected.

model
string
required
Allowed value: "gpt-image-2"
prompt
string
required

Non-blank Unicode text prompt

Required string length: 1 - 20000
Pattern: \S
size
enum<string>
required

Some KIE resolution/aspect-ratio combinations are unsupported: auto requires 1K; 1:1 rejects 4K; 5:4, 4:5, 3:1, 1:3 and 9:21 require 1K.

Available options:
auto,
1:1,
3:2,
2:3,
4:3,
3:4,
5:4,
4:5,
16:9,
9:16,
2:1,
1:2,
3:1,
1:3,
21:9,
9:21
resolution
enum<string>
required
Available options:
1k,
2k,
4k
n
integer
required

Response

Task accepted

code
integer
required
data
object[]
required
Required array length: 1 element