{
  "openapi": "3.1.0",
  "info": {
    "title": "Killa Tamata AI",
    "version": "0.18.0",
    "description": "API-first prepaid $ credit gateway for Killa Tamata media generation and OpenAI-compatible multimodal inference. Purchase credits, manage keys, submit media jobs, and call Qwen 3.8 27B."
  },
  "servers": [
    {
      "url": "https://api.killatamata.com"
    }
  ],
  "tags": [
    {
      "name": "auth"
    },
    {
      "name": "affiliates"
    },
    {
      "name": "health"
    },
    {
      "name": "catalog"
    },
    {
      "name": "checkout"
    },
    {
      "name": "credits"
    },
    {
      "name": "claim"
    },
    {
      "name": "keys"
    },
    {
      "name": "balance"
    },
    {
      "name": "arcade"
    },
    {
      "name": "studio"
    },
    {
      "name": "media"
    },
    {
      "name": "inference"
    },
    {
      "name": "webhooks"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key"
      }
    },
    "schemas": {
      "OpenAiError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "message",
              "type",
              "param",
              "code"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "code": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "QwenModelList": {
        "type": "object",
        "required": [
          "object",
          "data"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "maxItems": 1,
            "items": {
              "type": "object",
              "required": [
                "id",
                "object",
                "owned_by"
              ],
              "properties": {
                "id": {
                  "const": "qwen3.8-27b-uncensored"
                },
                "object": {
                  "const": "model"
                },
                "created": {
                  "type": "integer"
                },
                "owned_by": {
                  "const": "furgen"
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "QwenTextContentPart": {
        "type": "object",
        "required": [
          "type",
          "text"
        ],
        "properties": {
          "type": {
            "const": "text"
          },
          "text": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "QwenImageContentPart": {
        "type": "object",
        "required": [
          "type",
          "image_url"
        ],
        "properties": {
          "type": {
            "const": "image_url"
          },
          "image_url": {
            "type": "object",
            "required": [
              "url"
            ],
            "properties": {
              "url": {
                "type": "string",
                "pattern": "^data:image/(png|jpeg|webp|gif);base64,",
                "description": "Strict base64 PNG, JPEG, WebP, or GIF data URI. Remote URLs are rejected; decoded image size is limited to 10 MiB."
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "QwenToolCall": {
        "type": "object",
        "required": [
          "id",
          "type",
          "function"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "const": "function"
          },
          "function": {
            "type": "object",
            "required": [
              "name",
              "arguments"
            ],
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "arguments": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "QwenMessage": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "role",
              "content"
            ],
            "properties": {
              "role": {
                "const": "system"
              },
              "content": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "role",
              "content"
            ],
            "properties": {
              "role": {
                "const": "user"
              },
              "content": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/QwenTextContentPart"
                        },
                        {
                          "$ref": "#/components/schemas/QwenImageContentPart"
                        }
                      ]
                    }
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "role"
            ],
            "properties": {
              "role": {
                "const": "assistant"
              },
              "content": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reasoning_content": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tool_calls": {
                "type": "array",
                "minItems": 1,
                "maxItems": 128,
                "items": {
                  "$ref": "#/components/schemas/QwenToolCall"
                }
              }
            },
            "anyOf": [
              {
                "required": [
                  "content"
                ]
              },
              {
                "required": [
                  "reasoning_content"
                ]
              },
              {
                "required": [
                  "tool_calls"
                ]
              }
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "role",
              "tool_call_id",
              "content"
            ],
            "properties": {
              "role": {
                "const": "tool"
              },
              "tool_call_id": {
                "type": "string"
              },
              "content": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "QwenFunctionTool": {
        "type": "object",
        "required": [
          "type",
          "function"
        ],
        "properties": {
          "type": {
            "const": "function"
          },
          "function": {
            "type": "object",
            "required": [
              "name",
              "parameters"
            ],
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "description": {
                "type": "string"
              },
              "parameters": {
                "type": "object",
                "additionalProperties": true
              },
              "strict": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "QwenChatCompletionRequest": {
        "type": "object",
        "required": [
          "model",
          "messages"
        ],
        "properties": {
          "model": {
            "const": "qwen3.8-27b-uncensored"
          },
          "messages": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/QwenMessage"
            }
          },
          "prompt_cache_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Stable identity hint for repeated requests with the same reusable input prefix. The gateway replaces it with an account-scoped opaque handle before forwarding and never persists either value. Do not include secrets or personal data."
          },
          "reasoning_effort": {
            "type": "string",
            "enum": [
              "none",
              "low",
              "medium",
              "high",
              "xhigh"
            ],
            "default": "medium"
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1,
            "maximum": 131072
          },
          "max_completion_tokens": {
            "type": "integer",
            "minimum": 1,
            "maximum": 131072
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "top_k": {
            "type": "integer",
            "minimum": 0
          },
          "min_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "presence_penalty": {
            "type": "number",
            "minimum": -2,
            "maximum": 2
          },
          "repeat_penalty": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "stream_options": {
            "type": "object",
            "required": [
              "include_usage"
            ],
            "properties": {
              "include_usage": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "tools": {
            "type": "array",
            "minItems": 1,
            "maxItems": 128,
            "items": {
              "$ref": "#/components/schemas/QwenFunctionTool"
            }
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "none",
                  "required"
                ]
              },
              {
                "type": "object",
                "required": [
                  "type",
                  "function"
                ],
                "properties": {
                  "type": {
                    "const": "function"
                  },
                  "function": {
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "parallel_tool_calls": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "OpenAI-compatible Qwen request. max_tokens and max_completion_tokens are mutually exclusive. At most 8 inline images are allowed. prompt_cache_key is optional caching identity, not cached content. The total gateway request and response limit is 20 MiB."
      },
      "QwenChatCompletionResponse": {
        "type": "object",
        "description": "OpenAI-compatible completion response. reasoning_content and modern tool_calls may be present. Keyed requests may include best-effort usage.prompt_tokens_details.cached_tokens telemetry. Billing always uses the full prompt_tokens count, and reasoning tokens are included in completion_tokens.",
        "additionalProperties": true
      },
      "QwenInferenceJob": {
        "type": "object",
        "required": [
          "id",
          "object",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ij_[a-f0-9]{64}$"
          },
          "object": {
            "const": "inference.job"
          },
          "status": {
            "type": "string",
            "enum": [
              "creating",
              "queued",
              "dispatching",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "model": {
            "const": "qwen3.8-27b-uncensored"
          },
          "request_id": {
            "type": "string"
          },
          "queue_position": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "estimated_wait_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "created_at": {
            "type": "integer"
          },
          "updated_at": {
            "type": "integer"
          },
          "expires_at": {
            "type": "integer"
          },
          "dispatch_attempts": {
            "type": "integer",
            "minimum": 0
          },
          "next_attempt_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_retry": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "error": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OpenAiError"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": true
      },
      "QwenQueueStatus": {
        "type": "object",
        "description": "Aggregate FIFO queue depth and estimated wait. This response contains no prompt content.",
        "properties": {
          "model": {
            "const": "qwen3.8-27b-uncensored"
          },
          "depth": {
            "type": "integer",
            "minimum": 0
          },
          "estimated_wait_ms": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": true
      },
      "HealthSkillVersion": {
        "type": "object",
        "required": [
          "name",
          "version",
          "compatibleApiVersion",
          "compatibilityPolicy",
          "autoUpdate",
          "manifestUrl",
          "metadataUrl",
          "rootUrl",
          "entrypointUrl"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "compatibleApiVersion": {
            "type": "string"
          },
          "compatibilityPolicy": {
            "type": "string",
            "enum": [
              "exact"
            ]
          },
          "autoUpdate": {
            "type": "boolean"
          },
          "manifestUrl": {
            "type": "string",
            "format": "uri"
          },
          "metadataUrl": {
            "type": "string",
            "format": "uri"
          },
          "rootUrl": {
            "type": "string",
            "format": "uri"
          },
          "entrypointUrl": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": false
      },
      "HealthVersionInfo": {
        "type": "object",
        "required": [
          "release",
          "api",
          "skill"
        ],
        "properties": {
          "release": {
            "type": "string"
          },
          "api": {
            "type": "string"
          },
          "skill": {
            "$ref": "#/components/schemas/HealthSkillVersion"
          }
        },
        "additionalProperties": false
      },
      "HealthResponse": {
        "type": "object",
        "required": [
          "status",
          "service",
          "timestamp",
          "version"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "service": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "$ref": "#/components/schemas/HealthVersionInfo"
          }
        },
        "additionalProperties": false
      },
      "MediaAspectRatio": {
        "type": "string",
        "enum": [
          "1:1",
          "16:9",
          "9:16",
          "9:7",
          "7:9"
        ]
      },
      "MediaImageOutputFormat": {
        "type": "string",
        "enum": [
          "webp",
          "png",
          "jpg"
        ],
        "default": "webp",
        "description": "Optional output image format. Defaults to webp when omitted. Dot-prefixed aliases are also accepted at runtime (.webp, .png, .jpg)."
      },
      "MediaInlineImageSource": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "dataBase64": {
            "type": "string",
            "description": "Raw image bytes encoded as base64 (or data URI). Input is staged on CDN, with best-effort WebP conversion when encoder support is available."
          },
          "mimeType": {
            "type": "string",
            "enum": [
              "image/webp",
              "image/png",
              "image/jpeg",
              "image/jpg"
            ],
            "description": "Supported inline MIME types. image/jpg is accepted and normalized to image/jpeg at runtime."
          }
        },
        "additionalProperties": false,
        "oneOf": [
          {
            "required": [
              "url"
            ]
          },
          {
            "required": [
              "dataBase64"
            ]
          }
        ]
      },
      "MediaImageInput": {
        "oneOf": [
          {
            "type": "string",
            "format": "uri"
          },
          {
            "$ref": "#/components/schemas/MediaInlineImageSource"
          }
        ],
        "description": "Provide either a direct image URL string or an inline image object."
      },
      "MediaVideoWatermark": {
        "type": "object",
        "required": [
          "image",
          "x",
          "y",
          "width",
          "height"
        ],
        "properties": {
          "image": {
            "$ref": "#/components/schemas/MediaImageInput"
          },
          "x": {
            "type": "integer",
            "minimum": 0,
            "description": "Horizontal pixel coordinate from the final delivered frame's top-left corner."
          },
          "y": {
            "type": "integer",
            "minimum": 0,
            "description": "Vertical pixel coordinate from the final delivered frame's top-left corner."
          },
          "width": {
            "type": "integer",
            "minimum": 1,
            "description": "Exact watermark width in final-frame pixels."
          },
          "height": {
            "type": "integer",
            "minimum": 1,
            "description": "Exact watermark height in final-frame pixels."
          }
        },
        "additionalProperties": false,
        "description": "Optional whole-clip watermark. The image is resized exactly to width x height and composited at x,y after final resizing, upscaling, and interpolation. The complete box must fit on the delivered frame. PNG/WebP alpha is preserved; JPEG is opaque."
      },
      "MediaImageDesignBBox": {
        "type": "array",
        "prefixItems": [
          {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          }
        ],
        "minItems": 4,
        "maxItems": 4,
        "description": "Optional normalized bounding box [y_min, x_min, y_max, x_max] in 0-1000 coordinates."
      },
      "MediaImageDesignStyleDescription": {
        "type": "object",
        "required": [
          "aesthetics",
          "lighting",
          "medium"
        ],
        "properties": {
          "aesthetics": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "lighting": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "photo": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "medium": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "art_style": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "color_palette": {
            "type": "array",
            "maxItems": 16,
            "items": {
              "type": "string",
              "pattern": "^#[0-9A-F]{6}$"
            }
          }
        },
        "oneOf": [
          {
            "required": [
              "photo"
            ]
          },
          {
            "required": [
              "art_style"
            ]
          }
        ],
        "additionalProperties": false
      },
      "MediaImageDesignElement": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type",
              "desc"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "obj"
                ]
              },
              "bbox": {
                "$ref": "#/components/schemas/MediaImageDesignBBox"
              },
              "desc": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "color_palette": {
                "type": "array",
                "maxItems": 5,
                "items": {
                  "type": "string",
                  "pattern": "^#[0-9A-F]{6}$"
                }
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "type",
              "text",
              "desc"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text"
                ]
              },
              "bbox": {
                "$ref": "#/components/schemas/MediaImageDesignBBox"
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 240
              },
              "desc": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "color_palette": {
                "type": "array",
                "maxItems": 5,
                "items": {
                  "type": "string",
                  "pattern": "^#[0-9A-F]{6}$"
                }
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "MediaImageDesignPrompt": {
        "oneOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          {
            "type": "object",
            "required": [
              "compositional_deconstruction"
            ],
            "properties": {
              "high_level_description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4000
              },
              "style_description": {
                "$ref": "#/components/schemas/MediaImageDesignStyleDescription"
              },
              "compositional_deconstruction": {
                "type": "object",
                "required": [
                  "background",
                  "elements"
                ],
                "properties": {
                  "background": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "elements": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 64,
                    "items": {
                      "$ref": "#/components/schemas/MediaImageDesignElement"
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Plain text prompt or structured design-caption JSON object. Structured objects are serialized in caption order before generation."
      },
      "MediaInlineAudioSource": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "dataBase64": {
            "type": "string",
            "description": "Raw audio bytes encoded as base64 (or data URI). Input is staged on CDN before provider submission."
          },
          "mimeType": {
            "type": "string",
            "enum": [
              "audio/ogg",
              "audio/opus",
              "audio/wav",
              "audio/x-wav",
              "audio/wave",
              "audio/mpeg",
              "audio/mp3",
              "audio/flac",
              "audio/x-flac",
              "audio/aac",
              "audio/mp4",
              "audio/webm"
            ]
          }
        },
        "additionalProperties": false,
        "oneOf": [
          {
            "required": [
              "url"
            ]
          },
          {
            "required": [
              "dataBase64"
            ]
          }
        ]
      },
      "MediaAudioInput": {
        "oneOf": [
          {
            "type": "string",
            "format": "uri"
          },
          {
            "$ref": "#/components/schemas/MediaInlineAudioSource"
          }
        ],
        "description": "Provide either a direct audio URL string or an inline audio object."
      },
      "MediaJobRequest": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "image.generate"
                ]
              },
              "input": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "aspectRatio": {
                    "$ref": "#/components/schemas/MediaAspectRatio"
                  },
                  "outputFormat": {
                    "$ref": "#/components/schemas/MediaImageOutputFormat"
                  },
                  "highDetail": {
                    "type": "boolean",
                    "default": false,
                    "description": "Optional higher-detail image mode. Defaults to false. Increases inference steps by 50% and billed cost by 50%."
                  },
                  "upscale": {
                    "type": "boolean",
                    "description": "Optional built-in 1.5x upscale toggle. Defaults to false."
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 32,
                    "multipleOf": 32,
                    "description": "Optional explicit output width. Must be provided together with height. Max 4MP total."
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 32,
                    "multipleOf": 32,
                    "description": "Optional explicit output height. Must be provided together with width. Max 4MP total."
                  },
                  "referenceImageUrls": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "description": "URL-only legacy alias for reference images."
                  },
                  "referenceImages": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "$ref": "#/components/schemas/MediaImageInput"
                    },
                    "description": "Preferred reference image input (URL strings or inline objects)."
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "image.design"
                ]
              },
              "input": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "prompt": {
                    "$ref": "#/components/schemas/MediaImageDesignPrompt"
                  },
                  "preset": {
                    "type": "string",
                    "enum": [
                      "quality",
                      "fast"
                    ],
                    "default": "quality",
                    "description": "Prompt-only design preset. Defaults to quality."
                  },
                  "outputFormat": {
                    "$ref": "#/components/schemas/MediaImageOutputFormat"
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 32,
                    "multipleOf": 32,
                    "default": 1024,
                    "description": "Optional explicit output width. Must be provided together with height. Max 4MP total."
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 32,
                    "multipleOf": 32,
                    "default": 1024,
                    "description": "Optional explicit output height. Must be provided together with width. Max 4MP total."
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647,
                    "description": "Optional generation seed. When omitted, the API chooses a random seed and returns it in detailed status metadata."
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "image.edit"
                ]
              },
              "input": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "anyOf": [
                  {
                    "required": [
                      "sourceImageUrl"
                    ]
                  },
                  {
                    "required": [
                      "sourceImage"
                    ]
                  }
                ],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "sourceImageUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "sourceImage": {
                    "$ref": "#/components/schemas/MediaImageInput"
                  },
                  "outputFormat": {
                    "$ref": "#/components/schemas/MediaImageOutputFormat"
                  },
                  "highDetail": {
                    "type": "boolean",
                    "default": false,
                    "description": "Optional higher-detail image mode. Defaults to false. Increases inference steps by 50% and billed cost by 50%."
                  },
                  "referenceImageUrls": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "description": "URL-only legacy alias for reference images."
                  },
                  "referenceImages": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "$ref": "#/components/schemas/MediaImageInput"
                    },
                    "description": "Preferred reference image input (URL strings or inline objects)."
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "video.generate"
                ]
              },
              "input": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "description": "Generates MiniMax H3 text-to-video, image-to-video, or deterministic trim continuation with native audio at 24 FPS. Continuation requires continuationSourceVideoUrl plus continuationSeedTimeSeconds; the service authoritatively probes the source, re-encodes and caches the immediate 56-frame (7/3-second) tail ending at the seed, extracts its terminal anchor PNG, cuts the terminal anchor PNG from the source at the seed, locks generated frame zero to that anchor, grades the boundary and then the whole clip against the chain grade anchor (bounded RGB gain, adaptive exposure, YCbCr mean/std transfer, luma percentile levels, temporal unsharp), conditions H3 Ref2VA on the tail plus its embedded audio, and re-encodes the output at CRF 16. A continuation asking for quality=fast is promoted to the 8-step 768p balanced profile and priced 1.25x the fast tier. Continuation cannot be combined with frame, overlap, or reference-audio inputs. quality=fast uses the latest 4-step Turbo LoRA, quality=balanced (default) uses the latest 8-step Turbo LoRA, and quality=quality uses base H3 at 20 steps with a 50% surcharge. Legacy low and regular map to balanced; high maps to quality. Delivery uses RTXVideoSuperResolution when needed and RIFE interpolation to 60 FPS by default. Stitch the returned continuation after its source with video.combine overlapFrames=1 and frameRate=60 to remove the duplicated boundary frame and matching audio head; the job response also reports seamFinish, and a structured combine should trim (headTrimFrames - 0.5) / frameRate seconds off the continuation head and use a hard cut, never a crossfade.",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000,
                    "description": "MiniMax H3 audiovisual prompt. For image-to-video, use the documented I2VA alignment sentence first, then integrated_multimodal_description, overall_soundscape, and non_diegetic_music. In Shot 1, explicitly preserve the start image's subject identity, appearance, colors, markings or clothing, composition, key objects, and spatial relationships before describing motion. The gateway completes missing I2V structure, but passes already-complete documented prompts through unchanged."
                  },
                  "startFrameImageUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Optional start-frame image URL. Omit for text-to-video mode. Equivalent to sourceImageUrl."
                  },
                  "startFrameImage": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/MediaImageInput"
                      }
                    ],
                    "description": "Optional start-frame image as URL string or inline object. Equivalent to sourceImage."
                  },
                  "sourceImageUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Legacy alias for startFrameImageUrl."
                  },
                  "sourceImage": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/MediaImageInput"
                      }
                    ],
                    "description": "Legacy alias for startFrameImage."
                  },
                  "finalFrameImageUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Optional final-frame steering URL. Can be used with or without referenceAudioUrl/referenceAudio."
                  },
                  "finalFrameImage": {
                    "$ref": "#/components/schemas/MediaImageInput",
                    "description": "Optional final-frame steering (URL string or inline object). Can be used with or without referenceAudioUrl/referenceAudio."
                  },
                  "continuationSourceVideoUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public trusted source MP4 to continue. Must be supplied with continuationSeedTimeSeconds."
                  },
                  "continuationSeedTimeSeconds": {
                    "type": "number",
                    "minimum": 2.5,
                    "maximum": 600,
                    "description": "Exclusive trim endpoint in the source timeline. Legacy requests quantize to milliseconds; boundary version 2 preserves precision and selects the final source presentation timestamp before this endpoint."
                  },
                  "continuationBoundaryVersion": {
                    "type": "integer",
                    "enum": [
                      2
                    ],
                    "description": "Opt into frame-exact exclusive-cut anchoring, including variable frame rate sources. Result seamFinish adds headTrimSeconds and continuationBoundary metadata; omitted preserves legacy preparation and trim semantics."
                  },
                  "continuationGradeAnchorVideoUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Optional chain grade anchor: the ROOT clip of a multi-part chain. Its first frame becomes the fixed grading setpoint for the exposure, color-transfer, and levels passes, so a long chain does not accumulate per-part drift. Omit it for a plain 2-part continuation: those passes then use the terminal anchor and agree with the boundary node, which matches the seam. Requires the continuation fields."
                  },
                  "durationSeconds": {
                    "type": "integer",
                    "minimum": 5,
                    "maximum": 15,
                    "description": "Optional whole-second H3 duration. Defaults to 5 and aligns upward to H3's n % 17 = 5 frame grid."
                  },
                  "durationFrames": {
                    "type": "integer",
                    "minimum": 124,
                    "maximum": 362,
                    "description": "Optional native H3 frame count. Requires 124-362 frames with n % 17 = 5 (for example 124, 243, or 362)."
                  },
                  "aspectRatio": {
                    "$ref": "#/components/schemas/MediaAspectRatio"
                  },
                  "sampledFps": {
                    "type": "integer",
                    "minimum": 24,
                    "maximum": 24,
                    "description": "Optional explicit native FPS. MiniMax H3 is fixed at 24 FPS, so omit this field or set it to 24."
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 32,
                    "multipleOf": 32,
                    "description": "Optional final output width. Must be provided together with height. The workflow keeps this as the delivered canvas."
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 32,
                    "multipleOf": 32,
                    "description": "Optional final output height. Must be provided together with width. The workflow keeps this as the delivered canvas."
                  },
                  "interpolationFps": {
                    "description": "Optional RIFE output FPS target. Omit for 60 FPS. Use 0 to disable interpolation and keep native 24 FPS. Allowed values: 0 or 30..60.",
                    "default": 60,
                    "anyOf": [
                      {
                        "type": "integer",
                        "const": 0
                      },
                      {
                        "type": "integer",
                        "minimum": 30,
                        "maximum": 60
                      }
                    ]
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647,
                    "description": "Optional deterministic seed. Keep this fixed across clip-B continuation variants when comparing seam quality, color continuity, or overlap strategies."
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "fast",
                      "balanced",
                      "quality",
                      "low",
                      "regular",
                      "high"
                    ],
                    "default": "balanced",
                    "description": "MiniMax H3 quality tier. fast uses FL2VA Turbo 4-step v1.1; balanced uses FL2VA Turbo 8-step v1.0 and is the default; quality uses base H3 at 20 steps with the existing 50% surcharge. Deprecated aliases: low and regular map to balanced, high maps to quality."
                  },
                  "extremeQuality": {
                    "type": "boolean",
                    "default": false,
                    "deprecated": true,
                    "description": "Deprecated compatibility alias. true is equivalent to quality=quality; false is equivalent to quality=balanced."
                  },
                  "watermark": {
                    "$ref": "#/components/schemas/MediaVideoWatermark"
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "video.generate.reference"
                ]
              },
              "input": {
                "x-capabilities": {
                  "independentStartFrame": true,
                  "independentFinalFrame": true,
                  "continuationFinalFrame": true,
                  "maxReferenceImages": 9,
                  "maxReferenceVideos": 3,
                  "continuationReservedImages": 1,
                  "continuationReservedVideos": 1
                },
                "type": "object",
                "required": [
                  "prompt"
                ],
                "description": "Generates a MiniMax H3 video from one or more multimodal references, optionally continuing a source clip. Provide at least one image, video, audio reference, or independent frame guide (a continuation satisfies this on its own); an optional watermark does not satisfy this requirement or affect positional prompt tags. quality=fast uses Ref2VA Turbo 4-step v0.1 with video/audio shifts 12/3 on its 544p profile; quality=balanced uses Ref2VA Turbo 8-step v1.0 with shifts 12/3 on its 768p profile; quality=quality (the backward-compatible default) uses base H3 at 20 steps on the 768p profile. Legacy low and regular map to fast; high maps to quality. Prompt tags are positional: <Picture 1>..<Picture 9> follow image order, <Video 1>..<Video 3> follow video order, and <Audio 1>..<Audio 3> follow standalone audio order. Remote uploaded inputs, including the watermark, must have unique sanitized URL basenames. Reference videos must be public MP4 clips from 2-15 seconds; the gateway probes them and samples their visual frames from the beginning at H3's native 24 FPS, capped to the generated clip's native frame window with possible additional tail trimming for H3 frame-grid alignment. Standalone audio references guide generated audio and are not copied verbatim. All tiers generate native audio, use RTXVideoSuperResolution at ULTRA quality for delivery upscaling when needed, and use RIFE to deliver 60 FPS by default. Aspect-only requests retain the standard delivery canvas; provide explicit width and height for native-size delivery. With continuationSourceVideoUrl + continuationSeedTimeSeconds the gateway probes the source, cuts and caches the immediate 56-frame (7/3-second) tail at CRF 12 plus the terminal anchor PNG taken from the source at the seed, locks generated frame zero to that anchor, grades the boundary and then the whole clip against the chain grade anchor (bounded RGB gain, adaptive exposure, YCbCr mean/std transfer, luma percentile levels, temporal unsharp), conditions H3 Ref2VA on the tail plus its embedded audio, and re-encodes the output at CRF 16. A continuation asking for quality=fast is promoted to the 8-step 768p balanced profile, never the 4-step 544p reference turbo, and is priced 1.25x the fast tier. The response metadata carries seamFinish; trim (headTrimFrames - 0.5) / frameRate seconds off the head of a continuation and hard-cut when stitching.",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000,
                    "description": "MiniMax H3 full-reference prompt. Recommended sections, in order: subject_definitions, summary, retention_analysis, detailed_description, overall_soundscape, and non_diegetic_music. Define reusable visible content as <Subject N> sourced from positional <Picture N>/<Video N> assets, state each reference role and retention relationship explicitly, and use <Audio N> for standalone audio references."
                  },
                  "startFrameImageUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Independent opening guide, centered to the native canvas. Mutually exclusive with startFrameImage and with continuation. Does not consume an appearance slot or change Picture numbering."
                  },
                  "startFrameImage": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/MediaImageInput"
                      }
                    ],
                    "description": "Independent opening guide as a URL or inline image; mutually exclusive with startFrameImageUrl and continuation."
                  },
                  "finalFrameImageUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Independent final native-frame guide, centered to the native canvas. Allowed alongside continuation. Mutually exclusive with finalFrameImage; does not consume an appearance slot."
                  },
                  "finalFrameImage": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/MediaImageInput"
                      }
                    ],
                    "description": "Ending guide as a URL or inline image; mutually exclusive with finalFrameImageUrl."
                  },
                  "referenceImageUrls": {
                    "type": "array",
                    "maxItems": 9,
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "description": "URL-only image references in <Picture N> order. Across this field and referenceImages, at most 9 images are allowed. Distinct image assets with colliding basenames are staged with unique names; video URLs must have unique sanitized basenames."
                  },
                  "referenceImages": {
                    "type": "array",
                    "maxItems": 9,
                    "items": {
                      "$ref": "#/components/schemas/MediaImageInput"
                    },
                    "description": "Image references as URL strings or inline objects, appended after referenceImageUrls for <Picture N> ordering. Distinct image assets with colliding basenames are staged with unique names; video URLs must have unique sanitized basenames."
                  },
                  "referenceVideoUrls": {
                    "type": "array",
                    "maxItems": 3,
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "description": "Public MP4 visual references, each 2-15 seconds, in <Video N> order. Videos are sampled from the beginning at 24 FPS and capped to the generated clip's native frame window; H3 grid alignment can trim additional tail frames. Distinct image assets with colliding basenames are staged with unique names; video URLs must have unique sanitized basenames. Use referenceAudioUrls/referenceAudios when their soundtrack should also guide generation."
                  },
                  "referenceAudioUrls": {
                    "type": "array",
                    "maxItems": 3,
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "description": "URL-only standalone audio references in <Audio N> order. Across this field and referenceAudios, at most 3 audios are allowed."
                  },
                  "referenceAudios": {
                    "type": "array",
                    "maxItems": 3,
                    "items": {
                      "$ref": "#/components/schemas/MediaAudioInput"
                    },
                    "description": "Standalone audio references as URL strings or inline objects, appended after referenceAudioUrls for <Audio N> ordering."
                  },
                  "continuationSourceVideoUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public trusted source MP4 to continue. Must be supplied with continuationSeedTimeSeconds. The prepared terminal anchor takes the first image slot and the prepared tail clip the first video slot, so caller references drop to 8 images and 2 videos and their prompt tags shift up by one (the caller's own first image is still <Picture 1> in the submitted prompt; the gateway renumbers it)."
                  },
                  "continuationSeedTimeSeconds": {
                    "type": "number",
                    "minimum": 2.5,
                    "maximum": 600,
                    "description": "Exclusive trim endpoint in the source timeline. Legacy requests quantize to milliseconds; boundary version 2 preserves precision and selects the final source presentation timestamp before this endpoint."
                  },
                  "continuationBoundaryVersion": {
                    "type": "integer",
                    "enum": [
                      2
                    ],
                    "description": "Opt into frame-exact exclusive-cut anchoring, including variable frame rate sources. Result seamFinish adds headTrimSeconds and continuationBoundary metadata; omitted preserves legacy preparation and trim semantics."
                  },
                  "continuationGradeAnchorVideoUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Optional chain grade anchor: the ROOT clip of a multi-part chain. Its first frame becomes the fixed grading setpoint for the exposure, color-transfer, and levels passes, so a long chain does not accumulate per-part drift. Omit it for a plain 2-part continuation: those passes then use the terminal anchor and agree with the boundary node, which matches the seam. Requires the continuation fields."
                  },
                  "durationSeconds": {
                    "type": "integer",
                    "minimum": 5,
                    "maximum": 15,
                    "description": "Optional whole-second H3 duration. Defaults to 5 and aligns upward to the H3 frame grid."
                  },
                  "durationFrames": {
                    "type": "integer",
                    "minimum": 124,
                    "maximum": 362,
                    "description": "Optional exact H3 native frame count. Must satisfy n % 17 = 5 (124, 243, or 362 are common choices). Do not combine with durationSeconds."
                  },
                  "aspectRatio": {
                    "$ref": "#/components/schemas/MediaAspectRatio"
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 32,
                    "multipleOf": 32,
                    "description": "Optional delivered width. Must be provided together with height."
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 32,
                    "multipleOf": 32,
                    "description": "Optional delivered height. Must be provided together with width."
                  },
                  "interpolationFps": {
                    "description": "Optional RIFE output FPS target. Omit for 60 FPS; use 0 to keep native 24 FPS. Allowed values: 0 or 30..60.",
                    "default": 60,
                    "anyOf": [
                      {
                        "type": "integer",
                        "const": 0
                      },
                      {
                        "type": "integer",
                        "minimum": 30,
                        "maximum": 60
                      }
                    ]
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647,
                    "description": "Optional deterministic H3 seed."
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "fast",
                      "balanced",
                      "quality",
                      "low",
                      "regular",
                      "high"
                    ],
                    "default": "quality",
                    "description": "Reference H3 quality tier. fast uses the 544p Ref2VA Turbo 4-step v0.1 LoRA; balanced uses the 768p Ref2VA Turbo 8-step v1.0 LoRA; quality uses base H3 at 20 steps and remains the default for backward compatibility. Deprecated aliases: low and regular map to fast, high maps to quality."
                  },
                  "watermark": {
                    "$ref": "#/components/schemas/MediaVideoWatermark"
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "video.analyze"
                ]
              },
              "input": {
                "type": "object",
                "required": [
                  "sourceVideoUrl"
                ],
                "properties": {
                  "sourceVideoUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public source video. Redirects and every resolved address are checked against private-network access before authoritative probing."
                  },
                  "frameTimestampsSeconds": {
                    "type": "array",
                    "maxItems": 8,
                    "items": {
                      "type": "number",
                      "minimum": 0
                    },
                    "description": "Extract up to eight full-resolution PNGs. Millisecond-quantized timestamps must precede source end and are part of cache identity. Each distinct frame adds $0.001. Detailed job status returns effectiveInput.extractedFrames with timestampSeconds, url, expiresAt (30 days). Omit to retain the original analysis response."
                  },
                  "sourceFingerprint": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 160,
                    "description": "Optional caller namespace hint. Cache identity always includes a server-derived canonical source fingerprint and authoritative metadata."
                  },
                  "referenceImageUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Optional approved start frame used for early-window visual adherence metrics."
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri"
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "video.combine"
                ]
              },
              "input": {
                "type": "object",
                "oneOf": [
                  {
                    "required": [
                      "videoUrls"
                    ]
                  },
                  {
                    "required": [
                      "clips"
                    ]
                  }
                ],
                "description": "Combines ordered video clips while preserving synchronized embedded audio. Legacy URL and V3 structured requests remain unchanged. Output, framing, clip audio, crossfade curve, or soundtrack options select FCSConcatVideosV4. The URL and clip forms are mutually exclusive.",
                "properties": {
                  "videoUrls": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 24,
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "description": "Ordered source clip URLs. At least two clips are required. Each clip is appended after the previous one. The API submits them to the streaming concat node as direct HTTPS entries."
                  },
                  "clips": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 24,
                    "description": "Ordered edit occurrences. A one-clip request must contain an effective trim, speed, or color edit. Duplicate source URLs are allowed. Authoritative post-speed/post-transition output must be 1-600 seconds.",
                    "items": {
                      "type": "object",
                      "required": [
                        "sourceVideoUrl"
                      ],
                      "properties": {
                        "sourceVideoUrl": {
                          "type": "string",
                          "format": "uri",
                          "description": "Public source URL. Pipe and CR/LF characters, including percent-encoded forms, are rejected."
                        },
                        "sourceDurationSeconds": {
                          "type": "number",
                          "exclusiveMinimum": 0,
                          "maximum": 600,
                          "description": "Advisory preview metadata. Submit-time probing is authoritative and unprobeable sources are rejected."
                        },
                        "trimStartSeconds": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 600,
                          "default": 0
                        },
                        "trimEndSeconds": {
                          "type": "number",
                          "exclusiveMinimum": 0,
                          "maximum": 600
                        },
                        "speed": {
                          "type": "number",
                          "enum": [
                            0.5,
                            1,
                            2,
                            3
                          ],
                          "default": 1
                        },
                        "adjustments": {
                          "type": "object",
                          "properties": {
                            "brightness": {
                              "type": "number",
                              "minimum": 0.25,
                              "maximum": 2,
                              "default": 1
                            },
                            "contrast": {
                              "type": "number",
                              "minimum": 0.25,
                              "maximum": 2,
                              "default": 1
                            },
                            "saturation": {
                              "type": "number",
                              "minimum": 0.25,
                              "maximum": 2,
                              "default": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        "framing": {
                          "type": "object",
                          "required": [
                            "mode"
                          ],
                          "properties": {
                            "mode": {
                              "type": "string",
                              "enum": [
                                "fit",
                                "fill",
                                "custom"
                              ]
                            },
                            "panX": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1,
                              "default": 0.5
                            },
                            "panY": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 1,
                              "default": 0.5
                            },
                            "zoom": {
                              "type": "number",
                              "minimum": 1,
                              "maximum": 3,
                              "default": 1
                            },
                            "fitBackground": {
                              "type": "string",
                              "enum": [
                                "black",
                                "blur"
                              ],
                              "default": "black"
                            },
                            "fadeInSeconds": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 600,
                              "description": "Picture-only fade from black in post-trim, post-speed seconds; audio is unchanged."
                            },
                            "fadeOutSeconds": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 600,
                              "description": "Picture-only fade to black at the clip end. Combined fades must fit within the output clip duration."
                            },
                            "animation": {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "endPanX",
                                "endPanY",
                                "endZoom",
                                "startFraction",
                                "endFraction",
                                "easing"
                              ],
                              "properties": {
                                "endPanX": {
                                  "type": "number",
                                  "minimum": 0,
                                  "maximum": 1
                                },
                                "endPanY": {
                                  "type": "number",
                                  "minimum": 0,
                                  "maximum": 1
                                },
                                "endZoom": {
                                  "type": "number",
                                  "minimum": 1,
                                  "maximum": 3
                                },
                                "startFraction": {
                                  "type": "number",
                                  "minimum": 0,
                                  "maximum": 0.99
                                },
                                "endFraction": {
                                  "type": "number",
                                  "minimum": 0.01,
                                  "maximum": 1
                                },
                                "easing": {
                                  "type": "string",
                                  "enum": [
                                    "linear",
                                    "ease_in_out"
                                  ]
                                }
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        "audio": {
                          "type": "object",
                          "properties": {
                            "muted": {
                              "type": "boolean",
                              "default": false
                            },
                            "gain": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 2,
                              "default": 1
                            },
                            "fadeInSeconds": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 600,
                              "default": 0
                            },
                            "fadeOutSeconds": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 600,
                              "default": 0
                            }
                          },
                          "description": "Fades are validated against authoritative post-speed clip duration.",
                          "additionalProperties": false
                        },
                        "transitionAfter": {
                          "oneOf": [
                            {
                              "type": "object",
                              "required": [
                                "type"
                              ],
                              "properties": {
                                "type": {
                                  "const": "blend"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "type"
                              ],
                              "properties": {
                                "type": {
                                  "const": "cut"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "type",
                                "durationSeconds"
                              ],
                              "properties": {
                                "type": {
                                  "const": "crossfade"
                                },
                                "durationSeconds": {
                                  "type": "number",
                                  "minimum": 0.1,
                                  "maximum": 2
                                }
                              },
                              "additionalProperties": false
                            }
                          ],
                          "description": "Transition into the next clip. Omission defaults to a fixed 19-frame smooth blend; use cut for zero overlap. Crossfades are quantized to milliseconds and capped to leave at least one 60 FPS frame in both neighboring clips. A non-cut transition is invalid on the last clip."
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "overlapFrames": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 120,
                    "default": 1,
                    "description": "Optional number of duplicated head frames to remove from every clip after the first. Use 1 for current `video_ltx23` continuation clips, or raise it if a future workflow carries a longer overlap region."
                  },
                  "frameRate": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 120,
                    "default": 60,
                    "description": "Legacy URL mode uses this to convert overlap frames into audio trim duration. Structured clips always render at 60 FPS and accept only 60 when this field is supplied."
                  },
                  "output": {
                    "type": "object",
                    "required": [
                      "aspectRatio",
                      "resolution"
                    ],
                    "properties": {
                      "aspectRatio": {
                        "type": "string",
                        "enum": [
                          "16:9",
                          "9:16",
                          "1:1",
                          "4:5"
                        ]
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "720p",
                          "1080p"
                        ]
                      },
                      "delivery": {
                        "type": "string",
                        "enum": [
                          "playback",
                          "archive"
                        ],
                        "default": "playback"
                      }
                    },
                    "additionalProperties": false
                  },
                  "audioCrossfadeCurve": {
                    "type": "string",
                    "enum": [
                      "linear",
                      "equalPower"
                    ]
                  },
                  "soundtrack": {
                    "type": "object",
                    "required": [
                      "sourceAudioUrl"
                    ],
                    "properties": {
                      "sourceAudioUrl": {
                        "type": "string",
                        "format": "uri"
                      },
                      "sourceDurationSeconds": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 3600,
                        "description": "Advisory only; server probing is authoritative."
                      },
                      "trimStartSeconds": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 3600,
                        "default": 0
                      },
                      "trimEndSeconds": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 3600
                      },
                      "timelineOffsetSeconds": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 600,
                        "default": 0
                      },
                      "loop": {
                        "type": "boolean",
                        "default": false
                      },
                      "gain": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 2,
                        "default": 1
                      },
                      "fadeInSeconds": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 600,
                        "default": 0
                      },
                      "fadeOutSeconds": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 600,
                        "default": 0
                      },
                      "ducking": {
                        "type": "object",
                        "required": [
                          "enabled",
                          "depthDb"
                        ],
                        "properties": {
                          "enabled": {
                            "type": "boolean"
                          },
                          "depthDb": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 24
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "video.resize"
                ]
              },
              "input": {
                "type": "object",
                "required": [
                  "sourceVideoUrl",
                  "width",
                  "height"
                ],
                "description": "Deterministically rescales an existing remote video to explicit even output dimensions. The gateway probes the source clip at submit time and bills from output resolution plus billable frame count. Provide sourceDurationSeconds only as a fallback when remote probing is unavailable.",
                "properties": {
                  "sourceVideoUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Remote source clip URL to resize."
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 7680,
                    "multipleOf": 2,
                    "description": "Required even output width in pixels."
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 7680,
                    "multipleOf": 2,
                    "description": "Required even output height in pixels."
                  },
                  "frameRate": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 120,
                    "description": "Optional source/output frame rate hint. Defaults to 60 and is used for submit-time billing and duration estimates."
                  },
                  "sourceDurationSeconds": {
                    "type": "number",
                    "minimum": 0.1,
                    "maximum": 600,
                    "description": "Optional source clip duration hint in seconds. Defaults to 8 when omitted for pricing and ETA estimation."
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "audio.speak"
                ]
              },
              "input": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 6000,
                    "description": "TTS synthesis text. OmniVoice/Gemini accept 1..6000 chars. Breeze accepts 1..1500 chars and at most 100 estimated speech seconds; for low-latency playback, keep coherent Breeze clips at or below 420 characters and submit later clips concurrently. Gemini settles to an exact completion-time bill after a submit-time hold; OmniVoice remains submit-time billed."
                  },
                  "provider": {
                    "type": "string",
                    "enum": [
                      "omnivoice",
                      "gemini",
                      "breeze"
                    ],
                    "description": "Optional TTS provider selector. Omit to use OmniVoice. Use gemini for direct Gemini 3.1 Flash TTS single-speaker WAV output. Use breeze for Breeze-TTS-2 design, clone, or direction with mono 24 kHz Opus. Breeze uses provisional submit-time pricing: $0.007 per estimated GPU second, $0.07 minimum."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "voice_design",
                      "voice_clone",
                      "voice_direction"
                    ],
                    "description": "OmniVoice/Breeze mode selector. Reference audio infers voice_clone; Breeze reference audio plus instructions infers voice_direction. Breeze design and direction require instructions; explicit clone rejects instructions. Gemini supports design only."
                  },
                  "voiceDescription": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 240,
                    "description": "OmniVoice-only comma-separated voice tags. Supported English tags in this API release: female, male, child, teenager, young adult, middle-aged, elderly, very low pitch, low pitch, moderate pitch, high pitch, very high pitch, whisper, american accent, british accent, australian accent, canadian accent, indian accent, chinese accent, korean accent, japanese accent, portuguese accent, russian accent. In voice design mode it defines the synthetic voice; in voice clone mode it can add light steering on top of the reference voice."
                  },
                  "voiceName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "description": "Gemini-only voice name. Defaults to Kore when omitted. Keep this as a non-empty string because Google's preview voice inventory can change over time."
                  },
                  "instructions": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000,
                    "description": "Breeze design/direction require natural-language voice/delivery instructions (match text language); clone rejects instructions. Gemini delivery/style guidance. For Gemini, the gateway prepends it ahead of the literal spoken text using 'Read the following text exactly as written:'."
                  },
                  "referenceAudioUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "OmniVoice/Breeze reference audio URL for cloning or Breeze direction. Breeze requires one publicly accessible HTTP(S) URL ending in an audio filename; signed query strings are allowed."
                  },
                  "referenceAudio": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "dataBase64": {
                            "type": "string"
                          },
                          "mimeType": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    ],
                    "description": "OmniVoice/Breeze inline or URL-based reference audio for cloning or Breeze direction. Breeze accepts exactly one source; do not combine with referenceAudioUrl."
                  },
                  "referenceTranscript": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "description": "Required exact transcript matching reference audio for OmniVoice/Breeze cloning and Breeze direction. Use a clip you are authorized to use."
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "English",
                      "en",
                      "Chinese",
                      "zh"
                    ],
                    "description": "English for OmniVoice/Gemini; Breeze also accepts Chinese. Match instructions to text language. Breeze's current optimized acceptance tests are English-only."
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "96k",
                      "128k",
                      "192k"
                    ],
                    "description": "OmniVoice output Opus quality preset. Breeze accepts only 128k (default). Gemini rejects quality."
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647,
                    "description": "Breeze seed: 1..2147483647, default 42. OmniVoice maximum: 2147483647. Gemini rejects seed."
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "audio.annotation.reference"
                ]
              },
              "input": {
                "type": "object",
                "anyOf": [
                  {
                    "required": [
                      "sourceAudioUrl"
                    ]
                  },
                  {
                    "required": [
                      "sourceAudio"
                    ]
                  }
                ],
                "properties": {
                  "sourceAudioUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Source audio URL to annotate."
                  },
                  "sourceAudio": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/MediaAudioInput"
                      }
                    ],
                    "description": "Source audio as URL string or inline base64 object."
                  },
                  "transcript": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 24000,
                    "description": "Optional transcript used for reference anchoring, section recovery, and stronger word timings. If omitted, the gateway switches to transcriptless ASR."
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en"
                    ],
                    "description": "Language code for transcript anchoring or transcriptless ASR."
                  },
                  "transcriptionModel": {
                    "type": "string",
                    "enum": [
                      "distil-large-v3",
                      "large-v3"
                    ],
                    "description": "Whisper model selection for transcription. The default is distil-large-v3 when transcript anchoring is used, and large-v3 when transcriptless ASR is used."
                  },
                  "device": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "cuda",
                      "cpu"
                    ],
                    "description": "Worker execution target hint for the annotation node."
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "ace.step.create"
                ]
              },
              "input": {
                "type": "object",
                "required": [
                  "tags",
                  "lyrics"
                ],
                "properties": {
                  "tags": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "lyrics": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 12000
                  },
                  "qualityPreset": {
                    "type": "string",
                    "enum": [
                      "default",
                      "high_quality"
                    ],
                    "description": "Optional recipe preset. high_quality applies long-form music defaults for Ace Step XL Turbo (108s, 192k). Internal XL Turbo sampler settings are fixed by the API."
                  },
                  "durationSeconds": {
                    "type": "integer",
                    "minimum": 15,
                    "maximum": 240
                  },
                  "bpm": {
                    "type": "integer",
                    "minimum": 40,
                    "maximum": 240
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "96k",
                      "128k",
                      "192k"
                    ],
                    "description": "Output Opus quality preset."
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647
                  },
                  "temperature": {
                    "type": "number",
                    "minimum": 0.1,
                    "maximum": 2
                  },
                  "topP": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "timeSignature": {
                    "type": "string",
                    "enum": [
                      "2",
                      "3",
                      "4",
                      "5",
                      "6",
                      "7"
                    ]
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en"
                    ],
                    "description": "Ace Step 1.5 language code (currently English only)."
                  },
                  "keyScale": {
                    "type": "string",
                    "pattern": "^[A-G](?:#|b)?\\s(?:major|minor)$",
                    "description": "Musical key, for example 'E minor' or 'C major'."
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "moss.sound.effect"
                ]
              },
              "input": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "durationSeconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "96k",
                      "128k",
                      "192k"
                    ],
                    "description": "Output Opus quality preset."
                  },
                  "temperature": {
                    "type": "number",
                    "minimum": 0.1,
                    "maximum": 3
                  },
                  "topP": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "topK": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200
                  },
                  "repetitionPenalty": {
                    "type": "number",
                    "minimum": 0.8,
                    "maximum": 2.5
                  },
                  "maxNewTokens": {
                    "type": "integer",
                    "minimum": 64,
                    "maximum": 4096
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "task",
              "input"
            ],
            "properties": {
              "task": {
                "type": "string",
                "enum": [
                  "trellis.generate"
                ]
              },
              "input": {
                "type": "object",
                "anyOf": [
                  {
                    "required": [
                      "sourceImageUrl"
                    ]
                  },
                  {
                    "required": [
                      "sourceImage"
                    ]
                  }
                ],
                "properties": {
                  "sourceImageUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "sourceImage": {
                    "$ref": "#/components/schemas/MediaInlineImageSource"
                  },
                  "qualityPreset": {
                    "type": "string",
                    "enum": [
                      "performance",
                      "balanced",
                      "fidelity"
                    ],
                    "description": "Preset defaults tuned for speed, balanced quality, or fidelity."
                  },
                  "targetFaceCount": {
                    "type": "integer",
                    "minimum": 1000,
                    "maximum": 500000
                  },
                  "textureSize": {
                    "type": "integer",
                    "enum": [
                      512,
                      1024,
                      2048
                    ]
                  },
                  "textureResolution": {
                    "type": "integer",
                    "enum": [
                      512,
                      1024,
                      1536
                    ],
                    "description": "Texture bake resolution. 1536 requires textureSize=2048 and works best with maxViews<=5 and textureSteps<=16."
                  },
                  "maxViews": {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 6
                  },
                  "sparseStructureSteps": {
                    "type": "integer",
                    "minimum": 8,
                    "maximum": 20
                  },
                  "shapeSteps": {
                    "type": "integer",
                    "minimum": 8,
                    "maximum": 20
                  },
                  "textureSteps": {
                    "type": "integer",
                    "minimum": 8,
                    "maximum": 20
                  },
                  "meshResolution": {
                    "type": "integer",
                    "enum": [
                      128,
                      256,
                      512,
                      1024
                    ]
                  },
                  "removeBackground": {
                    "type": "boolean"
                  },
                  "padding": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 64
                  },
                  "refinerResolution": {
                    "type": "integer",
                    "enum": [
                      512,
                      1024,
                      1536
                    ],
                    "description": "Optional low-poly refiner resolution. 1536 requires textureSize=2048."
                  },
                  "refinerDownsampling": {
                    "type": "integer",
                    "enum": [
                      16,
                      32,
                      64
                    ]
                  },
                  "remeshFillHoles": {
                    "type": "boolean"
                  },
                  "remeshFillHolesMaxPerimeter": {
                    "type": "number",
                    "minimum": 0.005,
                    "maximum": 0.2
                  },
                  "remeshRemoveFloaters": {
                    "type": "boolean"
                  },
                  "remeshRemoveInnerFaces": {
                    "type": "boolean"
                  },
                  "meshClusterConeHalfAngleRad": {
                    "type": "number",
                    "minimum": 35,
                    "maximum": 85
                  },
                  "postprocessPositionEpsilon": {
                    "type": "number",
                    "minimum": 0.000001,
                    "maximum": 0.001,
                    "description": "Optional normal-postprocess epsilon used in low-poly Trellis mesh postprocess."
                  },
                  "postprocessNormalCreaseDeg": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 180,
                    "description": "Optional normal crease angle used in low-poly Trellis mesh postprocess."
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647
                  }
                },
                "additionalProperties": false
              },
              "idempotencyKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "completionCallbackUrl": {
                "type": "string",
                "format": "uri",
                "description": "Optional public HTTP(S) terminal callback URL. Receives one job-level POST when the job reaches a terminal state. URL credentials, redirects, and private, loopback, or internal targets are rejected."
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "X402CreditPurchaseRequest": {
        "type": "object",
        "required": [
          "usdCents"
        ],
        "properties": {
          "usdCents": {
            "type": "integer",
            "minimum": 100,
            "maximum": 900719925474,
            "description": "Credit purchase amount in USD cents. Minimum is $1.00. Maximum is capped for integer-safe micros math."
          },
          "affiliateCode": {
            "type": "string",
            "minLength": 4,
            "maxLength": 32,
            "description": "Optional affiliate code to bind before settling the credit purchase."
          }
        },
        "additionalProperties": false
      },
      "StripeCheckoutRequest": {
        "type": "object",
        "required": [
          "packageCode"
        ],
        "properties": {
          "packageCode": {
            "type": "string",
            "minLength": 1,
            "description": "Package code from GET /api/v1/packages."
          },
          "successUrl": {
            "type": "string",
            "format": "uri",
            "description": "Optional success redirect URL override."
          },
          "cancelUrl": {
            "type": "string",
            "format": "uri",
            "description": "Optional cancel redirect URL override."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Deprecated. Ignored unless it matches the authenticated API key account email exactly."
          },
          "affiliateCode": {
            "type": "string",
            "minLength": 4,
            "maxLength": 32,
            "description": "Optional affiliate code to bind before checkout creation."
          }
        },
        "additionalProperties": false
      },
      "CryptoCheckoutRequest": {
        "type": "object",
        "required": [
          "packageCode"
        ],
        "properties": {
          "packageCode": {
            "type": "string",
            "minLength": 1,
            "description": "Package code from GET /api/v1/packages."
          },
          "redirectUrl": {
            "type": "string",
            "format": "uri",
            "description": "Optional hosted checkout return URL override."
          },
          "cancelUrl": {
            "type": "string",
            "format": "uri",
            "description": "Optional hosted checkout cancel URL override."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Deprecated. Ignored unless it matches the authenticated API key account email exactly."
          },
          "affiliateCode": {
            "type": "string",
            "minLength": 4,
            "maxLength": 32,
            "description": "Optional affiliate code to bind before checkout creation."
          }
        },
        "additionalProperties": false
      },
      "ClaimStripeRequest": {
        "type": "object",
        "required": [
          "sessionId"
        ],
        "properties": {
          "sessionId": {
            "type": "string",
            "minLength": 1,
            "description": "Stripe Checkout Session ID to settle."
          }
        },
        "additionalProperties": false
      },
      "ClaimCryptoRequest": {
        "type": "object",
        "required": [
          "chargeId"
        ],
        "properties": {
          "chargeId": {
            "type": "string",
            "minLength": 1,
            "description": "Coinbase Commerce charge ID to settle."
          }
        },
        "additionalProperties": false
      },
      "ClaimSettlementResponse": {
        "type": "object",
        "required": [
          "provider",
          "packageCode",
          "depositUsdCents",
          "currentBalanceUsdMicros"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "stripe",
              "coinbase"
            ]
          },
          "sessionId": {
            "type": "string",
            "nullable": true
          },
          "chargeId": {
            "type": "string",
            "nullable": true
          },
          "packageCode": {
            "type": "string"
          },
          "depositUsdCents": {
            "type": "integer"
          },
          "currentBalanceUsdMicros": {
            "type": "integer"
          }
        },
        "additionalProperties": false
      },
      "CreateKeyRequest": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Optional key label."
          },
          "idToken": {
            "type": "string",
            "minLength": 20,
            "description": "Optional Google ID token for first-key bootstrap when no API key is available."
          }
        },
        "additionalProperties": false
      },
      "GoogleAuthRequest": {
        "type": "object",
        "required": [
          "idToken"
        ],
        "properties": {
          "idToken": {
            "type": "string",
            "minLength": 20,
            "description": "Google ID token used to mint the first API key for the account."
          },
          "keyLabel": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Optional label for the newly issued API key."
          }
        },
        "additionalProperties": false
      },
      "EmailAuthStartRequest": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "Email address that should receive the one-time verification code."
          }
        },
        "additionalProperties": false
      },
      "EmailAuthVerifyRequest": {
        "type": "object",
        "required": [
          "email",
          "code"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "Same email address used during POST /api/v1/auth/email/start."
          },
          "code": {
            "type": "string",
            "minLength": 6,
            "maxLength": 6,
            "description": "One-time verification code delivered to the email address."
          },
          "keyLabel": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Optional label for the newly issued API key."
          }
        },
        "additionalProperties": false
      },
      "AffiliateValidateCodeRequest": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 4,
            "maxLength": 32,
            "description": "Affiliate code to validate."
          }
        },
        "additionalProperties": false
      },
      "AffiliateCaptureRequest": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 4,
            "maxLength": 32,
            "description": "Affiliate code to capture into a signed attribution token/cookie."
          }
        },
        "additionalProperties": false
      },
      "AffiliateApplyRequest": {
        "type": "object",
        "required": [
          "displayName",
          "contactEmail"
        ],
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          },
          "contactEmail": {
            "type": "string",
            "format": "email"
          },
          "countryCode": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "Optional ISO 3166-1 alpha-2 country code."
          },
          "payoutAddress": {
            "type": "string",
            "minLength": 3,
            "maxLength": 320,
            "description": "Optional payout handle/address required before requesting payout."
          },
          "termsVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Optional affiliate terms version accepted by the client."
          }
        },
        "additionalProperties": false
      },
      "AffiliateUpdateRequest": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          },
          "contactEmail": {
            "type": "string",
            "format": "email"
          },
          "countryCode": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "Optional ISO 3166-1 alpha-2 country code."
          },
          "payoutAddress": {
            "type": "string",
            "minLength": 3,
            "maxLength": 320,
            "description": "Optional payout handle/address required before requesting payout."
          }
        },
        "additionalProperties": false
      },
      "AffiliateBindCodeRequest": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 4,
            "maxLength": 32,
            "description": "Affiliate code to bind to the authenticated account."
          },
          "captureToken": {
            "type": "string",
            "minLength": 24,
            "maxLength": 4096,
            "description": "Optional explicit capture token from POST /api/v1/affiliates/capture."
          }
        },
        "additionalProperties": false
      },
      "AffiliatePayoutRequestCreateRequest": {
        "type": "object",
        "properties": {
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "description": "Optional operator note included with the payout request."
          }
        },
        "additionalProperties": false
      },
      "DeviceLinkStartRequest": {
        "type": "object",
        "properties": {
          "keyLabel": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Optional label used when issuing the linked API key."
          }
        },
        "additionalProperties": false
      },
      "DeviceLinkApproveRequest": {
        "type": "object",
        "required": [
          "userCode"
        ],
        "properties": {
          "userCode": {
            "type": "string",
            "minLength": 4,
            "maxLength": 32,
            "description": "User code shown by device-link start flow (for example: ABCD-EFGH)."
          },
          "keyLabel": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Optional label override for the linked API key."
          }
        },
        "additionalProperties": false
      },
      "DeviceLinkPollRequest": {
        "type": "object",
        "required": [
          "deviceCode"
        ],
        "properties": {
          "deviceCode": {
            "type": "string",
            "minLength": 20,
            "maxLength": 256,
            "description": "Opaque device code returned by POST /api/v1/device/link/start."
          }
        },
        "additionalProperties": false
      },
      "MediaInputAdjustment": {
        "type": "object",
        "required": [
          "field",
          "reason"
        ],
        "properties": {
          "field": {
            "type": "string"
          },
          "requested": {},
          "effective": {},
          "reason": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "MediaJobBilling": {
        "type": "object",
        "properties": {
          "usdChargedMicros": {
            "type": "integer",
            "nullable": true
          },
          "usdCharged": {
            "type": "string",
            "nullable": true
          },
          "pricingMeta": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "stagedInputCount": {
            "type": "integer",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "VideoImportRequest": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096,
            "description": "Direct link to a video file. Share-sheet text is accepted (the first http(s) URL is extracted) and a bare domain is promoted to https. The resolved URL must be at most 2048 characters, must be http(s), must not embed credentials, and is re-checked against private/loopback/metadata network targets on every redirect hop (at most 5)."
          },
          "probeOnly": {
            "type": "boolean",
            "default": false,
            "description": "When true, only inspect the link and return its authoritative metadata. Probes are free and store nothing."
          }
        },
        "additionalProperties": false
      },
      "VideoImportResponse": {
        "type": "object",
        "required": [
          "kind",
          "url",
          "mimeType"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "direct"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "For an import, the public media-temp URL of the stored copy (usable directly as a video.generate.reference or video.combine source). For a probe, the normalized source URL."
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri",
            "description": "Normalized caller-supplied link (import only)."
          },
          "finalUrl": {
            "type": "string",
            "format": "uri",
            "description": "URL the origin resolved to after redirects."
          },
          "mimeType": {
            "type": "string",
            "enum": [
              "video/mp4",
              "video/quicktime",
              "video/webm"
            ]
          },
          "byteSize": {
            "type": [
              "integer",
              "null"
            ]
          },
          "maxImportBytes": {
            "type": "integer",
            "description": "Configured import cap in bytes (probe only)."
          },
          "durationSeconds": {
            "type": [
              "number",
              "null"
            ],
            "description": "Null for WebM: the gateway does not guess."
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "hasAudio": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "MP4/MOV sound-track presence; null when unknown."
          },
          "expiresAt": {
            "type": "integer",
            "description": "Epoch milliseconds when the stored temp asset expires (import only)."
          },
          "usdMicros": {
            "type": "integer",
            "description": "Charged amount in USD micros (import only)."
          }
        },
        "additionalProperties": true
      },
      "VideoImportError": {
        "type": "object",
        "required": [
          "error",
          "code"
        ],
        "description": "Standard gateway error envelope: a human-readable message in `error` plus a stable machine code in `code`.",
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable message."
          },
          "code": {
            "type": "string",
            "enum": [
              "invalid_link",
              "too_large",
              "unsupported_source",
              "not_a_video",
              "private_source",
              "unreachable_source",
              "unauthorized",
              "import_failed"
            ]
          },
          "details": {
            "description": "Optional additional context."
          }
        },
        "additionalProperties": false
      },
      "MediaJobSubmitResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "task": {
            "type": "string"
          },
          "externalJobId": {
            "type": "string"
          },
          "usdChargedMicros": {
            "type": "integer"
          },
          "usdCharged": {
            "type": "string"
          },
          "usdBalanceMicros": {
            "type": "integer"
          },
          "usdBalance": {
            "type": "string"
          },
          "pricingMeta": {
            "type": "object",
            "additionalProperties": true
          },
          "stagedInputCount": {
            "type": "integer"
          },
          "estimatedDurationSeconds": {
            "type": "number"
          },
          "durationEstimateMeta": {
            "type": "object",
            "additionalProperties": true
          },
          "effectiveInput": {
            "type": "object",
            "additionalProperties": true
          },
          "inputAdjustments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaInputAdjustment"
            }
          },
          "billing": {
            "$ref": "#/components/schemas/MediaJobBilling"
          },
          "result": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "MediaJobStatusResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "task": {
            "type": "string",
            "nullable": true
          },
          "externalJobId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": true
          },
          "effectiveInput": {
            "type": "object",
            "additionalProperties": true
          },
          "inputAdjustments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaInputAdjustment"
            }
          },
          "estimatedDurationSeconds": {
            "type": "number",
            "nullable": true
          },
          "durationEstimateMeta": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "billing": {
            "$ref": "#/components/schemas/MediaJobBilling"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "durationMs": {
            "type": "integer",
            "nullable": true
          },
          "outputFiles": {
            "type": "array",
            "nullable": true,
            "items": {}
          },
          "outputUrl": {
            "type": "string",
            "nullable": true
          },
          "generatedImageIds": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "expectedOutputUrls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "Expected output URLs inferred from submit-time output destinations."
          },
          "downloadableOutputUrls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "Downloadable output URLs. Guaranteed availability for 48 hours after completion; background cleanup targets 72 hours."
          }
        },
        "additionalProperties": true
      }
    }
  },
  "paths": {
    "/api/v1/models": {
      "get": {
        "tags": [
          "inference"
        ],
        "summary": "List available inference models",
        "description": "Returns only qwen3.8-27b-uncensored. This is an uncensored checkpoint; clients must apply their own moderation and safety controls.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OpenAI-compatible model list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QwenModelList"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/chat/completions": {
      "post": {
        "tags": [
          "inference"
        ],
        "summary": "Create a multimodal Qwen chat completion",
        "description": "OpenAI-compatible text, reasoning, inline-image analysis, prefix caching, modern function tools, parallel tool calls, and SSE streaming. A valid non-streaming request may be converted to a durable job and return 202 with Location. A prompt_cache_key is account-scoped and replaced with an opaque upstream handle; keyed responses may report best-effort cached-token telemetry. Caching does not discount billing. The gateway never retries generation submission automatically. Requests reserve $0.32768; authoritative usage settles at $0.45/M prompt tokens plus $2.50/M completion tokens, with reasoning included in completion usage. Definitive upstream rejection before output refunds the hold; missing usage after a successful response, expired async result, disconnect, or ambiguous response loss retains it. Request and response bodies are each limited to 20 MiB. Oversized buffered JSON returns 502; an SSE stream that crosses the limit after its 200 response begins is interrupted. The gateway stores operational ownership and billing metadata for async work, but never persists prompts, images, cache keys/handles, reasoning, tools, or output content.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            },
            "description": "Prevents duplicate reservation/generation acceptance. Completed responses are not replayed."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QwenChatCompletionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON completion or SSE stream. Streaming ends with data: [DONE]. A usage chunk is forwarded only when stream_options.include_usage is true, but is always requested upstream for settlement. Keyed responses may include best-effort usage.prompt_tokens_details.cached_tokens telemetry.",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Gateway or upstream request identifier."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QwenChatCompletionResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "description": "The valid non-streaming request was converted to a durable job. Follow Location and honor Retry-After instead of resubmitting.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "pattern": "^/api/v1/jobs/ij_[a-f0-9]{64}$"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Furgen-Async-Conversion": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QwenInferenceJob"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, image, tool contract, or unsupported model.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "402": {
            "description": "Prepaid account cannot cover the $0.32768 inference hold.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "409": {
            "description": "The idempotency key was already accepted; prior completion bodies are not replayed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the 20 MiB Convex gateway limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type is not application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "429": {
            "description": "Upstream rate or capacity limit. Honor Retry-After when present; retry only when application policy permits a potentially new generation.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "500": {
            "description": "Authentication or billing infrastructure failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "502": {
            "description": "Upstream network, response, or 20 MiB gateway response-limit failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "503": {
            "description": "Inference configuration, cold start, GPU handoff, or worker availability failure. Honor Retry-After when supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "default": {
            "description": "Meaningful upstream status codes are preserved with an OpenAI-shaped error body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs": {
      "post": {
        "tags": [
          "inference"
        ],
        "summary": "Submit a durable Qwen inference job",
        "description": "Accepts the same non-streaming request body as chat completions. The gateway reserves the inference hold, scopes the idempotency key to the authenticated account, records job ownership without prompt or result content, and reconciles terminal usage in the background.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 200
            },
            "description": "Strongly recommended. Reuse with different input returns 409 idempotency_mismatch."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QwenChatCompletionRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Durable job accepted. Poll Location and honor Retry-After.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "pattern": "^/api/v1/jobs/ij_[a-f0-9]{64}$"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QwenInferenceJob"
                }
              }
            }
          },
          "400": {
            "description": "Invalid non-streaming inference request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "402": {
            "description": "Prepaid account cannot cover the inference hold.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key is pending, completed without a replayable body, or was used with different input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the 20 MiB gateway limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type is not application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "503": {
            "description": "Async inference is not configured or available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "default": {
            "description": "Meaningful upstream status code with an OpenAI-shaped error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}": {
      "parameters": [
        {
          "in": "path",
          "name": "id",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^ij_[a-f0-9]{64}$"
          }
        }
      ],
      "get": {
        "tags": [
          "inference"
        ],
        "summary": "Get an owned Qwen inference job",
        "description": "Returns 404 for both unknown and other-account job IDs. queue_position is normally null; request queue_details=true only when an exact position is needed.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "queue_details",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current job status. Honor Retry-After while nonterminal.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Furgen-Status-Source": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QwenInferenceJob"
                }
              }
            }
          },
          "400": {
            "description": "Invalid queue_details value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "404": {
            "description": "Job does not exist or is not owned by this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "default": {
            "description": "Upstream job-status response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "inference"
        ],
        "summary": "Cancel an owned Qwen inference job",
        "description": "Cancellation is idempotent. A job that already completed remains completed.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Cancellation accepted or job was already terminal."
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "404": {
            "description": "Job does not exist or is not owned by this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "default": {
            "description": "Upstream cancellation response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}/result": {
      "get": {
        "tags": [
          "inference"
        ],
        "summary": "Fetch an owned Qwen inference job result",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ij_[a-f0-9]{64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OpenAI-compatible completion and authoritative usage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QwenChatCompletionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Job is still pending. Honor Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QwenInferenceJob"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "404": {
            "description": "Job does not exist or is not owned by this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "409": {
            "description": "Job was cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "410": {
            "description": "Terminal result expired; the inference hold is retained when usage is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "502": {
            "description": "Job failed upstream or returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "default": {
            "description": "Upstream result response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/queue": {
      "get": {
        "tags": [
          "inference"
        ],
        "summary": "Inspect aggregate inference queue depth",
        "description": "Reports global FIFO depth and estimated wait without prompt content.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "model",
            "required": false,
            "schema": {
              "const": "qwen3.8-27b-uncensored"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Aggregate queue status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QwenQueueStatus"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported model.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          },
          "default": {
            "description": "Upstream queue response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Health check and release compatibility metadata",
        "responses": {
          "200": {
            "description": "API health payload with versioned skill compatibility information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packages": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "List available credit packages"
      }
    },
    "/api/v1/affiliates/r": {
      "get": {
        "tags": [
          "affiliates"
        ],
        "summary": "Resolve affiliate referral redirect and capture attribution token",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 4,
              "maxLength": 32
            },
            "description": "Affiliate code to resolve."
          }
        ]
      }
    },
    "/api/v1/affiliates/validate-code": {
      "post": {
        "tags": [
          "affiliates"
        ],
        "summary": "Validate affiliate code",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AffiliateValidateCodeRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/affiliates/capture": {
      "post": {
        "tags": [
          "affiliates"
        ],
        "summary": "Capture/refresh affiliate attribution token",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AffiliateCaptureRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/affiliates/me/apply": {
      "post": {
        "tags": [
          "affiliates"
        ],
        "summary": "Apply for affiliate account",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AffiliateApplyRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/affiliates/me": {
      "get": {
        "tags": [
          "affiliates"
        ],
        "summary": "Get affiliate profile",
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "affiliates"
        ],
        "summary": "Update affiliate profile",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AffiliateUpdateRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/affiliates/me/code": {
      "get": {
        "tags": [
          "affiliates"
        ],
        "summary": "Get or create the authenticated affiliate referral code",
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/api/v1/affiliates/me/dashboard": {
      "get": {
        "tags": [
          "affiliates"
        ],
        "summary": "Get affiliate dashboard metrics",
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/api/v1/affiliates/me/commissions": {
      "get": {
        "tags": [
          "affiliates"
        ],
        "summary": "List affiliate commissions",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Optional page size. Defaults to 100."
          }
        ]
      }
    },
    "/api/v1/affiliates/me/payouts": {
      "get": {
        "tags": [
          "affiliates"
        ],
        "summary": "List affiliate payout history",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Optional page size. Defaults to 20."
          }
        ]
      }
    },
    "/api/v1/affiliates/me/payout-requests": {
      "get": {
        "tags": [
          "affiliates"
        ],
        "summary": "List affiliate payout requests and eligibility state",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Optional page size. Defaults to 20."
          }
        ]
      },
      "post": {
        "tags": [
          "affiliates"
        ],
        "summary": "Create affiliate payout request",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AffiliatePayoutRequestCreateRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/affiliates/me/bind-code": {
      "post": {
        "tags": [
          "affiliates"
        ],
        "summary": "Bind affiliate code to authenticated user",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AffiliateBindCodeRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/google": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Exchange a Google ID token for a new API key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleAuthRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/browser/google": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Exchange a Google ID token for a browser session cookie",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleAuthRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/email/start": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Start email one-time-code sign-in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailAuthStartRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/email/verify": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Verify email one-time code and mint API key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailAuthVerifyRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/browser/email/verify": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Verify email one-time code and issue a browser session cookie",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailAuthVerifyRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/browser/session": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Inspect the active browser session"
      },
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Clear the active browser session"
      }
    },
    "/api/v1/device/link/start": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Start browser-assisted local skill linking",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceLinkStartRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/device/link/request": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Get device-link request status by user code",
        "parameters": [
          {
            "in": "query",
            "name": "userCode",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 4
            },
            "description": "User code shown during device-link bootstrap."
          }
        ]
      }
    },
    "/api/v1/device/link/approve": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Approve a pending device-link request (API key required)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceLinkApproveRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/device/link/poll": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Poll a device-link request and retrieve one-time API key when approved",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceLinkPollRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/checkout/stripe": {
      "post": {
        "tags": [
          "checkout"
        ],
        "summary": "Create Stripe checkout (API key required)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StripeCheckoutRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/checkout/crypto": {
      "post": {
        "tags": [
          "checkout"
        ],
        "summary": "Create crypto checkout (API key required)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CryptoCheckoutRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/claim/stripe": {
      "post": {
        "tags": [
          "claim"
        ],
        "summary": "Finalize Stripe checkout settlement (API key required)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimStripeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stripe settlement finalized for the authenticated account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimSettlementResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/claim/crypto": {
      "post": {
        "tags": [
          "claim"
        ],
        "summary": "Finalize Coinbase checkout settlement (API key required)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimCryptoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Coinbase settlement finalized for the authenticated account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimSettlementResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/credits/purchase/x402": {
      "post": {
        "tags": [
          "credits"
        ],
        "summary": "Purchase prepaid $ credits using x402 (API key required)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/X402CreditPurchaseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credit purchase replay recognized (already applied)."
          },
          "201": {
            "description": "Credit purchase settled and applied."
          },
          "402": {
            "description": "x402 payment required or settlement rejected. Uses PAYMENT-REQUIRED / PAYMENT-RESPONSE headers."
          }
        }
      }
    },
    "/api/v1/deposit/x402": {
      "post": {
        "tags": [
          "credits"
        ],
        "deprecated": true,
        "summary": "Legacy alias for x402 prepaid $ credit purchase",
        "description": "Deprecated route alias. Use POST /api/v1/credits/purchase/x402 instead.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/X402CreditPurchaseRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/keys": {
      "get": {
        "tags": [
          "keys"
        ],
        "summary": "List API keys",
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "keys"
        ],
        "summary": "Create API key (API key auth or Google ID token bootstrap)",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/keys/revoke": {
      "post": {
        "tags": [
          "keys"
        ],
        "summary": "Revoke API key",
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/api/v1/balance": {
      "get": {
        "tags": [
          "balance"
        ],
        "summary": "Get USD balance",
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/api/v1/arcade/games": {
      "post": {
        "tags": [
          "arcade"
        ],
        "summary": "Create an arcade game record",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "title",
                  "shortDescription",
                  "description"
                ],
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "shortDescription": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/arcade/games/mine": {
      "get": {
        "tags": [
          "arcade"
        ],
        "summary": "List creator-owned arcade games and releases",
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/api/v1/arcade/games/detail": {
      "get": {
        "tags": [
          "arcade"
        ],
        "summary": "Load one arcade game detail record by slug and channel",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "dev",
                "live"
              ],
              "default": "live"
            }
          }
        ]
      }
    },
    "/api/v1/arcade/catalog": {
      "get": {
        "tags": [
          "arcade"
        ],
        "summary": "List accessible arcade catalog entries for one channel",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "dev",
                "live"
              ],
              "default": "live"
            }
          }
        ]
      }
    },
    "/api/v1/arcade/releases/upload": {
      "post": {
        "tags": [
          "arcade"
        ],
        "summary": "Upload a Godot web release bundle for an existing arcade game",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "gameId",
                  "manifestJson",
                  "bundle"
                ],
                "properties": {
                  "gameId": {
                    "type": "string"
                  },
                  "manifestJson": {
                    "type": "string"
                  },
                  "bundle": {
                    "type": "string",
                    "format": "binary"
                  },
                  "coverImage": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/arcade/releases/submit": {
      "patch": {
        "tags": [
          "arcade"
        ],
        "summary": "Submit a draft arcade release for manual review",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "releaseId"
                ],
                "properties": {
                  "releaseId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/arcade/review/queue": {
      "get": {
        "tags": [
          "arcade"
        ],
        "summary": "List arcade releases awaiting admin review",
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/api/v1/arcade/review/release": {
      "patch": {
        "tags": [
          "arcade"
        ],
        "summary": "Advance, approve, reject, or assign an arcade release to dev/live",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "releaseId",
                  "action"
                ],
                "properties": {
                  "releaseId": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "send_to_review",
                      "approve",
                      "reject",
                      "publish"
                    ]
                  },
                  "notes": {
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "dev",
                      "live"
                    ]
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "hidden",
                      "owner_only",
                      "public"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/arcade/launch-sessions": {
      "post": {
        "tags": [
          "arcade"
        ],
        "summary": "Create a signed arcade launch session for one channel-assigned release",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "idempotencyKey"
                ],
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "idempotencyKey": {
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "dev",
                      "live"
                    ],
                    "default": "live"
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "arcade"
        ],
        "summary": "Update arcade launch-session telemetry state",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sessionId",
                  "event"
                ],
                "properties": {
                  "sessionId": {
                    "type": "string"
                  },
                  "event": {
                    "type": "string",
                    "enum": [
                      "launched",
                      "heartbeat",
                      "end",
                      "failed_bootstrap"
                    ]
                  },
                  "failureReason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/snapshot": {
      "get": {
        "tags": [
          "studio"
        ],
        "summary": "Get Studio workspace snapshot",
        "description": "Returns the authenticated Studio workspace snapshot, including projects, assets, workflow runs, approvals, templates, publishing state, and the active thread.",
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/api/v1/studio/projects/assets": {
      "get": {
        "tags": [
          "studio"
        ],
        "summary": "List Studio project assets",
        "description": "Returns the paginated Studio browser asset list for a project, including active or recycling-bin scopes and optional search filtering.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "in": "query",
            "name": "scope",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "recycling"
              ]
            }
          },
          {
            "in": "query",
            "name": "searchQuery",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/studio/projects": {
      "post": {
        "tags": [
          "studio"
        ],
        "summary": "Create Studio project",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/projects/update": {
      "patch": {
        "tags": [
          "studio"
        ],
        "summary": "Update Studio project",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId"
                ],
                "properties": {
                  "projectId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/settings": {
      "patch": {
        "tags": [
          "studio"
        ],
        "summary": "Update Studio settings",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "defaultAgentModel",
                  "defaultReasoningLevel"
                ],
                "properties": {
                  "userDisplayName": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "assistantDisplayName": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "conversationStarterInstructions": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "defaultAgentModel": {
                    "type": "string",
                    "enum": [
                      "gpt-5.4-nano",
                      "gpt-5.4-mini",
                      "gpt-5.4",
                      "deepseek-chat",
                      "minimax/minimax-m2.7",
                      "zai-org/GLM-5",
                      "moonshotai/Kimi-K2.5"
                    ]
                  },
                  "defaultReasoningLevel": {
                    "type": "string",
                    "enum": [
                      "default",
                      "low",
                      "medium",
                      "high",
                      "xhigh"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/threads": {
      "post": {
        "tags": [
          "studio"
        ],
        "summary": "Create Studio conversation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId"
                ],
                "properties": {
                  "projectId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 120
                  },
                  "agentModel": {
                    "type": "string",
                    "enum": [
                      "gpt-5.4-nano",
                      "gpt-5.4-mini",
                      "gpt-5.4"
                    ]
                  },
                  "reasoningLevel": {
                    "type": "string",
                    "enum": [
                      "default",
                      "low",
                      "medium",
                      "high",
                      "xhigh"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/threads/select": {
      "post": {
        "tags": [
          "studio"
        ],
        "summary": "Select Studio conversation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "threadId"
                ],
                "properties": {
                  "threadId": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/threads/detail": {
      "get": {
        "tags": [
          "studio"
        ],
        "summary": "Load Studio conversation detail",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "threadId",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ]
      }
    },
    "/api/v1/studio/threads/update": {
      "patch": {
        "tags": [
          "studio"
        ],
        "summary": "Rename Studio conversation",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "threadId",
                  "title"
                ],
                "properties": {
                  "threadId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 120
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/assets/upload": {
      "post": {
        "tags": [
          "studio"
        ],
        "summary": "Upload Studio asset",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "in": "query",
            "name": "filename",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 240
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/assets/metadata": {
      "patch": {
        "tags": [
          "studio"
        ],
        "summary": "Update Studio asset metadata",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "assetId",
                  "userMetadata"
                ],
                "properties": {
                  "assetId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "userMetadata": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/assets/text": {
      "post": {
        "tags": [
          "studio"
        ],
        "summary": "Create Studio text asset",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId",
                  "title"
                ],
                "properties": {
                  "projectId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "content": {
                    "type": "string",
                    "maxLength": 524288
                  },
                  "mimeType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/assets/text/document": {
      "get": {
        "tags": [
          "studio"
        ],
        "summary": "Get Studio text document",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "assetId",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "studio"
        ],
        "summary": "Update Studio text document",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "assetId",
                  "content"
                ],
                "properties": {
                  "assetId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "content": {
                    "type": "string",
                    "maxLength": 524288
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/assets/storyboards": {
      "post": {
        "tags": [
          "studio"
        ],
        "summary": "Create Studio storyboard",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId",
                  "title"
                ],
                "properties": {
                  "projectId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "storyboard": {
                    "type": "object",
                    "description": "Optional version 2 video storyboard document payload."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/assets/storyboards/document": {
      "get": {
        "tags": [
          "studio"
        ],
        "summary": "Get Studio storyboard document",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "assetId",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "studio"
        ],
        "summary": "Update Studio storyboard document",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "assetId",
                  "storyboard"
                ],
                "properties": {
                  "assetId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "storyboard": {
                    "type": "object",
                    "description": "Version 2 video storyboard document payload."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/assets/storyboards/import": {
      "post": {
        "tags": [
          "studio"
        ],
        "summary": "Import Studio storyboard from legacy asset",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId",
                  "sourceAssetId"
                ],
                "properties": {
                  "projectId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sourceAssetId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/assets/storyboards/export-markdown": {
      "get": {
        "tags": [
          "studio"
        ],
        "summary": "Export Studio storyboard as markdown",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "assetId",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ]
      }
    },
    "/api/v1/studio/agent/messages": {
      "post": {
        "tags": [
          "studio"
        ],
        "summary": "Send Studio agent prompt",
        "description": "Runs a Studio agent prompt after the paid-job approval preflight has already been satisfied. Clients should prepare first and only send directly when the prepare step returns execute_now.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId",
                  "prompt"
                ],
                "properties": {
                  "projectId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 12000
                  },
                  "agentModel": {
                    "type": "string",
                    "enum": [
                      "gpt-5.4-nano",
                      "gpt-5.4-mini",
                      "gpt-5.4"
                    ]
                  },
                  "reasoningLevel": {
                    "type": "string",
                    "enum": [
                      "default",
                      "low",
                      "medium",
                      "high",
                      "xhigh"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/agent/messages/prepare": {
      "post": {
        "tags": [
          "studio"
        ],
        "summary": "Prepare Studio agent prompt",
        "description": "Prepares the Studio agent prompt without executing paid jobs. Returns either execute_now for zero-cost or pre-approved runs, or an approval-required payload containing the persisted paid job bundle and estimated cost details.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId",
                  "prompt"
                ],
                "properties": {
                  "projectId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 12000
                  },
                  "agentModel": {
                    "type": "string",
                    "enum": [
                      "gpt-5.4-nano",
                      "gpt-5.4-mini",
                      "gpt-5.4"
                    ]
                  },
                  "reasoningLevel": {
                    "type": "string",
                    "enum": [
                      "default",
                      "low",
                      "medium",
                      "high",
                      "xhigh"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/agent/approval-plans/execute": {
      "post": {
        "tags": [
          "studio"
        ],
        "summary": "Execute approved Studio plan",
        "description": "Marks a prepared Studio approval plan as approved and executes the stored normalized paid job bundle without replanning.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "approvalPlanId"
                ],
                "properties": {
                  "approvalPlanId": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/studio/agent/requests": {
      "get": {
        "tags": [
          "studio"
        ],
        "summary": "Get Studio agent request state",
        "description": "Returns the latest persisted status for an asynchronous Studio agent request, along with any incremental assistant text and tool-call deltas since the supplied offsets.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "requestId",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "in": "query",
            "name": "assistantOffset",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "in": "query",
            "name": "toolCallOffset",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ]
      }
    },
    "/api/v1/credits/balance": {
      "get": {
        "tags": [
          "credits"
        ],
        "deprecated": true,
        "summary": "Deprecated credits balance route",
        "description": "Deprecated route. Always returns HTTP 410 and instructs clients to use GET /api/v1/balance."
      }
    },
    "/api/v1/credits/consume": {
      "post": {
        "tags": [
          "credits"
        ],
        "deprecated": true,
        "summary": "Deprecated credits consume route",
        "description": "Deprecated route. Always returns HTTP 410 and instructs clients to use POST /api/v1/media/jobs instead."
      }
    },
    "/api/v1/media/jobs": {
      "get": {
        "tags": [
          "media"
        ],
        "summary": "Get media job status and output URLs",
        "description": "Download outputs within 48 hours of completion. CDN cleanup runs after 72 hours, so links may work slightly longer but are not guaranteed after 48 hours.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "description": "External media job id returned by POST /api/v1/media/jobs."
          },
          {
            "in": "query",
            "name": "includeDetails",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "When true, includes sanitized upstream result payload, effectiveInput, and inputAdjustments for debugging."
          }
        ],
        "responses": {
          "200": {
            "description": "Media job status payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaJobStatusResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "media"
        ],
        "summary": "Submit media job",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaJobRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Media job accepted and queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaJobSubmitResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/media/video/import": {
      "post": {
        "tags": [
          "media"
        ],
        "summary": "Import a video from a direct link",
        "description": "Fetches a caller-supplied direct video link server-side, validates it, and stores it as a media temp asset with the standard TTL, returning authoritative metadata. Accepted types are video/mp4, video/quicktime and video/webm (or application/octet-stream with an .mp4/.mov/.webm path); the first bytes must be an MP4/MOV ftyp box or a WebM EBML header. Bodies are streamed with a hard cap (VIDEO_IMPORT_MAX_BYTES, 100 MB by default; the action buffers the file before uploading). Platform links (YouTube, X, TikTok, ...) are not supported and return 422 unsupported_source. probeOnly inspections are free; a successful import is charged a flat $0.005. Timeouts: 30 s connect, 240 s total.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoImportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Probe result or stored import.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoImportResponse"
                }
              }
            }
          },
          "400": {
            "description": "invalid_link: the link is missing, over-long, non-http(s), credentialed, or points at a private network target.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoImportError"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoImportError"
                }
              }
            }
          },
          "413": {
            "description": "too_large: Content-Length or the streamed body exceeded the import cap.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoImportError"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_source, not_a_video, or private_source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoImportError"
                }
              }
            }
          },
          "502": {
            "description": "unreachable_source: the origin could not be reached within the request budget.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoImportError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/stripe": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Stripe webhook"
      }
    },
    "/api/v1/webhooks/crypto": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Coinbase webhook"
      }
    }
  }
}
