{
  "openapi": "3.0.1",
  "info": {
    "title": "GetRouter API",
    "description": "Use one GetRouter API key to access chat, reasoning, image, audio, video, embedding, and other AI model capabilities through compatible APIs.",
    "version": "1.0.0"
  },
  "tags": [
    {
      "name": "Models",
      "description": "Discover models available through GetRouter."
    },
    {
      "name": "Chat Completions",
      "description": "OpenAI-compatible chat completion endpoints."
    },
    {
      "name": "Responses",
      "description": "OpenAI-compatible Responses API endpoints."
    },
    {
      "name": "Embeddings",
      "description": "Create vector embeddings from text input."
    },
    {
      "name": "Completions",
      "description": "Create legacy text completions."
    },
    {
      "name": "Image Generation",
      "description": "Generate and edit images."
    },
    {
      "name": "Audio",
      "description": "Transcribe, translate, and synthesize audio."
    },
    {
      "name": "Video Generation",
      "description": "Create and retrieve video generation tasks."
    },
    {
      "name": "Rerank",
      "description": "Rerank documents against a query."
    },
    {
      "name": "Claude Messages",
      "description": "Anthropic Claude Messages-compatible endpoint."
    },
    {
      "name": "Gemini API",
      "description": "Google Gemini-compatible endpoints."
    },
    {
      "name": "Moderations",
      "description": "Classify potentially harmful content."
    },
    {
      "name": "Realtime",
      "description": "Connect to realtime model sessions."
    }
  ],
  "paths": {
    "/v1/models": {
      "get": {
        "summary": "List models",
        "deprecated": false,
        "description": "获取当前可用的模型列表。\n\n根据请求头自动识别返回格式：\n- 包含 `x-api-key` 和 `anthropic-version` 头时返回 Anthropic 格式\n- 包含 `x-goog-api-key` 头或 `key` 查询参数时返回 Gemini 格式\n- 其他情况返回 OpenAI 格式\n",
        "operationId": "listModels",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "description": "Google API Key (用于 Gemini 格式)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Anthropic API Key (用于 Claude 格式)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "anthropic-version",
            "in": "header",
            "description": "Anthropic API 版本",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-goog-api-key",
            "in": "header",
            "description": "Google API Key (用于 Gemini 格式)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功获取模型列表",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelsResponse"
                }
              }
            },
            "headers": {}
          },
          "401": {
            "description": "认证失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1beta/models": {
      "get": {
        "summary": "List models in Gemini format",
        "deprecated": false,
        "description": "以 Gemini API 格式返回可用模型列表",
        "operationId": "listModelsGemini",
        "tags": [
          "Models"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "成功获取模型列表",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeminiModelsResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/chat/completions": {
      "post": {
        "summary": "Create a chat completion",
        "deprecated": false,
        "description": "根据对话历史创建模型响应。支持流式和非流式响应。\n\n兼容 OpenAI Chat Completions API。\n",
        "operationId": "createChatCompletion",
        "tags": [
          "Chat Completions"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功创建响应",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                }
              }
            },
            "headers": {}
          },
          "400": {
            "description": "请求参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          },
          "429": {
            "description": "请求频率限制",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/responses": {
      "post": {
        "summary": "Create a response",
        "deprecated": false,
        "description": "OpenAI Responses API，用于创建模型响应。\n支持多轮对话、工具调用、推理等功能。\n",
        "operationId": "createResponse",
        "tags": [
          "Responses"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功创建响应",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/responses/compact": {
      "post": {
        "summary": "Compact a response conversation",
        "deprecated": false,
        "description": "OpenAI Responses API，用于对长对话进行 compaction。",
        "operationId": "compactResponse",
        "tags": [
          "Responses"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesCompactionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功压缩对话",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesCompactionResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/images/generations": {
      "post": {
        "summary": "Generate an image",
        "deprecated": false,
        "description": " 百炼qwen-image系列图片生成",
        "operationId": "createImage",
        "tags": [
          "Image Generation"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "messages": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "role": {
                              "type": "string"
                            },
                            "content": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "text": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "messages"
                    ]
                  },
                  "parameters": {
                    "type": "object",
                    "properties": {
                      "negative_prompt": {
                        "type": "string"
                      },
                      "prompt_extend": {
                        "type": "boolean"
                      },
                      "watermark": {
                        "type": "boolean"
                      },
                      "size": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "model",
                  "input"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功生成图像",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/images/edits": {
      "post": {
        "summary": "Edit an image",
        "deprecated": false,
        "description": " 百炼qwen-image系列图片生成",
        "operationId": "createImagePostV1ImagesEdits",
        "tags": [
          "Image Generation"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "messages": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "role": {
                              "type": "string"
                            },
                            "content": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "image": {
                                    "type": "string"
                                  },
                                  "text": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "messages"
                    ]
                  },
                  "parameters": {
                    "type": "object",
                    "properties": {
                      "n": {
                        "type": "integer"
                      },
                      "negative_prompt": {
                        "type": "string"
                      },
                      "prompt_extend": {
                        "type": "boolean"
                      },
                      "watermark": {
                        "type": "boolean"
                      },
                      "size": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "model",
                  "input"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功生成图像",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/videos": {
      "post": {
        "summary": "Create a video",
        "deprecated": false,
        "description": "OpenAI 兼容的视频生成接口。\n\n参考文档: https://platform.openai.com/docs/api-reference/videos/create\n",
        "operationId": "createVideo",
        "tags": [
          "Video Generation"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "description": "模型名称",
                    "type": "string"
                  },
                  "prompt": {
                    "description": "提示词",
                    "type": "string"
                  },
                  "seconds": {
                    "description": "生成秒数",
                    "type": "string"
                  },
                  "input_reference": {
                    "format": "binary",
                    "type": "string",
                    "description": "参考图片文件"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功创建视频任务",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "视频 ID"
                    },
                    "object": {
                      "type": "string",
                      "description": "对象类型"
                    },
                    "model": {
                      "type": "string",
                      "description": "使用的模型"
                    },
                    "status": {
                      "type": "string",
                      "description": "任务状态"
                    },
                    "progress": {
                      "type": "integer",
                      "description": "进度百分比"
                    },
                    "created_at": {
                      "type": "integer",
                      "description": "创建时间戳"
                    },
                    "seconds": {
                      "type": "string",
                      "description": "视频时长"
                    },
                    "completed_at": {
                      "type": "integer",
                      "description": "完成时间戳"
                    },
                    "expires_at": {
                      "type": "integer",
                      "description": "过期时间戳"
                    },
                    "size": {
                      "type": "string",
                      "description": "视频尺寸"
                    },
                    "error": {
                      "$ref": "#/components/schemas/OpenAIVideoError"
                    },
                    "metadata": {
                      "type": "object",
                      "description": "额外元数据",
                      "additionalProperties": true,
                      "properties": {}
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "model",
                    "status",
                    "progress",
                    "created_at",
                    "seconds"
                  ]
                }
              }
            },
            "headers": {}
          },
          "400": {
            "description": "请求参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/videos/{task_id}": {
      "get": {
        "summary": "Retrieve a video task",
        "deprecated": false,
        "description": "OpenAI 兼容的视频任务状态查询接口。\n\n返回视频任务的详细状态信息。\n",
        "operationId": "getVideo",
        "tags": [
          "Video Generation"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "description": "视频任务 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功获取视频任务状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "progress": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "integer"
                    },
                    "seconds": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "object",
                    "model",
                    "status",
                    "progress",
                    "created_at",
                    "seconds"
                  ]
                }
              }
            },
            "headers": {}
          },
          "404": {
            "description": "任务不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/videos/{task_id}/content": {
      "get": {
        "summary": "Download video content",
        "deprecated": false,
        "description": "获取已完成视频任务的视频文件内容。\n\n此接口会代理返回视频文件流。\n",
        "operationId": "getVideoContent",
        "tags": [
          "Video Generation"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "description": "视频任务 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功获取视频内容",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {}
          },
          "404": {
            "description": "视频不存在或未完成",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/kling/v1/videos/text2video": {
      "post": {
        "summary": "Create a Kling text-to-video task",
        "deprecated": false,
        "description": "使用 Kling 模型从文本描述生成视频。\n\n支持的模型：kling-v1, kling-v1-5 等\n",
        "operationId": "createKlingText2Video",
        "tags": [
          "Video Generation"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功创建视频生成任务",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoResponse"
                }
              }
            },
            "headers": {}
          },
          "400": {
            "description": "请求参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/kling/v1/videos/text2video/{task_id}": {
      "get": {
        "summary": "Retrieve a Kling text-to-video task",
        "deprecated": false,
        "description": "查询 Kling 文生视频任务的状态和结果。",
        "operationId": "getKlingText2Video",
        "tags": [
          "Video Generation"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "description": "任务 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功获取任务状态",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoTaskResponse"
                }
              }
            },
            "headers": {}
          },
          "404": {
            "description": "任务不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/kling/v1/videos/image2video": {
      "post": {
        "summary": "Create a Kling image-to-video task",
        "deprecated": false,
        "description": "使用 Kling 模型从图片生成视频。\n\n支持通过 image 参数传入图片 URL 或 Base64 编码的图片数据。\n",
        "operationId": "createKlingImage2Video",
        "tags": [
          "Video Generation"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功创建视频生成任务",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoResponse"
                }
              }
            },
            "headers": {}
          },
          "400": {
            "description": "请求参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/kling/v1/videos/image2video/{task_id}": {
      "get": {
        "summary": "Retrieve a Kling image-to-video task",
        "deprecated": false,
        "description": "查询 Kling 图生视频任务的状态和结果。",
        "operationId": "getKlingImage2Video",
        "tags": [
          "Video Generation"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "description": "任务 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功获取任务状态",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoTaskResponse"
                }
              }
            },
            "headers": {}
          },
          "404": {
            "description": "任务不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/jimeng/": {
      "post": {
        "summary": "Create a Jimeng video task",
        "deprecated": false,
        "description": "即梦官方 API 格式的视频生成接口。\n\n支持通过 Action 参数指定操作类型：\n- `CVSync2AsyncSubmitTask`: 提交视频生成任务\n- `CVSync2AsyncGetResult`: 获取任务结果\n\n需要在查询参数中指定 Action 和 Version。\n",
        "operationId": "createJimengVideo",
        "tags": [
          "Video Generation"
        ],
        "parameters": [
          {
            "name": "Action",
            "in": "query",
            "description": "API 操作类型",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "CVSync2AsyncSubmitTask",
                "CVSync2AsyncGetResult"
              ]
            }
          },
          {
            "name": "Version",
            "in": "query",
            "description": "API 版本",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "即梦官方 API 请求格式",
                "properties": {
                  "req_key": {
                    "type": "string",
                    "description": "请求类型标识"
                  },
                  "prompt": {
                    "type": "string",
                    "description": "文本描述"
                  },
                  "binary_data_base64": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Base64 编码的图片数据"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功处理请求",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "description": "响应码"
                    },
                    "message": {
                      "type": "string",
                      "description": "响应消息"
                    },
                    "data": {
                      "type": "object",
                      "description": "响应数据",
                      "properties": {}
                    }
                  }
                }
              }
            },
            "headers": {}
          },
          "400": {
            "description": "请求参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/video/generations": {
      "post": {
        "summary": "Create a video generation task",
        "deprecated": false,
        "description": "提交视频生成任务，支持文生视频和图生视频。\n\n返回任务 ID，可通过 GET 接口查询任务状态。\n",
        "operationId": "createVideoGeneration",
        "tags": [
          "Video Generation"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功创建视频生成任务",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoResponse"
                }
              }
            },
            "headers": {}
          },
          "400": {
            "description": "请求参数错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/video/generations/{task_id}": {
      "get": {
        "summary": "Retrieve a video generation task",
        "deprecated": false,
        "description": "查询视频生成任务的状态和结果。\n\n任务状态：\n- `queued`: 排队中\n- `in_progress`: 生成中\n- `completed`: 已完成\n- `failed`: 失败\n",
        "operationId": "getVideoGeneration",
        "tags": [
          "Video Generation"
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "description": "任务 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功获取任务状态",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoTaskResponse"
                }
              }
            },
            "headers": {}
          },
          "404": {
            "description": "任务不存在",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/messages": {
      "post": {
        "summary": "Create a Claude message",
        "deprecated": false,
        "description": "Anthropic Claude Messages API 格式的请求。\n需要在请求头中包含 `anthropic-version`。\n",
        "operationId": "createMessage",
        "tags": [
          "Claude Messages"
        ],
        "parameters": [
          {
            "name": "anthropic-version",
            "in": "header",
            "description": "Anthropic API 版本",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Anthropic API Key (可选，也可使用 Bearer Token)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaudeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功创建响应",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaudeResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1beta/models/{model}:generateContent": {
      "post": {
        "summary": "Generate Gemini content",
        "deprecated": false,
        "description": "Gemini 图片生成",
        "operationId": "geminiRelayV1Beta",
        "tags": [
          "Gemini API"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "description": "模型名称",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contents": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "generationConfig": {
                    "type": "object",
                    "properties": {
                      "responseModalities": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "imageConfig": {
                        "type": "object",
                        "properties": {
                          "aspectRatio": {
                            "type": "string"
                          },
                          "imageSize": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "required": [
                      "responseModalities"
                    ]
                  }
                },
                "required": [
                  "contents",
                  "generationConfig"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeminiResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/engines/{model}/embeddings": {
      "post": {
        "summary": "Create Gemini embeddings",
        "deprecated": false,
        "description": "使用指定引擎/模型创建嵌入",
        "operationId": "createEngineEmbedding",
        "tags": [
          "Gemini API"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "description": "模型/引擎 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功创建嵌入",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/embeddings": {
      "post": {
        "summary": "Create embeddings",
        "deprecated": false,
        "description": "将文本转换为向量嵌入",
        "operationId": "createEmbedding",
        "tags": [
          "Embeddings"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功创建嵌入",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/completions": {
      "post": {
        "summary": "Create a text completion",
        "deprecated": false,
        "description": "基于给定提示创建文本补全",
        "operationId": "createCompletion",
        "tags": [
          "Completions"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功创建响应",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompletionResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/audio/transcriptions": {
      "post": {
        "summary": "Transcribe audio",
        "deprecated": false,
        "description": "将音频转换为文本",
        "operationId": "createTranscription",
        "tags": [
          "Audio"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "音频文件"
                  },
                  "model": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string",
                    "description": "ISO-639-1 语言代码"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "response_format": {
                    "type": "string",
                    "enum": [
                      "json",
                      "text",
                      "srt",
                      "verbose_json",
                      "vtt"
                    ],
                    "default": "json"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "timestamp_granularities": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "word",
                        "segment"
                      ]
                    }
                  }
                },
                "required": [
                  "file",
                  "model"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功转录",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioTranscriptionResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/audio/translations": {
      "post": {
        "summary": "Translate audio",
        "deprecated": false,
        "description": "将音频翻译为英文文本",
        "operationId": "createTranslation",
        "tags": [
          "Audio"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "model": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "response_format": {
                    "type": "string"
                  },
                  "temperature": {
                    "type": "number"
                  }
                },
                "required": [
                  "file",
                  "model"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功翻译",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioTranscriptionResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/audio/speech": {
      "post": {
        "summary": "Generate speech",
        "deprecated": false,
        "description": "将文本转换为音频",
        "operationId": "createSpeech",
        "tags": [
          "Audio"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeechRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功生成音频",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/rerank": {
      "post": {
        "summary": "Rerank documents",
        "deprecated": false,
        "description": "根据查询对文档列表进行相关性重排序",
        "operationId": "createRerank",
        "tags": [
          "Rerank"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RerankRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功重排序",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RerankResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/moderations": {
      "post": {
        "summary": "Create a moderation",
        "deprecated": false,
        "description": "检查文本内容是否违反使用政策",
        "operationId": "createModeration",
        "tags": [
          "Moderations"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModerationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功审核",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/realtime": {
      "get": {
        "summary": "Connect to the Realtime API",
        "deprecated": false,
        "description": "建立 WebSocket 连接用于实时对话。\n\n**注意**: 这是一个 WebSocket 端点，需要使用 WebSocket 协议连接。\n\n连接 URL 示例: `wss://api.example.com/v1/realtime?model=gpt-4o-realtime`\n",
        "operationId": "createRealtimeSession",
        "tags": [
          "Realtime"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "query",
            "description": "要使用的模型",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "WebSocket 协议切换",
            "headers": {}
          },
          "400": {
            "description": "请求错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ModelsResponse": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Model"
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "错误信息"
              },
              "type": {
                "type": "string",
                "description": "错误类型"
              },
              "param": {
                "type": "string",
                "description": "相关参数",
                "nullable": true
              },
              "code": {
                "type": "string",
                "description": "错误代码",
                "nullable": true
              }
            }
          }
        }
      },
      "GeminiModelsResponse": {
        "type": "object",
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "displayName": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "inputTokenLimit": {
                  "type": "integer"
                },
                "outputTokenLimit": {
                  "type": "integer"
                },
                "supportedGenerationMethods": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "ChatCompletionRequest": {
        "type": "object",
        "required": [
          "model",
          "messages"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "模型 ID"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "description": "对话消息列表"
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "default": 1,
            "description": "采样温度"
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 1,
            "description": "核采样参数"
          },
          "n": {
            "type": "integer",
            "minimum": 1,
            "default": 1,
            "description": "生成数量"
          },
          "stream": {
            "type": "boolean",
            "default": false,
            "description": "是否流式响应"
          },
          "stream_options": {
            "type": "object",
            "properties": {
              "include_usage": {
                "type": "boolean"
              }
            }
          },
          "stop": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "停止序列"
          },
          "max_tokens": {
            "type": "integer",
            "description": "最大生成 Token 数"
          },
          "max_completion_tokens": {
            "type": "integer",
            "description": "最大补全 Token 数"
          },
          "presence_penalty": {
            "type": "number",
            "minimum": -2,
            "maximum": 2,
            "default": 0
          },
          "frequency_penalty": {
            "type": "number",
            "minimum": -2,
            "maximum": 2,
            "default": 0
          },
          "logit_bias": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "properties": {}
          },
          "user": {
            "type": "string"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tool"
            }
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "none",
                  "auto",
                  "required"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "function": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            ]
          },
          "response_format": {
            "$ref": "#/components/schemas/ResponseFormat"
          },
          "seed": {
            "type": "integer"
          },
          "reasoning_effort": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "description": "推理强度 (用于支持推理的模型)"
          },
          "modalities": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "audio"
              ]
            }
          },
          "audio": {
            "type": "object",
            "properties": {
              "voice": {
                "type": "string"
              },
              "format": {
                "type": "string"
              }
            }
          }
        }
      },
      "ChatCompletionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "created": {
            "type": "integer"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "message": {
                  "$ref": "#/components/schemas/Message"
                },
                "finish_reason": {
                  "type": "string",
                  "enum": [
                    "stop",
                    "length",
                    "tool_calls",
                    "content_filter"
                  ]
                }
              }
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          },
          "system_fingerprint": {
            "type": "string"
          }
        }
      },
      "ResponsesRequest": {
        "type": "object",
        "required": [
          "model"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "input": {
            "description": "输入内容，可以是字符串或消息数组",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {}
                }
              }
            ]
          },
          "instructions": {
            "type": "string"
          },
          "max_output_tokens": {
            "type": "integer"
          },
          "temperature": {
            "type": "number"
          },
          "top_p": {
            "type": "number"
          },
          "stream": {
            "type": "boolean"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {}
            }
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {}
              }
            ]
          },
          "reasoning": {
            "type": "object",
            "properties": {
              "effort": {
                "type": "string",
                "enum": [
                  "low",
                  "medium",
                  "high"
                ]
              },
              "summary": {
                "type": "string"
              }
            }
          },
          "previous_response_id": {
            "type": "string"
          },
          "truncation": {
            "type": "string",
            "enum": [
              "auto",
              "disabled"
            ]
          }
        }
      },
      "ResponsesResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "created_at": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "failed",
              "in_progress",
              "incomplete"
            ]
          },
          "model": {
            "type": "string"
          },
          "output": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "content": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        }
      },
      "ResponsesCompactionRequest": {
        "type": "object",
        "required": [
          "model"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "input": {
            "description": "输入内容，可以是字符串或消息数组",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {}
                }
              }
            ]
          },
          "instructions": {
            "type": "string"
          },
          "previous_response_id": {
            "type": "string"
          }
        }
      },
      "ResponsesCompactionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "created_at": {
            "type": "integer"
          },
          "output": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {}
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          },
          "error": {
            "type": "object",
            "properties": {}
          }
        }
      },
      "ImageResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "b64_json": {
                  "type": "string"
                },
                "revised_prompt": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "OpenAIVideoError": {
        "type": "object",
        "description": "OpenAI 视频错误信息",
        "properties": {
          "message": {
            "type": "string",
            "description": "错误信息"
          },
          "code": {
            "type": "string",
            "description": "错误码"
          }
        }
      },
      "VideoRequest": {
        "type": "object",
        "description": "视频生成请求",
        "properties": {
          "model": {
            "type": "string",
            "description": "模型/风格 ID"
          },
          "prompt": {
            "type": "string",
            "description": "文本描述提示词"
          },
          "image": {
            "type": "string",
            "description": "图片输入 (URL 或 Base64)"
          },
          "duration": {
            "type": "number",
            "description": "视频时长（秒）"
          },
          "width": {
            "type": "integer",
            "description": "视频宽度"
          },
          "height": {
            "type": "integer",
            "description": "视频高度"
          },
          "fps": {
            "type": "integer",
            "description": "视频帧率"
          },
          "seed": {
            "type": "integer",
            "description": "随机种子"
          },
          "n": {
            "type": "integer",
            "description": "生成视频数量"
          },
          "response_format": {
            "type": "string",
            "description": "响应格式"
          },
          "user": {
            "type": "string",
            "description": "用户标识"
          },
          "metadata": {
            "type": "object",
            "description": "扩展参数 (如 negative_prompt, style, quality_level 等)",
            "additionalProperties": true,
            "properties": {}
          }
        }
      },
      "VideoResponse": {
        "type": "object",
        "description": "视频生成任务提交响应",
        "properties": {
          "task_id": {
            "type": "string",
            "description": "任务 ID"
          },
          "status": {
            "type": "string",
            "description": "任务状态"
          }
        }
      },
      "VideoTaskResponse": {
        "type": "object",
        "description": "视频任务状态查询响应",
        "properties": {
          "task_id": {
            "type": "string",
            "description": "任务 ID"
          },
          "status": {
            "type": "string",
            "description": "任务状态",
            "enum": [
              "queued",
              "in_progress",
              "completed",
              "failed"
            ]
          },
          "url": {
            "type": "string",
            "description": "视频资源 URL（成功时）"
          },
          "format": {
            "type": "string",
            "description": "视频格式"
          },
          "metadata": {
            "$ref": "#/components/schemas/VideoTaskMetadata"
          },
          "error": {
            "$ref": "#/components/schemas/VideoTaskError"
          }
        }
      },
      "ClaudeRequest": {
        "type": "object",
        "required": [
          "model",
          "messages",
          "max_tokens"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClaudeMessage"
            }
          },
          "system": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {}
                }
              }
            ]
          },
          "cache_control": {
            "type": "object",
            "properties": {}
          },
          "inference_geo": {
            "type": "string"
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number"
          },
          "top_k": {
            "type": "integer"
          },
          "stream": {
            "type": "boolean"
          },
          "stop_sequences": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "input_schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "any",
                      "tool",
                      "none"
                    ]
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "thinking": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "enabled",
                  "disabled"
                ]
              },
              "budget_tokens": {
                "type": "integer"
              }
            }
          },
          "context_management": {
            "type": "object",
            "properties": {}
          },
          "output_config": {
            "type": "object",
            "properties": {}
          },
          "output_format": {
            "type": "object",
            "properties": {}
          },
          "container": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {}
              }
            ]
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {}
            }
          },
          "metadata": {
            "type": "object",
            "properties": {
              "user_id": {
                "type": "string"
              }
            }
          },
          "speed": {
            "type": "string",
            "enum": [
              "standard",
              "fast"
            ]
          },
          "service_tier": {
            "type": "string",
            "enum": [
              "auto",
              "standard_only"
            ]
          }
        }
      },
      "ClaudeResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              }
            }
          },
          "model": {
            "type": "string"
          },
          "stop_reason": {
            "type": "string",
            "enum": [
              "end_turn",
              "max_tokens",
              "stop_sequence",
              "tool_use"
            ]
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "integer"
              },
              "output_tokens": {
                "type": "integer"
              },
              "cache_creation_input_tokens": {
                "type": "integer"
              },
              "cache_read_input_tokens": {
                "type": "integer"
              }
            }
          }
        }
      },
      "GeminiResponse": {
        "type": "object",
        "properties": {
          "candidates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "content": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "parts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    }
                  }
                },
                "finishReason": {
                  "type": "string"
                },
                "safetyRatings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {}
                  }
                }
              }
            }
          },
          "usageMetadata": {
            "type": "object",
            "properties": {
              "promptTokenCount": {
                "type": "integer"
              },
              "candidatesTokenCount": {
                "type": "integer"
              },
              "totalTokenCount": {
                "type": "integer"
              }
            }
          }
        }
      },
      "EmbeddingRequest": {
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "要嵌入的文本"
          },
          "encoding_format": {
            "type": "string",
            "enum": [
              "float",
              "base64"
            ],
            "default": "float"
          },
          "dimensions": {
            "type": "integer",
            "description": "输出向量维度"
          }
        }
      },
      "EmbeddingResponse": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string"
                },
                "index": {
                  "type": "integer"
                },
                "embedding": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "model": {
            "type": "string"
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          }
        }
      },
      "CompletionRequest": {
        "type": "object",
        "required": [
          "model",
          "prompt"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "prompt": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "max_tokens": {
            "type": "integer"
          },
          "temperature": {
            "type": "number"
          },
          "top_p": {
            "type": "number"
          },
          "n": {
            "type": "integer"
          },
          "stream": {
            "type": "boolean"
          },
          "stop": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "suffix": {
            "type": "string"
          },
          "echo": {
            "type": "boolean"
          }
        }
      },
      "CompletionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "created": {
            "type": "integer"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                },
                "index": {
                  "type": "integer"
                },
                "finish_reason": {
                  "type": "string"
                }
              }
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        }
      },
      "AudioTranscriptionResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          }
        }
      },
      "SpeechRequest": {
        "type": "object",
        "required": [
          "model",
          "input",
          "voice"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "input": {
            "type": "string",
            "description": "要转换的文本",
            "maxLength": 4096
          },
          "voice": {
            "type": "string",
            "enum": [
              "alloy",
              "echo",
              "fable",
              "onyx",
              "nova",
              "shimmer"
            ]
          },
          "response_format": {
            "type": "string",
            "enum": [
              "mp3",
              "opus",
              "aac",
              "flac",
              "wav",
              "pcm"
            ],
            "default": "mp3"
          },
          "speed": {
            "type": "number",
            "minimum": 0.25,
            "maximum": 4,
            "default": 1
          }
        }
      },
      "RerankRequest": {
        "type": "object",
        "required": [
          "model",
          "query",
          "documents"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "query": {
            "type": "string",
            "description": "查询文本"
          },
          "documents": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "properties": {}
                }
              ]
            },
            "description": "要重排序的文档列表"
          },
          "top_n": {
            "type": "integer",
            "description": "返回前 N 个结果"
          },
          "return_documents": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "RerankResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "relevance_score": {
                  "type": "number"
                },
                "document": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "properties": {}
          }
        }
      },
      "ModerationRequest": {
        "type": "object",
        "required": [
          "input"
        ],
        "properties": {
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "model": {
            "type": "string"
          }
        }
      },
      "ModerationResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "flagged": {
                  "type": "boolean"
                },
                "categories": {
                  "type": "object",
                  "properties": {}
                },
                "category_scores": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        }
      },
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "模型 ID"
          },
          "object": {
            "type": "string",
            "description": "对象类型"
          },
          "created": {
            "type": "integer",
            "description": "创建时间戳"
          },
          "owned_by": {
            "type": "string",
            "description": "模型所有者"
          }
        }
      },
      "Message": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "assistant",
              "tool",
              "developer"
            ],
            "description": "消息角色"
          },
          "content": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MessageContent"
                }
              }
            ],
            "description": "消息内容"
          },
          "name": {
            "type": "string",
            "description": "发送者名称"
          },
          "tool_calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolCall"
            }
          },
          "tool_call_id": {
            "type": "string",
            "description": "工具调用 ID（用于 tool 角色消息）"
          },
          "reasoning_content": {
            "type": "string",
            "description": "推理内容"
          }
        }
      },
      "Tool": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "function": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "parameters": {
                "type": "object",
                "description": "JSON Schema 格式的参数定义",
                "properties": {}
              }
            }
          }
        }
      },
      "ResponseFormat": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "json_object",
              "json_schema"
            ]
          },
          "json_schema": {
            "type": "object",
            "description": "JSON Schema 定义",
            "properties": {}
          }
        }
      },
      "Usage": {
        "type": "object",
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "description": "提示词 Token 数"
          },
          "completion_tokens": {
            "type": "integer",
            "description": "补全 Token 数"
          },
          "total_tokens": {
            "type": "integer",
            "description": "总 Token 数"
          },
          "prompt_tokens_details": {
            "type": "object",
            "properties": {
              "cached_tokens": {
                "type": "integer"
              },
              "text_tokens": {
                "type": "integer"
              },
              "audio_tokens": {
                "type": "integer"
              },
              "image_tokens": {
                "type": "integer"
              }
            }
          },
          "completion_tokens_details": {
            "type": "object",
            "properties": {
              "text_tokens": {
                "type": "integer"
              },
              "audio_tokens": {
                "type": "integer"
              },
              "reasoning_tokens": {
                "type": "integer"
              }
            }
          }
        }
      },
      "VideoTaskMetadata": {
        "type": "object",
        "description": "视频任务元数据",
        "properties": {
          "duration": {
            "type": "number",
            "description": "实际生成的视频时长"
          },
          "fps": {
            "type": "integer",
            "description": "实际帧率"
          },
          "width": {
            "type": "integer",
            "description": "实际宽度"
          },
          "height": {
            "type": "integer",
            "description": "实际高度"
          },
          "seed": {
            "type": "integer",
            "description": "使用的随机种子"
          }
        }
      },
      "VideoTaskError": {
        "type": "object",
        "description": "视频任务错误信息",
        "properties": {
          "code": {
            "type": "integer",
            "description": "错误码"
          },
          "message": {
            "type": "string",
            "description": "错误信息"
          }
        }
      },
      "ClaudeMessage": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ]
          },
          "content": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "text",
                        "image",
                        "tool_use",
                        "tool_result"
                      ]
                    },
                    "text": {
                      "type": "string"
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "base64",
                            "url"
                          ]
                        },
                        "media_type": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      }
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "input": {
                      "type": "object",
                      "properties": {}
                    },
                    "tool_use_id": {
                      "type": "string"
                    },
                    "content": {
                      "type": "string"
                    }
                  }
                }
              }
            ]
          }
        }
      },
      "MessageContent": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "image_url",
              "input_audio",
              "file",
              "video_url"
            ]
          },
          "text": {
            "type": "string"
          },
          "image_url": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "description": "图片 URL 或 base64"
              },
              "detail": {
                "type": "string",
                "enum": [
                  "low",
                  "high",
                  "auto"
                ]
              }
            }
          },
          "input_audio": {
            "type": "object",
            "properties": {
              "data": {
                "type": "string",
                "description": "Base64 编码的音频数据"
              },
              "format": {
                "type": "string",
                "enum": [
                  "wav",
                  "mp3"
                ]
              }
            }
          },
          "file": {
            "type": "object",
            "properties": {
              "filename": {
                "type": "string"
              },
              "file_data": {
                "type": "string"
              },
              "file_id": {
                "type": "string"
              }
            }
          },
          "video_url": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            }
          }
        }
      },
      "ToolCall": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "function": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "arguments": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authenticate with your GetRouter API key using `Authorization: Bearer YOUR_API_KEY`."
      }
    }
  },
  "servers": [
    {
      "url": "https://getrouter.ai",
      "description": "GetRouter production API"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ]
}
