Full JSON Schema and combination constraints
{
"type": "object",
"allOf": [
{
"if": {
"required": [
"output_format"
],
"properties": {
"output_format": {
"const": "gif"
}
}
},
"then": {
"not": {
"required": [
"output_compression"
]
},
"properties": {
"images": {
"maxItems": 0
}
}
}
},
{
"if": {
"anyOf": [
{
"required": [
"frame_count"
]
},
{
"required": [
"frame_duration_ms"
]
}
]
},
"then": {
"required": [
"output_format"
],
"properties": {
"output_format": {
"const": "gif"
}
}
}
}
],
"required": [
"prompt"
],
"properties": {
"size": {
"type": "string",
"pattern": "^(?:auto|[1-9][0-9]{1,4}x[1-9][0-9]{1,4})$",
"description": "Takes precedence over aspect_ratio. auto is priced as 2k and routes only to channels that support native auto. Concrete WxH uses native passthrough or the channel nearest-size policy."
},
"count": {
"enum": [
1
],
"type": "integer"
},
"images": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"maxItems": 20
},
"prompt": {
"type": "string",
"maxLength": 100000,
"minLength": 1
},
"quality": {
"enum": [
"low",
"medium",
"high",
"xhigh",
"max",
"auto"
],
"default": "medium"
},
"background": {
"enum": [
"auto",
"transparent",
"opaque"
]
},
"resolution": {
"enum": [
"1k",
"2k",
"4k"
],
"default": "1k"
},
"frame_count": {
"type": "integer",
"maximum": 16,
"minimum": 2
},
"aspect_ratio": {
"enum": [
"21:9",
"16:9",
"3:2",
"4:3",
"5:4",
"1:1",
"4:5",
"3:4",
"2:3",
"9:16",
"2:1",
"1:2",
"9:21"
]
},
"output_format": {
"enum": [
"png",
"jpeg",
"webp",
"gif"
],
"default": "jpeg"
},
"response_format": {
"enum": [
"url",
"b64_json"
]
},
"frame_duration_ms": {
"type": "integer",
"maximum": 2000,
"minimum": 20
},
"output_compression": {
"type": "integer",
"maximum": 100,
"minimum": 0
}
},
"additionalProperties": false
}