Skip to main content
POST
Create an AIHubMix image generation

Authorizations

Authorization
string
header
required

Gateway-issued API key, formatted as sk-gateway-xxxxxxxx. Used by OpenAI-shaped endpoints (/v1/chat/completions, etc.).

Body

application/json
model
string
required

Image model ID.

prompt
string
required
Minimum string length: 1
n
integer | null
default:1
Required range: x >= 1
size
string | null
Pattern: ^[1-9][0-9]*x[1-9][0-9]*$
aspect_ratio
string | null
seed
integer | null
negative_prompt
string | null
image
any | null

Single input image as a URL, data URI, Base64 value, or URL object.

images
any[] | null
mask
any | null

Optional edit mask.

output_format
enum<string> | null
default:png
Available options:
png,
jpeg,
webp
response_format
enum<string> | null
default:url
Available options:
url,
b64_json
async
boolean
default:false
webhook_url
string<uri>
Maximum string length: 512
webhook_events_filter
enum<string>[]
Minimum array length: 1
Available options:
completed,
failed,
cancelled
extra
object | null

Response

Image generation task

id
string
required

Platform task ID.

object
enum<string>
required
Available options:
image,
video
model
string
required
status
enum<string>
required

Current task state. Completed, failed, and cancelled are terminal states.

Available options:
pending,
in_progress,
completed,
failed,
cancelled
output
object[]
required
error
object | null
required
created_at
integer<int64>
required

Unix timestamp in seconds.

completed_at
integer<int64> | null
required
expires_at
integer<int64> | null
required

Artifact expiry time in Unix seconds; may be null before completion.