{
  "openapi": "3.1.0",
  "info": {
    "title": "APIKing API",
    "version": "1.0.0",
    "summary": "One OpenAI-compatible API for chat, image, video, music, 3D, audio and embeddings.",
    "description": "Generated from the published documentation — see /docs.\n\n## Authentication\nOne header: `Authorization: Bearer sk-...`. Keys with request signing turned on also need `X-Timestamp`, `X-Nonce` and `X-Signature` (HMAC-SHA256 of timestamp, nonce, method and path joined by newlines); see /docs/apps/signing.\n\n## Errors\nFive shapes reach clients: the gateway envelope below, upstream vendor bodies forwarded unchanged, the flat idempotency-guard envelope, the flat `{code, message, data}` body every async task endpoint uses, and bare status lines with no body at all (rate limiting and oversized requests). Branch on the HTTP status first, then `error.type`, then `error.code`.\n\n## Async tasks\nImage, music and 3D tasks report processing / queued / succeeded / failed / unknown. Videos and webhook payloads report queued / in_progress / completed / failed / unknown. Terminal states are succeeded/failed and completed/failed respectively.\n\n## Webhooks\nTerminal tasks POST to `webhook_url` with `X-Xiaoxiang-Event` (task.completed | task.failed), `X-Xiaoxiang-Event-Id` for deduplication and, when `webhook_secret` was set, `X-Xiaoxiang-Signature`. Delivery times out after 15s and retries after 5s, 30s, 2m."
  },
  "servers": [
    {
      "url": "{baseUrl}",
      "description": "This deployment’s public API origin.",
      "variables": {
        "baseUrl": {
          "default": "https://apiking.ai"
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from Console → Keys."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Gateway-side rejection. Upstream vendor errors are forwarded unchanged and may use the vendor’s own type and code.",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "Human-readable message with the request id appended."
              },
              "type": {
                "type": "string",
                "description": "xiaoxiang_error for gateway-side rejections; otherwise the vendor’s type."
              },
              "code": {
                "type": "string",
                "description": "Stable only when type is xiaoxiang_error. May be empty."
              }
            }
          }
        }
      },
      "GuardError": {
        "type": "object",
        "description": "Pre-relay guard rejection (idempotency). Flat shape with an uppercase code.",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "IDEMPOTENCY_STREAM_UNSUPPORTED",
              "IDEMPOTENCY_BODY_UNREADABLE",
              "IDEMPOTENCY_PAYLOAD_CONFLICT",
              "IDEMPOTENCY_IN_PROGRESS",
              "IDEMPOTENCY_RESULT_UNREPLAYABLE",
              "IDEMPOTENCY_UNAVAILABLE"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "headers": {
      "X-Oneapi-Request-Id": {
        "description": "Every response, success or error. Log it beside your own trace id. Support answers tickets from this value, and the same id is appended to gateway error messages.",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "On 429, and on 409 while an Idempotency-Key is still processing. Wait at least this many seconds. It is the only backoff hint the gateway sends.",
        "schema": {
          "type": "string"
        }
      },
      "X-Idempotent-Replayed": {
        "description": "A stored response is replayed for a repeated Idempotency-Key. true means no new work ran and nothing was charged again — treat the body as the original result.",
        "schema": {
          "type": "string"
        }
      },
      "X-Idempotency-Sealed": {
        "description": "The original response cannot be replayed safely (for example a stream or an oversized body). Stop retrying that key. Reconcile from the task endpoint or your own records instead.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "error401": {
        "description": "(no code) — Missing, malformed, deleted or disabled bearer token. This layer sets no code — match on the status. Check the Authorization header and the key state in Console → Keys.\n\nsignature_required — The key has request signing on and the request lacks X-Timestamp, X-Nonce or X-Signature. Sign every request made with this key (Authentication & keys → Request signing), or turn signing off on the key.\n\nsignature_expired — X-Timestamp is not 10-digit unix seconds or is more than 5 minutes from server time. The response carries X-Server-Timestamp. Correct the client clock by the X-Server-Timestamp difference and sign again with a new nonce.\n\nsignature_invalid — X-Signature does not match the key’s signing secret, or X-Nonce is malformed. Sign timestamp, nonce, method and path (no query string) joined by newlines with the current secret from Console → Keys.\n\nsignature_replayed — This X-Nonce was already used with this key in the last 10 minutes. Generate a new random nonce for every request, including retries.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error403": {
        "description": "access_denied — The caller IP is outside the key’s IP allowlist. Add the egress address in Console → Keys, or drop the allowlist for keys with no fixed IP.\n\n(no code) — Account suspended, or the key is not allowed to use this model or channel. Check the key’s model whitelist first; if it is unrestricted, open a ticket — the account itself is blocked.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error400": {
        "description": "unsupported_endpoint — The model exists but does not serve this path. The message lists the endpoints it does serve. Move the call to a listed endpoint — image task models do not answer on /v1/chat/completions.\n\nread_request_body_failed — The request body could not be read — truncated upload, wrong Content-Type, or a stream that ended early. Send a complete body with a matching Content-Type. Resending the same broken request fails the same way.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error402": {
        "description": "insufficient_user_quota — Wallet balance cannot cover the amount pre-reserved for this call. Top up in Console → Wallet, then retry.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error429": {
        "description": "insufficient_user_quota — The account’s daily spend cap is reached. Same status as throttling, opposite meaning — backoff will not clear it. Raise or clear the cap in account settings, or resume tomorrow. Branch on the code, not on 429 alone.\n\n(no code) — The account’s request rate limit (500 model requests per minute by default) or a concurrency guard. Retry-After is sent when the wait is known. Wait for Retry-After when it is sent, otherwise back off exponentially with jitter, then retry. Contact support for a higher limit.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error413": {
        "description": "read_request_body_failed — Request body exceeds the accepted size. The transport-level limit aborts with an empty body. Shrink the payload — upload files through /v1/media/upload-policy and send the URL instead of Base64.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        }
      },
      "error422": {
        "description": "invalid_request — No channel supports this media intent for the model — for example image-to-video on a text-to-video-only route. Check the model card for supported intents and switch model or intent.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error503": {
        "description": "model_not_found — Unknown model name, or no healthy channel currently serves it. Note the status: an unknown model is 503, not 404. Verify the name against /v1/models, then retry — failover usually finds a healthy channel on the next attempt.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error500": {
        "description": "sensitive_words_detected — The prompt hit the content filter before it left the gateway. Change the prompt. Retrying the same text always fails.\n\ncount_token_failed — The gateway could not estimate tokens for pricing, usually from a malformed message array. Validate the messages array; if it is well-formed, retry and open a ticket with the request id.\n\ninvalid_request — The request could not be parsed into a shape this endpoint accepts. Note the status — a body the gateway cannot read is reported as 500, not 400. Validate the JSON against the endpoint reference before retrying.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error502": {
        "description": "do_request_failed — The vendor was unreachable, or returned a failure the gateway could not recover through failover. Retry with backoff — the next attempt usually lands on a different channel.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error504": {
        "description": "do_request_failed — The vendor did not answer within the gateway deadline. Retry with backoff; long prompts and busy vendors time out more often.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error499": {
        "description": "do_request_failed — Your client closed the connection before the answer was complete, usually because its own HTTP timeout fired. A non-streaming call sends nothing until the whole answer is ready, so a client timeout shorter than the generation time ends the call even when the model is working normally. Set the read timeout to at least 120 seconds, and several minutes for long outputs or reasoning models, or send stream: true so tokens arrive as they are generated. Retrying with the same timeout usually fails the same way. A non-streaming call keeps running after the disconnect and is billed for what the model actually generated. A streamed call stops at the disconnect and is billed only for what was generated up to that point.",
        "headers": {
          "X-Oneapi-Request-Id": {
            "$ref": "#/components/headers/X-Oneapi-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "error409": {
        "description": "IDEMPOTENCY_PAYLOAD_CONFLICT — This key was already used with a different body, path or query. Generate a new key. A key identifies one exact request, not one retry loop.\n\nIDEMPOTENCY_IN_PROGRESS — The first request with this key is still running. Wait for Retry-After (2s) and retry the same key — you will get the original response.\n\nIDEMPOTENCY_RESULT_UNREPLAYABLE — The original request finished but its response was sealed and cannot be replayed. Do not resubmit blindly. Reconcile through the task endpoint or your own records first.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GuardError"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/chat/completions": {
      "post": {
        "operationId": "postV1ChatCompletions",
        "summary": "Multi-turn chat, tool calling, streaming, JSON mode.",
        "tags": [
          "Text"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "id": "chatcmpl-…",
                  "object": "chat.completion",
                  "model": "gpt-5.6-luna",
                  "choices": [
                    {
                      "index": 0,
                      "message": {
                        "role": "assistant",
                        "content": "Hello!"
                      },
                      "finish_reason": "stop"
                    }
                  ],
                  "usage": {
                    "prompt_tokens": 9,
                    "completion_tokens": 3,
                    "total_tokens": 12
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "The workhorse endpoint: multi-turn chat, streaming, tool calling, vision and JSON mode for every chat-capable model in the catalogue.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model ID from /v1/models. The gateway resolves the upstream vendor from this value."
                  },
                  "messages": {
                    "type": "array",
                    "description": "Conversation turns: {role: system|user|assistant|tool, content}. Content may be a string or a multimodal part array."
                  },
                  "stream": {
                    "type": "boolean",
                    "description": "true streams SSE deltas, closed by data: [DONE]."
                  },
                  "temperature": {
                    "type": "number",
                    "description": "0 to 2. Leave empty for the model default."
                  },
                  "max_tokens": {
                    "type": "integer",
                    "description": "Upper bound on generated tokens; also caps the pre-reserved quota estimate."
                  },
                  "tools": {
                    "type": "array",
                    "description": "Function declarations the model may call — see the tool-calling guide."
                  },
                  "tool_choice": {
                    "type": [
                      "string",
                      "object"
                    ],
                    "description": "\"auto\", \"none\", or pin a specific function."
                  },
                  "response_format": {
                    "type": "object",
                    "description": "{\"type\":\"json_object\"} or a json_schema wrapper for structured output on supporting models."
                  },
                  "top_p": {
                    "type": "number",
                    "description": "Nucleus sampling; use temperature or top_p, not both."
                  },
                  "stop": {
                    "type": [
                      "string",
                      "array"
                    ],
                    "description": "Up to 4 stop sequences that cut generation."
                  }
                },
                "required": [
                  "model",
                  "messages"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/responses": {
      "post": {
        "operationId": "postV1Responses",
        "summary": "Single-shot text with structured outputs and reasoning.",
        "tags": [
          "Text"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "id": "resp_…",
                  "object": "response",
                  "model": "gpt-5.6-luna",
                  "output": [
                    {
                      "type": "message",
                      "role": "assistant",
                      "content": [
                        {
                          "type": "output_text",
                          "text": "Hello!"
                        }
                      ]
                    }
                  ],
                  "usage": {
                    "input_tokens": 9,
                    "output_tokens": 3,
                    "total_tokens": 12
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "OpenAI’s Responses API shape — single input field, structured output items, and reasoning summaries for models that expose them.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model ID from /v1/models. The gateway resolves the upstream vendor from this value."
                  },
                  "input": {
                    "type": [
                      "string",
                      "array"
                    ],
                    "description": "The prompt: a plain string or an array of input items."
                  },
                  "instructions": {
                    "type": "string",
                    "description": "System-level guidance, equivalent to a system message."
                  },
                  "stream": {
                    "type": "boolean",
                    "description": "Streams response.* SSE events instead of one JSON body."
                  },
                  "max_output_tokens": {
                    "type": "integer",
                    "description": "Upper bound on generated tokens; also caps the pre-reserved quota estimate."
                  },
                  "tools": {
                    "type": "array",
                    "description": "Function declarations the model may call — see the tool-calling guide."
                  },
                  "previous_response_id": {
                    "type": "string",
                    "description": "Chain a follow-up turn onto a prior response without resending history."
                  }
                },
                "required": [
                  "model",
                  "input"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/messages": {
      "post": {
        "operationId": "postV1Messages",
        "summary": "Anthropic-native shape — same auth, no adapter needed.",
        "tags": [
          "Text"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "id": "msg_…",
                  "type": "message",
                  "role": "assistant",
                  "model": "claude-opus-5-5",
                  "content": [
                    {
                      "type": "text",
                      "text": "Hello!"
                    }
                  ],
                  "stop_reason": "end_turn",
                  "usage": {
                    "input_tokens": 10,
                    "output_tokens": 5
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Anthropic’s native wire format, served with the same bearer key. Claude Code and the official anthropic SDKs work by only changing the base URL — no adapter, no shape translation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A Claude model ID from the models page, e.g. claude-opus-5-5."
                  },
                  "max_tokens": {
                    "type": "integer",
                    "description": "Required by the Anthropic shape — the hard output cap."
                  },
                  "messages": {
                    "type": "array",
                    "description": "Anthropic-style turns: {role: user|assistant, content}."
                  },
                  "system": {
                    "type": "string",
                    "description": "System prompt — a top-level field here, not a message role."
                  },
                  "stream": {
                    "type": "boolean",
                    "description": "Streams Anthropic-native SSE events (message_start, content_block_delta, …)."
                  },
                  "temperature": {
                    "type": "number",
                    "description": "0 to 1 in the Anthropic scale."
                  },
                  "tools": {
                    "type": "array",
                    "description": "Anthropic tool definitions; tool_use blocks come back in content."
                  }
                },
                "required": [
                  "model",
                  "max_tokens",
                  "messages"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/responses/compact": {
      "post": {
        "operationId": "postV1ResponsesCompact",
        "summary": "Condense a long conversation on models that support compaction — no streaming form.",
        "tags": [
          "Text"
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/embeddings": {
      "post": {
        "operationId": "postV1Embeddings",
        "summary": "text-embedding-3, jina-embeddings, voyage and vendor equivalents.",
        "tags": [
          "Vector"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": "{\n  \"object\": \"list\",\n  \"model\": \"text-embedding-3-small\",\n  \"data\": [\n    {\"object\": \"embedding\", \"index\": 0, \"embedding\": [0.0023, -0.0091, …]},\n    {\"object\": \"embedding\", \"index\": 1, \"embedding\": [0.0154,  0.0007, …]}\n  ],\n  \"usage\": {\"prompt_tokens\": 8, \"total_tokens\": 8}\n}"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Vector embeddings on the OpenAI shape — text-embedding-3, jina-embeddings, voyage and vendor equivalents. Billing is by input tokens.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "An embedding model ID, e.g. text-embedding-3-small."
                  },
                  "input": {
                    "type": [
                      "string",
                      "array"
                    ],
                    "description": "One string or an array — the response returns vectors in the same order."
                  },
                  "dimensions": {
                    "type": "integer",
                    "description": "Truncate the vector on models that support Matryoshka dimensions."
                  },
                  "encoding_format": {
                    "type": "string",
                    "description": "\"float\" (default) or \"base64\" for a compact payload."
                  }
                },
                "required": [
                  "model",
                  "input"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/rerank": {
      "post": {
        "operationId": "postV1Rerank",
        "summary": "Cohere-shaped rerank, also served by Jina and SiliconFlow.",
        "tags": [
          "Vector"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "results": [
                    {
                      "index": 0,
                      "relevance_score": 0.9821
                    },
                    {
                      "index": 1,
                      "relevance_score": 0.1034
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Score a list of candidate documents against one query. Results are returned in descending relevance order and retain each document’s original index.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Exact rerank model identifier from the live model catalogue."
                  },
                  "query": {
                    "type": "string",
                    "description": "The search query or question used to score candidates."
                  },
                  "documents": {
                    "type": "string",
                    "description": "Candidate passages to rank. Keep their original order in your application."
                  },
                  "top_n": {
                    "type": "integer",
                    "description": "Maximum number of ranked results to return."
                  },
                  "return_documents": {
                    "type": "boolean",
                    "description": "When supported, include document text in each result."
                  }
                },
                "required": [
                  "model",
                  "query",
                  "documents"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/moderations": {
      "post": {
        "operationId": "postV1Moderations",
        "summary": "Content moderation on the same wire format.",
        "tags": [
          "Vector"
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/audio/transcriptions": {
      "post": {
        "operationId": "postV1AudioTranscriptions",
        "summary": "Whisper-compatible speech-to-text.",
        "tags": [
          "Audio"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": "// /v1/audio/speech → binary audio body (Content-Type: audio/mpeg)\n\n// /v1/audio/transcriptions\n{\"text\": \"…transcript…\"}"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Speech both ways: /v1/audio/speech synthesizes text into audio bytes; /v1/audio/transcriptions turns audio into text (Whisper-compatible); /v1/audio/translations transcribes straight into English.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "tts-1 class for speech; whisper-1 class for transcription."
                  },
                  "input": {
                    "type": "string",
                    "description": "speech only: the text to speak."
                  },
                  "voice": {
                    "type": "string",
                    "description": "speech only: voice name (alloy, nova, …); available voices per model card."
                  },
                  "file": {
                    "type": "string",
                    "description": "transcriptions only: the audio file (mp3, wav, m4a, webm …)."
                  },
                  "language": {
                    "type": "string",
                    "description": "transcriptions only: ISO-639-1 hint that improves accuracy."
                  },
                  "response_format": {
                    "type": "string",
                    "description": "speech: mp3 | wav | opus …; transcriptions: json | text | srt | verbose_json."
                  },
                  "speed": {
                    "type": "number",
                    "description": "speech only: 0.25–4.0 playback speed."
                  }
                },
                "required": [
                  "model",
                  "input",
                  "voice",
                  "file"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/audio/translations": {
      "post": {
        "operationId": "postV1AudioTranslations",
        "summary": "Translate speech into English at transcription time.",
        "tags": [
          "Audio"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": "// /v1/audio/speech → binary audio body (Content-Type: audio/mpeg)\n\n// /v1/audio/transcriptions\n{\"text\": \"…transcript…\"}"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Speech both ways: /v1/audio/speech synthesizes text into audio bytes; /v1/audio/transcriptions turns audio into text (Whisper-compatible); /v1/audio/translations transcribes straight into English.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "tts-1 class for speech; whisper-1 class for transcription."
                  },
                  "input": {
                    "type": "string",
                    "description": "speech only: the text to speak."
                  },
                  "voice": {
                    "type": "string",
                    "description": "speech only: voice name (alloy, nova, …); available voices per model card."
                  },
                  "file": {
                    "type": "string",
                    "description": "transcriptions only: the audio file (mp3, wav, m4a, webm …)."
                  },
                  "language": {
                    "type": "string",
                    "description": "transcriptions only: ISO-639-1 hint that improves accuracy."
                  },
                  "response_format": {
                    "type": "string",
                    "description": "speech: mp3 | wav | opus …; transcriptions: json | text | srt | verbose_json."
                  },
                  "speed": {
                    "type": "number",
                    "description": "speech only: 0.25–4.0 playback speed."
                  }
                },
                "required": [
                  "model",
                  "input",
                  "voice",
                  "file"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/audio/speech": {
      "post": {
        "operationId": "postV1AudioSpeech",
        "summary": "TTS synthesis — returns audio bytes.",
        "tags": [
          "Audio"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": "// /v1/audio/speech → binary audio body (Content-Type: audio/mpeg)\n\n// /v1/audio/transcriptions\n{\"text\": \"…transcript…\"}"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Speech both ways: /v1/audio/speech synthesizes text into audio bytes; /v1/audio/transcriptions turns audio into text (Whisper-compatible); /v1/audio/translations transcribes straight into English.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "tts-1 class for speech; whisper-1 class for transcription."
                  },
                  "input": {
                    "type": "string",
                    "description": "speech only: the text to speak."
                  },
                  "voice": {
                    "type": "string",
                    "description": "speech only: voice name (alloy, nova, …); available voices per model card."
                  },
                  "file": {
                    "type": "string",
                    "description": "transcriptions only: the audio file (mp3, wav, m4a, webm …)."
                  },
                  "language": {
                    "type": "string",
                    "description": "transcriptions only: ISO-639-1 hint that improves accuracy."
                  },
                  "response_format": {
                    "type": "string",
                    "description": "speech: mp3 | wav | opus …; transcriptions: json | text | srt | verbose_json."
                  },
                  "speed": {
                    "type": "number",
                    "description": "speech only: 0.25–4.0 playback speed."
                  }
                },
                "required": [
                  "model",
                  "input",
                  "voice",
                  "file"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/music/generations": {
      "post": {
        "operationId": "postV1MusicGenerations",
        "summary": "Async music generation — returns a task_id; optional webhook supported.",
        "tags": [
          "Music"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": "// POST — submit accepted\n{\"id\": \"task_xxx\", \"task_id\": \"task_xxx\", \"object\": \"music.task\", \"model\": \"suno\", \"status\": \"queued\"}\n\n// GET /v1/music/tasks/{task_id}\n{\n  \"task_id\": \"task_xxx\",\n  \"object\": \"music.task\",\n  \"operation\": \"music\",\n  \"status\": \"completed\",\n  \"progress\": \"100%\",\n  \"url\": \"https://…/audio/task_xxx\",\n  \"assets\": [\n    {\"type\": \"audio\", \"url\": \"https://…\"},\n    {\"type\": \"audio\", \"url\": \"https://…\"},\n    {\"type\": \"image\", \"url\": \"https://…\"}\n  ],\n  \"data\": {\n    \"music\": [{\"audio_url\": \"https://…\"}],\n    \"lyrics\": {\"title\": \"Neon Rain\", \"text\": \"[Verse] …\"},\n    \"result\": {\"music\": [{\"audio_id\": \"…\", \"title\": \"Neon Rain\", \"duration\": 182.4, \"audio_url\": \"https://…\", \"image_url\": \"https://…\"}]}\n  },\n  \"billing\": {\"…\": \"…\"}\n}"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Suno songs, lyrics and 32 tools through one endpoint. Every call returns a task_id at once; poll the task, or take a webhook, until it is completed, then read its files.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "The music model ID from the models page: suno."
                  },
                  "operation": {
                    "type": "string",
                    "description": "What to do: music (the default) makes a song, lyrics writes lyrics, and the tools below edit, extend, analyse or export a song."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Inspiration mode: what the song is about, up to 3000 characters. Custom mode: the lyrics, up to 5000. Not needed for a custom-mode instrumental. For lyrics: the brief."
                  },
                  "custom": {
                    "type": "boolean",
                    "description": "false (the default): inspiration mode, prompt describes the song. true: custom mode, prompt is the lyrics, and title, style, negative_tags, auto_lyrics, persona_id, duration and max_mode apply."
                  },
                  "instrumental": {
                    "type": "boolean",
                    "description": "true: no vocals."
                  },
                  "version": {
                    "type": "string",
                    "description": "v6 (the default), v6-wild or v6-mini. Leave it out when custom_model_id is set."
                  },
                  "title": {
                    "type": "string",
                    "description": "Song title, up to 80 characters. Custom mode."
                  },
                  "style": {
                    "type": "string",
                    "description": "Style tags such as genre, mood and instruments, up to 1000 characters. Custom mode. tags is accepted as well."
                  },
                  "negative_tags": {
                    "type": "string",
                    "description": "Styles to avoid. Custom mode."
                  },
                  "vocal_gender": {
                    "type": "string",
                    "description": "Male or Female."
                  },
                  "auto_lyrics": {
                    "type": "boolean",
                    "description": "true: rewrite the given lyrics creatively. Custom mode."
                  },
                  "style_weight": {
                    "type": "number",
                    "description": "0 to 1: how closely the song follows the style. 0 is a real value."
                  },
                  "weirdness_constraint": {
                    "type": "number",
                    "description": "0 to 1: how adventurous the song is."
                  },
                  "audio_weight": {
                    "type": "number",
                    "description": "0 to 1: how much a reference recording counts."
                  },
                  "variety": {
                    "type": "string",
                    "description": "off, normal, high, extra or max: how much the results vary."
                  },
                  "max_mode": {
                    "type": "boolean",
                    "description": "true: Max mode, higher quality at twice the price. Custom mode."
                  },
                  "audio_format": {
                    "type": "string",
                    "description": "mp3, m4a or wav."
                  },
                  "duration": {
                    "type": "integer",
                    "description": "Target length in seconds, 10 to 360. Custom mode; the finished song may differ."
                  },
                  "persona_id": {
                    "type": "string",
                    "description": "A singer persona made with the persona tool. Custom mode; not together with custom_model_id."
                  },
                  "custom_model_id": {
                    "type": "string",
                    "description": "A model trained with create-model. Replaces version; not together with persona_id."
                  },
                  "parameters": {
                    "type": "object",
                    "description": "A tool’s own fields (see Tools below), for example task_id and audio_index of the song it works on."
                  },
                  "webhook_url": {
                    "type": "string",
                    "description": "HTTPS URL called once the task reaches a terminal state."
                  },
                  "webhook_secret": {
                    "type": "string",
                    "description": "If set, deliveries carry X-Xiaoxiang-Signature: sha256=hex(HMAC-SHA256(body, secret))."
                  }
                },
                "required": [
                  "model"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/music/tasks/{task_id}": {
      "get": {
        "operationId": "getV1MusicTasksTaskId",
        "summary": "Poll async music task status and progress.",
        "tags": [
          "Music"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/music/tasks/{task_id}/content": {
      "get": {
        "operationId": "getV1MusicTasksTaskIdContent",
        "summary": "Fetch the finished audio through the gateway.",
        "tags": [
          "Music"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/generations": {
      "post": {
        "operationId": "postV1ImagesGenerations",
        "summary": "OpenAI’s image API — every image model, the finished image in the response.",
        "tags": [
          "Image"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "created": 1720000000,
                  "data": [
                    {
                      "b64_json": "iVBORw0KGgo…",
                      "url": "https://…"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "OpenAI’s image API, as the OpenAI SDK calls it. Every image model answers it: the call waits until the image is ready (usually 30–60 s) and returns it the way OpenAI does. To edit images, call /v1/images/edits the same way with the images uploaded as files or given as URLs.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Any image model, e.g. gpt-image-2."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "What to draw."
                  },
                  "n": {
                    "type": "integer",
                    "description": "Number of images (billing multiplies per image)."
                  },
                  "size": {
                    "type": "string",
                    "description": "Aspect-ratio preset such as \"16:9\" — what most image models take; the model card lists the exact values. Some older models also accept WIDTHxHEIGHT."
                  },
                  "resolution": {
                    "type": "string",
                    "description": "Output resolution tier such as \"1K\", \"2K\" or \"4K\", where the model card lists it — also a pricing-tier dimension."
                  },
                  "quality": {
                    "type": "string",
                    "description": "Vendor quality level (e.g. standard / hd) — also a pricing-tier dimension."
                  },
                  "response_format": {
                    "type": "string",
                    "description": "\"b64_json\" (default): the image bytes; \"url\": a link to the image instead."
                  }
                },
                "required": [
                  "model",
                  "prompt"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/images/tasks": {
      "post": {
        "operationId": "postV1ImagesTasks",
        "summary": "Async image generation, the route image models use — returns a task_id; optional webhook supported.",
        "tags": [
          "Image"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": "// POST /v1/images/tasks\n{\"task_id\": \"task_xxx\", \"status\": \"queued\"}\n\n// GET /v1/images/tasks/{task_id}\n{\"task_id\": \"task_xxx\", \"status\": \"processing\", \"progress\": \"60%\"}\n\n// GET /v1/images/tasks/{task_id}/content — after completion\n{\"created\": 1720000000, \"data\": [{\"url\": \"https://…\"}]}"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Async image generation — the route every image model in the catalogue uses. Submit returns a task_id; poll the status endpoint, then read persistent result URLs from /content — or register a webhook and skip polling.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "An async image model ID, e.g. gpt-image-2. Sync-only models reject this endpoint."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "What to draw."
                  },
                  "size": {
                    "type": "string",
                    "description": "Aspect-ratio preset such as \"16:9\" — what most image models take; the model card lists the exact values. Some older models also accept WIDTHxHEIGHT."
                  },
                  "resolution": {
                    "type": "string",
                    "description": "Output resolution tier such as \"1K\", \"2K\" or \"4K\", where the model card lists it — also a pricing-tier dimension."
                  },
                  "quality": {
                    "type": "string",
                    "description": "Vendor quality level (e.g. standard / hd) — also a pricing-tier dimension."
                  },
                  "n": {
                    "type": "integer",
                    "description": "Number of images (billing multiplies per image)."
                  },
                  "images": {
                    "type": "array",
                    "description": "Reference images to edit or follow, as URLs or data URIs. The model card lists how many each model takes."
                  },
                  "mask": {
                    "type": "string",
                    "description": "Repaint one area of the first reference image — see \"Edit part of an image\" below. Only models whose model card lists mask take it; mask_url is accepted as the same field."
                  },
                  "webhook_url": {
                    "type": "string",
                    "description": "HTTPS URL called once the task reaches a terminal state — see the video guide for the callback contract."
                  },
                  "webhook_secret": {
                    "type": "string",
                    "description": "If set, deliveries carry X-Xiaoxiang-Signature: sha256=hex(HMAC-SHA256(body, secret))."
                  }
                },
                "required": [
                  "model",
                  "prompt"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/images/tasks/{task_id}": {
      "get": {
        "operationId": "getV1ImagesTasksTaskId",
        "summary": "Poll async image task status and progress.",
        "tags": [
          "Image"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/tasks/{task_id}/content": {
      "get": {
        "operationId": "getV1ImagesTasksTaskIdContent",
        "summary": "Fetch final image URLs — persistent links, safe to store.",
        "tags": [
          "Image"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/edits": {
      "post": {
        "operationId": "postV1ImagesEdits",
        "summary": "OpenAI’s image edit API — upload the images or give their URLs; every image model.",
        "tags": [
          "Image"
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/videos": {
      "post": {
        "operationId": "postV1Videos",
        "summary": "OpenAI-shaped video generation (Sora, Doubao) — optional webhook supported.",
        "tags": [
          "Video"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": "// POST — submit accepted\n{\"task_id\": \"task_xxx\", \"status\": \"queued\"}\n\n// GET /v1/videos/{task_id}\n{\n  \"task_id\": \"task_xxx\",\n  \"status\": \"in_progress\",      // queued | in_progress | completed | failed\n  \"progress\": \"45%\"\n}\n\n// terminal state\n{\n  \"task_id\": \"task_xxx\",\n  \"status\": \"completed\",\n  \"metadata\": {\"url\": \"https://…\"}\n}"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Async video generation (Seedance, Kling, Veo, Wan, Grok Imagine …). /v1/videos accepts text-to-video and image-to-video inputs in one OpenAI-shaped request. It returns a task_id you poll — or register a webhook at submit time.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A video model ID from the models page, e.g. doubao-seedance-2.5."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Scene description; for image2video it steers the motion."
                  },
                  "image": {
                    "type": "string",
                    "description": "image2video only: first-frame image as URL or base64."
                  },
                  "images": {
                    "type": "array",
                    "description": "Reference frames for vendors that accept multiple images in one task."
                  },
                  "duration": {
                    "type": "number",
                    "description": "Clip length in seconds — a pricing-tier dimension; supported values per model card."
                  },
                  "seconds": {
                    "type": "number",
                    "description": "Alias used by some model families for clip length; treat duration as the preferred field."
                  },
                  "resolution": {
                    "type": "string",
                    "description": "Output resolution tier such as 720p or 1080p when the model exposes it."
                  },
                  "size": {
                    "type": "string",
                    "description": "Aspect-ratio or size selector for model families that use width x height style sizing."
                  },
                  "webhook_url": {
                    "type": "string",
                    "description": "HTTPS URL called once the task reaches a terminal state — see the video guide for the callback contract."
                  },
                  "webhook_secret": {
                    "type": "string",
                    "description": "If set, deliveries carry X-Xiaoxiang-Signature: sha256=hex(HMAC-SHA256(body, secret))."
                  }
                },
                "required": [
                  "model",
                  "prompt"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/videos/{task_id}": {
      "get": {
        "operationId": "getV1VideosTaskId",
        "summary": "Poll async task status; content lives at /content.",
        "tags": [
          "Video"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteV1VideosTaskId",
        "summary": "Cancel a task that has not reached a terminal state yet.",
        "tags": [
          "Video"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/{task_id}/content": {
      "get": {
        "operationId": "getV1VideosTaskIdContent",
        "summary": "Download the finished video through the gateway.",
        "tags": [
          "Video"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/videos/{video_id}/remix": {
      "post": {
        "operationId": "postV1VideosVideoIdRemix",
        "summary": "Re-render an existing video with a new prompt, on models that support it.",
        "tags": [
          "Video"
        ],
        "parameters": [
          {
            "name": "video_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/model3d/tasks": {
      "post": {
        "operationId": "postV1Model3dTasks",
        "summary": "Async 3D asset generation and post-processing — returns a task_id.",
        "tags": [
          "3D"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": "// POST /v1/model3d/tasks\n{\"task_id\": \"task_xxx\", \"status\": \"queued\"}\n\n// GET /v1/model3d/tasks/{task_id} — after completion\n{\"task_id\": \"task_xxx\", \"status\": \"completed\", \"url\": \"https://…/model.glb\", \"output\": {\"model_url\": \"https://…/model.glb\"}}"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Async 3D generation and post-processing. One field, operation, chooses what the task does: make a model from text, an image or several views, then texture, segment, retopologise or rig it. Submit returns a task_id; poll it until the model URL arrives in the task body.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A 3D model ID from the catalogue, e.g. tripo-3d."
                  },
                  "operation": {
                    "type": "string",
                    "description": "text_to_model · image_to_model · multiview_to_model · texture · smart_segment · retopology · rig · animate."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "What to make. Used by text_to_model."
                  },
                  "input": {
                    "type": "string",
                    "description": "A public image URL for image_to_model, or the task_id of a finished 3D model for texture, smart_segment, retopology, rig and animate."
                  },
                  "inputs": {
                    "type": "string",
                    "description": "multiview_to_model: [{\"front\": url}, {\"left\": url}, …] — a front view plus at least one more."
                  },
                  "texture": {
                    "type": "boolean",
                    "description": "Generate textures with the model."
                  },
                  "pbr": {
                    "type": "boolean",
                    "description": "Generate PBR materials."
                  },
                  "texture_prompt": {
                    "type": "object",
                    "description": "texture: {\"text\": \"weathered bronze\"} describes the new surface."
                  },
                  "face_limit": {
                    "type": "integer",
                    "description": "retopology: the most faces the result may have."
                  },
                  "quad": {
                    "type": "boolean",
                    "description": "retopology: quad mesh instead of triangles."
                  },
                  "animation": {
                    "type": "string",
                    "description": "animate: the animation to apply to a rigged model."
                  }
                },
                "required": [
                  "model",
                  "operation"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/model3d/tasks/{task_id}": {
      "get": {
        "operationId": "getV1Model3dTasksTaskId",
        "summary": "Poll the 3D task; the result URL arrives in the task body, there is no /content route.",
        "tags": [
          "3D"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/upload-policy": {
      "post": {
        "operationId": "postV1MediaUpload-policy",
        "summary": "Create a short-lived file upload policy for an image, video, audio, or generic file up to its configured limit.",
        "tags": [
          "Media"
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/google-play/verify": {
      "post": {
        "operationId": "postV1Google-playVerify",
        "summary": "Check a Google Play purchase token against your app with the service account set on this key — free, no model call.",
        "tags": [
          "App subscriptions"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "package_name": "com.example.app",
                  "subscribed": true,
                  "active": true,
                  "in_trial": false,
                  "state": "SUBSCRIPTION_STATE_ACTIVE",
                  "product_id": "vip_monthly",
                  "expiry_time": 1793000000,
                  "auto_renewing": true,
                  "acknowledged": true,
                  "test_purchase": false,
                  "order_id": "GPA.3300-1111-2222-44444..2",
                  "checked_at": 1790400000
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Checks a Google Play purchase token with the service account set on this API key (console → API keys → Edit → Google Play subscription check). The answer comes straight from Google; the gateway bills nothing and your app decides what to unlock. Answers are cached for one minute per token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "purchase_token": {
                    "type": "string",
                    "description": "The purchase token from Play Billing. In Flutter in_app_purchase it is purchaseDetails.verificationData.serverVerificationData."
                  }
                },
                "required": [
                  "purchase_token"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/xsolla/verify": {
      "post": {
        "operationId": "postV1XsollaVerify",
        "summary": "Check whether an Xsolla user has an active subscription with the Xsolla API key set on this key — free, no model call.",
        "tags": [
          "App subscriptions"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "project_id": 273204,
                  "subscribed": true,
                  "active": true,
                  "in_trial": false,
                  "state": "active",
                  "subscription_id": 249579,
                  "user_id": "user-8f2c",
                  "plan_id": 601,
                  "plan_external_id": "weekly",
                  "expiry_time": 1793000000,
                  "auto_renewing": true,
                  "checked_at": 1790400000
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Checks whether an Xsolla user, or one subscription, is subscribed, with the merchant ID, project ID and Xsolla API key set on this API key (console → API keys → Edit → Xsolla subscription check). The answer comes straight from Xsolla; the gateway bills nothing and your app decides what to unlock. Found subscriptions are cached for one minute.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "string",
                    "description": "The user.id your app put into the Xsolla payment token. Required unless subscription_id is sent."
                  },
                  "subscription_id": {
                    "type": "integer",
                    "description": "An Xsolla subscription ID, if the app has one. Sent together with user_id, the subscription must belong to that user."
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/balance": {
      "get": {
        "operationId": "getV1Balance",
        "summary": "Account balance and what this key can still spend — free, no model call.",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "object": "balance",
                  "currency": "USD",
                  "balance": 12.5,
                  "available": 2,
                  "key": {
                    "name": "app",
                    "unlimited": false,
                    "remaining": 2,
                    "used": 1,
                    "expires_at": 0
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Returns the account balance and what the calling API key can still spend, in USD. Free and read-only: no model call, nothing billed. Keys that are used up or expired can still call it; only disabled keys are refused."
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "getV1Models",
        "summary": "List every model this key is allowed to hit.",
        "tags": [
          "Metadata"
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/models/{model}": {
      "get": {
        "operationId": "getV1ModelsModel",
        "summary": "Retrieve one model entry — the shape Anthropic and OpenAI clients probe on startup.",
        "tags": [
          "Metadata"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1beta/models": {
      "get": {
        "operationId": "getV1betaModels",
        "summary": "List models in the Gemini catalogue shape.",
        "tags": [
          "Compatibility · Gemini native"
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1beta/models/{modelAndAction}": {
      "post": {
        "operationId": "postV1betaModelsModelAndAction",
        "summary": "Gemini path form: /v1beta/models/{model}:{action}, e.g. :generateContent or :streamGenerateContent.",
        "tags": [
          "Compatibility · Gemini native"
        ],
        "parameters": [
          {
            "name": "modelAndAction",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/models/{modelAndAction}": {
      "post": {
        "operationId": "postV1ModelsModelAndAction",
        "summary": "Same Gemini request shape under /v1, for clients that cannot change the API version prefix.",
        "tags": [
          "Compatibility · Gemini native"
        ],
        "parameters": [
          {
            "name": "modelAndAction",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/engines/{model}/embeddings": {
      "post": {
        "operationId": "postV1EnginesModelEmbeddings",
        "summary": "Gemini embeddings through the legacy engines path.",
        "tags": [
          "Compatibility · Gemini native"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kling/v1/videos/text2video": {
      "post": {
        "operationId": "postKlingV1VideosText2video",
        "summary": "Submit a Kling text-to-video task in the vendor’s own body shape.",
        "tags": [
          "Compatibility · Kling native"
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/kling/v1/videos/image2video": {
      "post": {
        "operationId": "postKlingV1VideosImage2video",
        "summary": "Submit a Kling image-to-video task.",
        "tags": [
          "Compatibility · Kling native"
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/kling/v1/videos/text2video/{task_id}": {
      "get": {
        "operationId": "getKlingV1VideosText2videoTaskId",
        "summary": "Poll a Kling text-to-video task.",
        "tags": [
          "Compatibility · Kling native"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kling/v1/videos/image2video/{task_id}": {
      "get": {
        "operationId": "getKlingV1VideosImage2videoTaskId",
        "summary": "Poll a Kling image-to-video task.",
        "tags": [
          "Compatibility · Kling native"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/jimeng/": {
      "post": {
        "operationId": "postJimeng",
        "summary": "Submit a task with req_key and prompt in the vendor body. The trailing slash is required — /jimeng redirects, and a 301 drops the body in most HTTP clients. Fetch the result of a submitted task.",
        "tags": [
          "Compatibility · Jimeng native"
        ],
        "parameters": [
          {
            "name": "Action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "CVSync2AsyncSubmitTask",
                "CVSync2AsyncGetResult"
              ]
            },
            "description": "Vendor-defined selector. One of CVSync2AsyncSubmitTask, CVSync2AsyncGetResult."
          },
          {
            "name": "Version",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2022-08-31"
              ]
            },
            "description": "Vendor-defined selector. One of 2022-08-31."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/suno/submit/{action}": {
      "post": {
        "operationId": "postSunoSubmitAction",
        "summary": "action is music or lyrics.",
        "tags": [
          "Compatibility · Suno native"
        ],
        "parameters": [
          {
            "name": "action",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/suno/fetch": {
      "post": {
        "operationId": "postSunoFetch",
        "summary": "Batch fetch by id list.",
        "tags": [
          "Compatibility · Suno native"
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/suno/fetch/{id}": {
      "get": {
        "operationId": "getSunoFetchId",
        "summary": "Fetch one task.",
        "tags": [
          "Compatibility · Suno native"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/completions": {
      "post": {
        "operationId": "postV1Completions",
        "summary": "OpenAI legacy prompt completion. Use /v1/chat/completions.",
        "tags": [
          "Compatibility · Legacy aliases"
        ],
        "deprecated": true,
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/edits": {
      "post": {
        "operationId": "postV1Edits",
        "summary": "Routes to the image edit format despite the name. Use /v1/images/edits.",
        "tags": [
          "Compatibility · Legacy aliases"
        ],
        "deprecated": true,
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/video/generations": {
      "post": {
        "operationId": "postV1VideoGenerations",
        "summary": "Pre-OpenAI-shape video submission. Use POST /v1/videos.",
        "tags": [
          "Compatibility · Legacy aliases"
        ],
        "deprecated": true,
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "409": {
            "$ref": "#/components/responses/error409"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Executes the request once and replays the stored response for 24h. Not supported with streaming responses."
          }
        ]
      }
    },
    "/v1/video/generations/{task_id}": {
      "get": {
        "operationId": "getV1VideoGenerationsTaskId",
        "summary": "Pre-OpenAI-shape video poll. Use GET /v1/videos/{task_id}.",
        "tags": [
          "Compatibility · Legacy aliases"
        ],
        "deprecated": true,
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mj/task/{id}/fetch": {
      "get": {
        "operationId": "getMjTaskIdFetch",
        "summary": "Inspect an archived task.",
        "tags": [
          "Compatibility · Midjourney archive"
        ],
        "deprecated": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mj/task/{id}/image-seed": {
      "get": {
        "operationId": "getMjTaskIdImage-seed",
        "summary": "Read the seed of an archived image.",
        "tags": [
          "Compatibility · Midjourney archive"
        ],
        "deprecated": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mj/image/{id}": {
      "get": {
        "operationId": "getMjImageId",
        "summary": "Serve an archived image.",
        "tags": [
          "Compatibility · Midjourney archive"
        ],
        "deprecated": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identifier returned by the matching submit call."
          }
        ],
        "responses": {
          "200": {
            "description": "Success."
          },
          "401": {
            "$ref": "#/components/responses/error401"
          },
          "402": {
            "$ref": "#/components/responses/error402"
          },
          "429": {
            "$ref": "#/components/responses/error429"
          },
          "503": {
            "$ref": "#/components/responses/error503"
          },
          "default": {
            "description": "Unexpected error. Always carries X-Oneapi-Request-Id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "x-websocket-endpoints": [
    {
      "path": "/v1/realtime",
      "summary": "OpenAI Realtime API — audio + text over one socket."
    }
  ]
}
