{
  "openapi": "3.0.3",
  "info": {
    "title": "API — Core inference API",
    "version": "0.5.0",
    "description": "面向接入的精选规范，不是全部管理或供应商接口。 / Curated integration specification, not the entire management or provider API.",
    "license": {
      "name": "AGPL-3.0-or-later"
    }
  },
  "x-source-revision": "1b7b8df6a2eb3d59485e71ea79a48f248c11b668",
  "x-source-files": [
    "router/relay-router.go",
    "router/task-plugin-protocol-router.go",
    "controller/model.go",
    "relaykit/dto/openai_request.go",
    "relaykit/dto/openai_response.go",
    "relay/helper/valid_request.go",
    "router/video-router.go",
    "pkg/jsplugin/routing.go",
    "controller/relay.go",
    "controller/video_proxy.go",
    "controller/plugin_protocol_image.go",
    "relay/relay_task.go",
    "relay/channel/task/jsplugin/adaptor.go",
    "relay/channel/openai/adaptor.go",
    "relaykit/dto/openai_image.go",
    "relaykit/dto/audio.go",
    "relaykit/dto/openai_video.go",
    "dto/task.go",
    "relaykit/dto/embedding.go",
    "relaykit/dto/rerank.go",
    "relay/channel/cohere/relay-cohere.go",
    "relay/channel/jina/adaptor.go",
    "relay/channel/ali/rerank.go",
    "relay/channel/advancedcustom/rerank.go",
    "relay/channel/openai/relay_responses.go"
  ],
  "servers": [
    {
      "url": "https://gateway.example.com",
      "description": "Example only; replace with your gateway origin and optional path prefix, without /v1."
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1/models": {
      "get": {
        "operationId": "listModels",
        "summary": "列出模型 / List models",
        "description": "仅记录常用接入字段；可选参数和行为取决于模型、渠道与部署配置。 / Documents common integration fields; optional parameters and behavior depend on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "模型列表；内部查询失败可能返回 success=false。 / Model list; internal lookup failure may return success=false.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Models"
                    },
                    {
                      "$ref": "#/components/schemas/ModelListFailure"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "value": {
                      "success": true,
                      "object": "list",
                      "data": [
                        {
                          "id": "YOUR_MODEL_ID",
                          "object": "model",
                          "created": 1700000000,
                          "owned_by": "example-provider"
                        }
                      ]
                    }
                  },
                  "failure": {
                    "value": {
                      "success": false,
                      "message": "get user group failed"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "operationId": "createChatCompletion",
        "summary": "创建对话 / Create chat completion",
        "description": "仅记录常用接入字段；可选参数和行为取决于模型、渠道与部署配置。 / Documents common integration fields; optional parameters and behavior depend on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "成功响应；stream=true 时返回 SSE，仍需检查终止事件。 / Successful response; stream=true returns SSE; still check terminal events.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatResponse"
                },
                "example": {
                  "id": "chatcmpl_example",
                  "object": "chat.completion",
                  "created": 1700000000,
                  "model": "YOUR_MODEL_ID",
                  "choices": [
                    {
                      "index": 0,
                      "message": {
                        "role": "assistant",
                        "content": "Hello!"
                      },
                      "finish_reason": "stop"
                    }
                  ],
                  "usage": {
                    "prompt_tokens": 12,
                    "completion_tokens": 3,
                    "total_tokens": 15
                  }
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "data: {\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello!\"},\"finish_reason\":null}]}\n\ndata: {\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n"
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              },
              "example": {
                "model": "YOUR_MODEL_ID",
                "messages": [
                  {
                    "role": "user",
                    "content": "Say hello in one short sentence."
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/v1/responses": {
      "post": {
        "operationId": "createResponse",
        "summary": "创建响应 / Create response",
        "description": "仅记录常用接入字段；可选参数和行为取决于模型、渠道与部署配置。 / Documents common integration fields; optional parameters and behavior depend on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "成功响应；stream=true 时返回 SSE，仍需检查终止事件。 / Successful response; stream=true returns SSE; still check terminal events.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResponse"
                },
                "example": {
                  "id": "resp_example",
                  "object": "response",
                  "created_at": 1700000000,
                  "model": "YOUR_MODEL_ID",
                  "status": "completed",
                  "output": [
                    {
                      "id": "msg_example",
                      "type": "message",
                      "role": "assistant",
                      "status": "completed",
                      "content": [
                        {
                          "type": "output_text",
                          "text": "Hello!",
                          "annotations": []
                        }
                      ]
                    }
                  ],
                  "error": null,
                  "incomplete_details": null,
                  "usage": {
                    "input_tokens": 12,
                    "output_tokens": 3,
                    "total_tokens": 15
                  }
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"delta\":\"Hello!\"}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"response\":{\"status\":\"completed\"}}\n\n"
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesRequest"
              },
              "example": {
                "model": "YOUR_MODEL_ID",
                "input": "Say hello in one short sentence."
              }
            }
          }
        }
      }
    },
    "/v1/images/generations": {
      "post": {
        "operationId": "POSTImagesGenerations",
        "summary": "生成图片 / Generate images",
        "description": "常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "图片结果 / Image result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResult"
                },
                "example": {
                  "created": 1700000000,
                  "data": [
                    {
                      "url": "https://cdn.example.com/image.png"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "等待任务超时；工作仍可能继续 / Timed out waiting; work may continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageGenerateRequest"
              }
            }
          }
        }
      }
    },
    "/v1/images/edits": {
      "post": {
        "operationId": "POSTImagesEdits",
        "summary": "编辑图片 / Edit images",
        "description": "常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "图片结果 / Image result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResult"
                },
                "example": {
                  "created": 1700000000,
                  "data": [
                    {
                      "url": "https://cdn.example.com/image.png"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "等待任务超时；工作仍可能继续 / Timed out waiting; work may continue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ImageEditMultipart"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageEditJSON"
              }
            }
          }
        }
      }
    },
    "/v1/audio/speech": {
      "post": {
        "operationId": "POSTAudioSpeech",
        "summary": "合成语音 / Generate speech",
        "description": "常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "音频字节；不能按 JSON 解析 / Audio bytes; do not parse as JSON",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "仅在所选渠道支持 SSE 时 / Only for channels supporting SSE"
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeechRequest"
              }
            }
          }
        }
      }
    },
    "/v1/audio/transcriptions": {
      "post": {
        "operationId": "POSTAudioTranscriptions",
        "summary": "转写音频 / Transcribe audio",
        "description": "常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "由 response_format 决定；示例为 json / Determined by response_format; example uses json",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/AudioText"
                    },
                    {
                      "$ref": "#/components/schemas/VerboseAudioText"
                    }
                  ]
                },
                "example": {
                  "text": "Hello."
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/vtt": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-subrip": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptionRequest"
              }
            }
          }
        }
      }
    },
    "/v1/audio/translations": {
      "post": {
        "operationId": "POSTAudioTranslations",
        "summary": "翻译音频 / Translate audio",
        "description": "常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "由 response_format 决定；示例为 json / Determined by response_format; example uses json",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/AudioText"
                    },
                    {
                      "$ref": "#/components/schemas/VerboseAudioText"
                    }
                  ]
                },
                "example": {
                  "text": "Hello."
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/vtt": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-subrip": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/TranslationRequest"
              }
            }
          }
        }
      }
    },
    "/v1/videos": {
      "post": {
        "operationId": "POSTVideosCreate",
        "summary": "创建视频任务 / Create video task",
        "description": "常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "接受任务，不代表生成完成 / Task accepted, not necessarily completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Video"
                },
                "example": {
                  "id": "task_example",
                  "object": "video",
                  "model": "YOUR_MODEL_ID",
                  "status": "queued",
                  "progress": 0,
                  "created_at": 1700000000
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request"
          },
          "401": {
            "description": "身份校验失败 / Authentication failed"
          },
          "403": {
            "description": "访问被拒绝 / Access denied"
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found"
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction"
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error"
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable"
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary"
          },
          "410": {
            "description": "内容已不可用 / Content no longer available"
          },
          "502": {
            "description": "内容代理或上游失败 / Content proxy or upstream failure"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/VideoCreateMultipart"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoCreateJSON"
              }
            }
          }
        }
      }
    },
    "/v1/videos/{task_id}": {
      "get": {
        "operationId": "GETVideosRetrieve",
        "summary": "查询视频任务 / Retrieve video task",
        "description": "常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "任务快照，可能尚未更新到最新上游状态 / Task snapshot; may lag upstream state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Video"
                },
                "example": {
                  "id": "task_example",
                  "object": "video",
                  "model": "YOUR_MODEL_ID",
                  "status": "queued",
                  "progress": 0,
                  "created_at": 1700000000
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request"
          },
          "401": {
            "description": "身份校验失败 / Authentication failed"
          },
          "403": {
            "description": "访问被拒绝 / Access denied"
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found"
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction"
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error"
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable"
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary"
          },
          "410": {
            "description": "内容已不可用 / Content no longer available"
          },
          "502": {
            "description": "内容代理或上游失败 / Content proxy or upstream failure"
          }
        },
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "同一用户/项目范围内的网关公开 ID / Public gateway ID in the same user/project scope"
          }
        ]
      }
    },
    "/v1/videos/{task_id}/content": {
      "get": {
        "operationId": "GETVideosContent",
        "summary": "下载视频 / Download video",
        "description": "常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "视频二进制；先检查 HTTP 状态 / Video bytes; check HTTP status first",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request"
          },
          "401": {
            "description": "身份校验失败 / Authentication failed"
          },
          "403": {
            "description": "访问被拒绝 / Access denied"
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found"
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction"
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error"
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable"
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary"
          },
          "410": {
            "description": "内容已不可用 / Content no longer available"
          },
          "502": {
            "description": "内容代理或上游失败 / Content proxy or upstream failure"
          },
          "206": {
            "description": "部分字节；依赖内容源支持 / Partial bytes when supported",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "416": {
            "description": "字节范围不可满足 / Unsatisfiable byte range"
          }
        },
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "同一用户/项目范围内的网关公开 ID / Public gateway ID in the same user/project scope"
          },
          {
            "name": "Range",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "单段字节范围，支持情况由内容源决定 / Single byte range when supported by the content source",
            "example": "bytes=0-1023"
          }
        ]
      },
      "head": {
        "operationId": "HEADVideosContentHead",
        "summary": "检查视频内容 / Inspect video content",
        "description": "常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "只有响应头，没有响应体；头部可用性取决于内容源 / Headers only, no body; header availability depends on content source",
            "headers": {
              "Content-Type": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request"
          },
          "401": {
            "description": "身份校验失败 / Authentication failed"
          },
          "403": {
            "description": "访问被拒绝 / Access denied"
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found"
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction"
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error"
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable"
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary"
          },
          "410": {
            "description": "内容已不可用 / Content no longer available"
          },
          "502": {
            "description": "内容代理或上游失败 / Content proxy or upstream failure"
          }
        },
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "同一用户/项目范围内的网关公开 ID / Public gateway ID in the same user/project scope"
          }
        ]
      }
    },
    "/v1/videos/{video_id}/remix": {
      "post": {
        "operationId": "POSTVideosRemix",
        "summary": "重混视频 / Remix video",
        "description": "常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on the model, channel, and deployment.",
        "responses": {
          "200": {
            "description": "新任务的提交摘要；后续用 GET 查询 / Submission summary for a new task; use GET afterward",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoSubmission"
                },
                "example": {
                  "id": "task_remix_example",
                  "task_id": "task_remix_example",
                  "status": "queued",
                  "model": "YOUR_MODEL_ID",
                  "created_at": 1700000000
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request"
          },
          "401": {
            "description": "身份校验失败 / Authentication failed"
          },
          "403": {
            "description": "访问被拒绝 / Access denied"
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found"
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction"
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error"
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable"
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary"
          },
          "410": {
            "description": "内容已不可用 / Content no longer available"
          },
          "502": {
            "description": "内容代理或上游失败 / Content proxy or upstream failure"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRemixRequest"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "video_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "同一用户/项目范围内的网关公开 ID / Public gateway ID in the same user/project scope"
          }
        ]
      }
    },
    "/v1/embeddings": {
      "post": {
        "operationId": "createEmbeddings",
        "summary": "生成文本向量 / Create text embeddings",
        "description": "同步 JSON 接口，模型和渠道决定可选参数支持情况 / Synchronous JSON endpoint; model and channel determine optional parameter support",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功结构；仍需校验索引与实际数值，示例向量维度和分数仅作结构演示 / Success shape; validate indices and values; example vector dimensions and scores are illustrative",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingResult"
                },
                "example": {
                  "object": "list",
                  "model": "YOUR_MODEL_ID",
                  "data": [
                    {
                      "object": "embedding",
                      "index": 0,
                      "embedding": [
                        0.6,
                        0.8
                      ]
                    }
                  ],
                  "usage": {
                    "prompt_tokens": 2,
                    "total_tokens": 2
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rerank": {
      "post": {
        "operationId": "rerankDocuments",
        "summary": "重排候选文档 / Rerank candidate documents",
        "description": "同步 JSON 接口，模型和渠道决定可选参数支持情况 / Synchronous JSON endpoint; model and channel determine optional parameter support",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RerankRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功结构；仍需校验索引与实际数值，示例向量维度和分数仅作结构演示 / Success shape; validate indices and values; example vector dimensions and scores are illustrative",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RerankResult"
                },
                "example": {
                  "results": [
                    {
                      "index": 1,
                      "relevance_score": 0.91
                    },
                    {
                      "index": 0,
                      "relevance_score": 0.12
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/messages": {
      "post": {
        "operationId": "createClaudeMessage",
        "summary": "Claude 原生消息 / Native Claude message",
        "description": "精选文本接入字段；允许扩展字段不代表所有渠道支持。原生流式和工具扩展见指南。 / Selected text integration fields; accepting extensions does not guarantee channel support. See the guide for native streaming and tool boundaries.",
        "x-source-revision": "d851a5faa49a00abaafd27bf91b311506fbfbc52",
        "x-source-files": [
          "router/relay-router.go",
          "middleware/auth.go",
          "middleware/distributor.go",
          "relay/helper/valid_request.go",
          "relaykit/dto/claude.go",
          "relay/channel/claude/adaptor.go"
        ],
        "security": [
          {
            "ClaudeApiKey": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "anthropic-version",
            "in": "header",
            "required": false,
            "description": "适配器缺省版本；建议显式发送 / Adapter fallback version; send explicitly.",
            "schema": {
              "type": "string",
              "default": "2023-06-01"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "minLength": 1,
                    "example": "YOUR_MODEL_ID"
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1073741823,
                    "example": 256,
                    "description": "输出预算，实际范围依赖模型；调用原生供应商时应显式设置 / Output budget; model limits apply. Set explicitly for native provider requests."
                  },
                  "system": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "type"
                          ],
                          "properties": {
                            "type": {
                              "type": "string"
                            },
                            "text": {
                              "type": "string"
                            },
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "input": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "tool_use_id": {
                              "type": "string"
                            },
                            "content": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "additionalProperties": true
                                  }
                                }
                              ]
                            },
                            "thinking": {
                              "type": "string"
                            },
                            "signature": {
                              "type": "string"
                            },
                            "data": {
                              "type": "string"
                            },
                            "is_error": {
                              "type": "boolean"
                            },
                            "cache_control": {
                              "type": "object",
                              "description": "内容块缓存标记；具体支持取决于模型与渠道 / Content-block cache marker; model and channel dependent",
                              "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                              "additionalProperties": true
                            }
                          },
                          "additionalProperties": true
                        }
                      }
                    ]
                  },
                  "messages": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "type"
                                ],
                                "properties": {
                                  "type": {
                                    "type": "string"
                                  },
                                  "text": {
                                    "type": "string"
                                  },
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "input": {
                                    "type": "object",
                                    "additionalProperties": true
                                  },
                                  "tool_use_id": {
                                    "type": "string"
                                  },
                                  "content": {
                                    "oneOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "additionalProperties": true
                                        }
                                      }
                                    ]
                                  },
                                  "thinking": {
                                    "type": "string"
                                  },
                                  "signature": {
                                    "type": "string"
                                  },
                                  "data": {
                                    "type": "string"
                                  },
                                  "is_error": {
                                    "type": "boolean"
                                  },
                                  "cache_control": {
                                    "type": "object",
                                    "description": "内容块缓存标记；具体支持取决于模型与渠道 / Content-block cache marker; model and channel dependent",
                                    "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                                    "additionalProperties": true
                                  }
                                },
                                "additionalProperties": true
                              }
                            }
                          ]
                        }
                      }
                    }
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "input_schema"
                      ],
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "input_schema": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "工具参数 Schema；示例额外执行本地校验 / Tool parameter schema; examples also validate locally."
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "cache_control": {
                    "type": "object",
                    "description": "原生缓存控制；依赖渠道，TTL 与断点限制不能跨供应商假定一致 / Native cache control; channel dependent, TTL and breakpoint limits vary",
                    "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                    "additionalProperties": true,
                    "example": {
                      "type": "ephemeral"
                    }
                  },
                  "thinking": {
                    "type": "object",
                    "description": "原生推理配置；模式与预算由目标模型决定 / Native reasoning configuration; target model determines modes and budgets",
                    "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                    "additionalProperties": true
                  },
                  "output_config": {
                    "type": "object",
                    "description": "原生输出配置，包含条件支持的 effort / Native output configuration, including conditional effort support",
                    "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                    "additionalProperties": true
                  },
                  "context_management": {
                    "type": "object",
                    "description": "Claude 专用上下文编辑对象；Claude 转 Responses 不直接复制 / Claude-specific context editing; not copied directly into Responses",
                    "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                    "additionalProperties": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "检查原生完成状态及内容 / Check native completion status and content.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "stop_reason": {
                      "type": "string",
                      "nullable": true
                    },
                    "content": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "input": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "tool_use_id": {
                            "type": "string"
                          },
                          "content": {
                            "oneOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "additionalProperties": true
                                }
                              }
                            ]
                          },
                          "thinking": {
                            "type": "string"
                          },
                          "signature": {
                            "type": "string"
                          },
                          "data": {
                            "type": "string"
                          },
                          "is_error": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "usage": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "cache_read_input_tokens": {
                          "type": "integer",
                          "description": "原生缓存读数；可能缺失 / Native cache reads; may be absent",
                          "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                          "minimum": 0
                        },
                        "cache_creation_input_tokens": {
                          "type": "integer",
                          "description": "原生缓存写入读数；可能缺失 / Native cache writes; may be absent",
                          "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                          "minimum": 0
                        }
                      }
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "type": "message",
                  "id": "msg_example",
                  "role": "assistant",
                  "stop_reason": "end_turn",
                  "content": [
                    {
                      "type": "text",
                      "text": "Hello."
                    }
                  ]
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
              }
            }
          },
          "default": {
            "description": "网关或上游错误，结构可能随协议变化 / Gateway or upstream error; structure may vary by protocol.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1beta/models/{model}:generateContent": {
      "post": {
        "operationId": "generateGeminiContent",
        "summary": "Gemini 原生生成 / Native Gemini generation",
        "description": "精选文本接入字段；允许扩展字段不代表所有渠道支持。原生流式和工具扩展见指南。 / Selected text integration fields; accepting extensions does not guarantee channel support. See the guide for native streaming and tool boundaries.",
        "x-source-revision": "d851a5faa49a00abaafd27bf91b311506fbfbc52",
        "x-source-files": [
          "router/relay-router.go",
          "middleware/auth.go",
          "middleware/distributor.go",
          "relay/helper/valid_request.go",
          "relaykit/dto/gemini.go",
          "relay/channel/gemini/adaptor.go",
          "relay/channel/gemini/relay-gemini-native.go"
        ],
        "security": [
          {
            "GeminiApiKey": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "description": "裸模型 ID，不含 models/ 和动作后缀 / Bare model ID without models/ or an action suffix.",
            "schema": {
              "type": "string",
              "example": "YOUR_MODEL_ID"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "contents"
                ],
                "properties": {
                  "contents": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "string"
                              },
                              "thought": {
                                "type": "boolean"
                              },
                              "thoughtSignature": {
                                "type": "string"
                              },
                              "functionCall": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "args": {
                                    "type": "object",
                                    "additionalProperties": true
                                  }
                                },
                                "additionalProperties": true
                              },
                              "functionResponse": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "response": {
                                    "type": "object",
                                    "additionalProperties": true
                                  }
                                },
                                "additionalProperties": true
                              },
                              "inlineData": {
                                "type": "object",
                                "required": [
                                  "mimeType",
                                  "data"
                                ],
                                "properties": {
                                  "mimeType": {
                                    "type": "string",
                                    "example": "video/mp4"
                                  },
                                  "data": {
                                    "type": "string",
                                    "description": "纯 Base64，不带 Data URL 前缀 / Plain Base64, no Data URL prefix"
                                  }
                                },
                                "description": "原生内联媒体，格式与大小依模型 / Native inline media; model-dependent formats and limits"
                              },
                              "fileData": {
                                "type": "object",
                                "properties": {
                                  "mimeType": {
                                    "type": "string"
                                  },
                                  "fileUri": {
                                    "type": "string"
                                  }
                                },
                                "description": "上游可访问的 URI；不是网关上传服务 / Upstream-accessible URI, not a gateway upload service"
                              },
                              "videoMetadata": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "模型依赖的原生扩展；请核对实际上游结构 / Model-dependent native extension; verify the upstream structure"
                              },
                              "mediaResolution": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "模型依赖的原生扩展；请核对实际上游结构 / Model-dependent native extension; verify the upstream structure"
                              },
                              "executableCode": {
                                "type": "object",
                                "properties": {
                                  "language": {
                                    "type": "string",
                                    "example": "PYTHON"
                                  },
                                  "code": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": true
                              },
                              "codeExecutionResult": {
                                "type": "object",
                                "properties": {
                                  "outcome": {
                                    "type": "string",
                                    "description": "检查 OUTCOME_OK / Check OUTCOME_OK"
                                  },
                                  "output": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": true
                              }
                            },
                            "additionalProperties": true
                          }
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "systemInstruction": {
                    "type": "object",
                    "properties": {
                      "role": {
                        "type": "string"
                      },
                      "parts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string"
                            },
                            "thought": {
                              "type": "boolean"
                            },
                            "thoughtSignature": {
                              "type": "string"
                            },
                            "functionCall": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "args": {
                                  "type": "object",
                                  "additionalProperties": true
                                }
                              },
                              "additionalProperties": true
                            },
                            "functionResponse": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "response": {
                                  "type": "object",
                                  "additionalProperties": true
                                }
                              },
                              "additionalProperties": true
                            }
                          },
                          "additionalProperties": true
                        }
                      }
                    },
                    "additionalProperties": true
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "functionDeclarations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name"
                            ],
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "parameters": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "工具参数 Schema；示例额外执行本地校验 / Tool parameter schema; examples also validate locally."
                              }
                            },
                            "additionalProperties": true
                          }
                        },
                        "googleSearch": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "以空对象启用；依赖原生模型及渠道支持 / Enable with an empty object; native model and channel support required",
                          "example": {}
                        },
                        "urlContext": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "以空对象启用；依赖原生模型及渠道支持 / Enable with an empty object; native model and channel support required",
                          "example": {}
                        },
                        "codeExecution": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "以空对象启用；依赖原生模型及渠道支持 / Enable with an empty object; native model and channel support required",
                          "example": {}
                        }
                      },
                      "additionalProperties": true
                    }
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "检查原生完成状态及内容 / Check native completion status and content.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "candidates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "content": {
                            "type": "object",
                            "properties": {
                              "role": {
                                "type": "string"
                              },
                              "parts": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "text": {
                                      "type": "string"
                                    },
                                    "thought": {
                                      "type": "boolean"
                                    },
                                    "thoughtSignature": {
                                      "type": "string"
                                    },
                                    "functionCall": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": "string"
                                        },
                                        "args": {
                                          "type": "object",
                                          "additionalProperties": true
                                        }
                                      },
                                      "additionalProperties": true
                                    },
                                    "functionResponse": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": "string"
                                        },
                                        "response": {
                                          "type": "object",
                                          "additionalProperties": true
                                        }
                                      },
                                      "additionalProperties": true
                                    },
                                    "executableCode": {
                                      "type": "object",
                                      "properties": {
                                        "language": {
                                          "type": "string",
                                          "example": "PYTHON"
                                        },
                                        "code": {
                                          "type": "string"
                                        }
                                      },
                                      "additionalProperties": true
                                    },
                                    "codeExecutionResult": {
                                      "type": "object",
                                      "properties": {
                                        "outcome": {
                                          "type": "string",
                                          "description": "检查 OUTCOME_OK / Check OUTCOME_OK"
                                        },
                                        "output": {
                                          "type": "string"
                                        }
                                      },
                                      "additionalProperties": true
                                    }
                                  },
                                  "additionalProperties": true
                                }
                              }
                            },
                            "additionalProperties": true
                          },
                          "finishReason": {
                            "type": "string"
                          },
                          "groundingMetadata": {
                            "type": "object",
                            "additionalProperties": true,
                            "properties": {
                              "groundingChunks": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "additionalProperties": true
                                }
                              },
                              "groundingSupports": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "additionalProperties": true
                                }
                              },
                              "searchEntryPoint": {
                                "type": "object",
                                "additionalProperties": true
                              }
                            },
                            "description": "保留来源与原始 part 的关联；片段偏移为 UTF-8 字节 / Preserve source and original part association; segment offsets are UTF-8 bytes"
                          },
                          "urlContextMetadata": {
                            "type": "object",
                            "additionalProperties": true,
                            "properties": {
                              "urlMetadata": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "retrievedUrl": {
                                      "type": "string"
                                    },
                                    "urlRetrievalStatus": {
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            },
                            "description": "原生响应中的读取状态，HTTP 成功不代表读取成功 / Native retrieval status; HTTP success does not establish retrieval success"
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "promptFeedback": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "usageMetadata": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "candidates": [
                    {
                      "index": 0,
                      "finishReason": "STOP",
                      "content": {
                        "role": "model",
                        "parts": [
                          {
                            "text": "Hello."
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "网关或上游错误，结构可能随协议变化 / Gateway or upstream error; structure may vary by protocol.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-native-tools-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d"
      }
    },
    "/v1beta/models/{model}:streamGenerateContent": {
      "post": {
        "operationId": "streamGeminiContent",
        "summary": "Gemini 原生流式生成 / Native Gemini streaming generation",
        "description": "原生 SSE；每个 data 包含 Gemini 响应对象。完成状态与工具处理见指南。 / Native SSE; each data payload is a Gemini response object. See the guide for completion and tool handling.",
        "x-source-revision": "d851a5faa49a00abaafd27bf91b311506fbfbc52",
        "x-source-files": [
          "router/relay-router.go",
          "middleware/auth.go",
          "middleware/distributor.go",
          "relay/helper/valid_request.go",
          "relaykit/dto/gemini.go",
          "relay/channel/gemini/adaptor.go",
          "relay/channel/gemini/relay-gemini-native.go"
        ],
        "security": [
          {
            "GeminiApiKey": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "description": "裸模型 ID，不含 models/ 和动作后缀 / Bare model ID without models/ or an action suffix.",
            "schema": {
              "type": "string",
              "example": "YOUR_MODEL_ID"
            }
          },
          {
            "name": "alt",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "sse"
              ]
            },
            "description": "选择 SSE 传输 / Select SSE transport."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "contents"
                ],
                "properties": {
                  "contents": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "string"
                              },
                              "thought": {
                                "type": "boolean"
                              },
                              "thoughtSignature": {
                                "type": "string"
                              },
                              "functionCall": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "args": {
                                    "type": "object",
                                    "additionalProperties": true
                                  }
                                },
                                "additionalProperties": true
                              },
                              "functionResponse": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "response": {
                                    "type": "object",
                                    "additionalProperties": true
                                  }
                                },
                                "additionalProperties": true
                              },
                              "inlineData": {
                                "type": "object",
                                "required": [
                                  "mimeType",
                                  "data"
                                ],
                                "properties": {
                                  "mimeType": {
                                    "type": "string",
                                    "example": "video/mp4"
                                  },
                                  "data": {
                                    "type": "string",
                                    "description": "纯 Base64，不带 Data URL 前缀 / Plain Base64, no Data URL prefix"
                                  }
                                },
                                "description": "原生内联媒体，格式与大小依模型 / Native inline media; model-dependent formats and limits"
                              },
                              "fileData": {
                                "type": "object",
                                "properties": {
                                  "mimeType": {
                                    "type": "string"
                                  },
                                  "fileUri": {
                                    "type": "string"
                                  }
                                },
                                "description": "上游可访问的 URI；不是网关上传服务 / Upstream-accessible URI, not a gateway upload service"
                              },
                              "videoMetadata": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "模型依赖的原生扩展；请核对实际上游结构 / Model-dependent native extension; verify the upstream structure"
                              },
                              "mediaResolution": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "模型依赖的原生扩展；请核对实际上游结构 / Model-dependent native extension; verify the upstream structure"
                              },
                              "executableCode": {
                                "type": "object",
                                "properties": {
                                  "language": {
                                    "type": "string",
                                    "example": "PYTHON"
                                  },
                                  "code": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": true
                              },
                              "codeExecutionResult": {
                                "type": "object",
                                "properties": {
                                  "outcome": {
                                    "type": "string",
                                    "description": "检查 OUTCOME_OK / Check OUTCOME_OK"
                                  },
                                  "output": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": true
                              }
                            },
                            "additionalProperties": true
                          }
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "systemInstruction": {
                    "type": "object",
                    "properties": {
                      "role": {
                        "type": "string"
                      },
                      "parts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string"
                            },
                            "thought": {
                              "type": "boolean"
                            },
                            "thoughtSignature": {
                              "type": "string"
                            },
                            "functionCall": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "args": {
                                  "type": "object",
                                  "additionalProperties": true
                                }
                              },
                              "additionalProperties": true
                            },
                            "functionResponse": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "response": {
                                  "type": "object",
                                  "additionalProperties": true
                                }
                              },
                              "additionalProperties": true
                            }
                          },
                          "additionalProperties": true
                        }
                      }
                    },
                    "additionalProperties": true
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "functionDeclarations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name"
                            ],
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "parameters": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "工具参数 Schema；示例额外执行本地校验 / Tool parameter schema; examples also validate locally."
                              }
                            },
                            "additionalProperties": true
                          }
                        },
                        "googleSearch": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "以空对象启用；依赖原生模型及渠道支持 / Enable with an empty object; native model and channel support required",
                          "example": {}
                        },
                        "urlContext": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "以空对象启用；依赖原生模型及渠道支持 / Enable with an empty object; native model and channel support required",
                          "example": {}
                        },
                        "codeExecution": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "以空对象启用；依赖原生模型及渠道支持 / Enable with an empty object; native model and channel support required",
                          "example": {}
                        }
                      },
                      "additionalProperties": true
                    }
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "检查候选结束状态并处理流内错误 / Validate candidate finish status and in-stream errors.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "网关或上游错误，结构可能随协议变化 / Gateway or upstream error; structure may vary by protocol.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-native-tools-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d"
      }
    },
    "/v1/moderations": {
      "post": {
        "operationId": "createModeration",
        "summary": "内容审核 / Moderate content",
        "description": "精选文本审核契约；ForceFormat 可能移除 results，必须确认渠道设置 / Curated text moderation contract; ForceFormat may remove results, so confirm channel settings",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/relay-router.go",
          "relay/helper/valid_request.go",
          "relaykit/dto/openai_request.go",
          "relay/channel/openai/relay-openai.go"
        ],
        "responses": {
          "200": {
            "description": "成功结构仍需检查业务字段 / Check business fields even on HTTP success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationResult"
                },
                "example": {
                  "id": "mod_example",
                  "model": "YOUR_MODEL_ID",
                  "results": [
                    {
                      "flagged": false,
                      "categories": {
                        "violence": false
                      },
                      "category_scores": {
                        "violence": 0.01
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModerationRequest"
              }
            }
          }
        }
      }
    },
    "/v1/responses/compact": {
      "post": {
        "operationId": "compactResponses",
        "summary": "压缩上下文 / Compact context",
        "description": "需验证模型、渠道及部署支持 / Verify model, channel, and deployment support",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/relay-router.go",
          "relay/helper/valid_request.go",
          "relaykit/dto/openai_responses_compaction_request.go",
          "relaykit/dto/openai_compaction.go",
          "relay/channel/openai/relay_responses_compact.go"
        ],
        "responses": {
          "200": {
            "description": "成功结构仍需检查业务字段 / Check business fields even on HTTP success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompactionResult"
                },
                "example": {
                  "id": "cmp_example",
                  "object": "response.compaction",
                  "created_at": 1700000000,
                  "output": [
                    {
                      "type": "message",
                      "role": "user",
                      "content": [
                        {
                          "type": "input_text",
                          "text": "Plan a two-day visit."
                        }
                      ]
                    },
                    {
                      "type": "compaction",
                      "id": "cmp_item",
                      "encrypted_content": "OPAQUE_STATE_FROM_UPSTREAM"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompactionRequest"
              }
            }
          }
        }
      }
    },
    "/v1/models/{model}": {
      "get": {
        "operationId": "retrieveModel",
        "summary": "查询模型 / Retrieve model",
        "description": "仅记录 Bearer / OpenAI 格式；不可见模型可能 HTTP 200 + error.code=model_not_found / Bearer / OpenAI format only; unavailable models may return HTTP 200 with error.code=model_not_found",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/relay-router.go",
          "controller/model.go",
          "relaykit/dto/pricing.go"
        ],
        "responses": {
          "200": {
            "description": "成功结构仍需检查业务字段 / Check business fields even on HTTP success",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Model"
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Error"
                        },
                        {
                          "type": "object",
                          "required": [
                            "error"
                          ]
                        }
                      ]
                    }
                  ]
                },
                "example": {
                  "id": "YOUR_MODEL_ID",
                  "object": "model",
                  "created": 1626777600,
                  "owned_by": "example-provider"
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "经过 URL 编码的完整标识 / Complete URL-encoded identifier"
          }
        ]
      }
    },
    "/v1/responses/{response_id}": {
      "get": {
        "operationId": "retrieveTaskResponse",
        "summary": "查询插件任务响应 / Retrieve a plugin task response",
        "description": "仅查询同一用户和项目内、结果未丢弃的宿主插件任务；不代理普通上游检索 / Only retained host plugin tasks within the same user and project; not ordinary upstream retrieval",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/task-plugin-protocol-router.go",
          "pkg/jsplugin/routing.go",
          "controller/plugin_protocol.go",
          "relay/plugin_protocol.go",
          "model/task.go"
        ],
        "responses": {
          "200": {
            "description": "成功结构仍需检查业务字段 / Check business fields even on HTTP success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResponse"
                },
                "example": {
                  "id": "resp_example",
                  "object": "response",
                  "created_at": 1700000000,
                  "model": "YOUR_MODEL_ID",
                  "status": "queued",
                  "background": true,
                  "output": [],
                  "error": null,
                  "usage": null
                }
              }
            }
          },
          "400": {
            "description": "请求参数错误 / Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "身份校验失败 / Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "访问被拒绝 / Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口或资源不存在 / Endpoint or resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "请求被限流或受配额限制 / Rate or quota restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "网关或上游错误 / Gateway or upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用 / Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "response_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "经过 URL 编码的完整标识 / Complete URL-encoded identifier"
          }
        ]
      }
    },
    "/v1/completions": {
      "post": {
        "operationId": "completions",
        "summary": "创建文本补全 / Create a text completion",
        "description": "发送明确模型和文本 `prompt`，可用 `stream` 选择 SSE。本规范限定单条文本、单个输出。 / Send an explicit model and text `prompt`; `stream` selects SSE. This contract limits the example to one text prompt and one output.",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/relay-router.go",
          "relay/helper/valid_request.go",
          "relaykit/dto/openai_request.go"
        ],
        "responses": {
          "200": {
            "description": "读取业务字段，不只检查 HTTP 状态 / Validate business fields, not only HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "text": {
                            "type": "string"
                          },
                          "finish_reason": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true,
                        "required": [
                          "index",
                          "text",
                          "finish_reason"
                        ]
                      }
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "choices"
                  ]
                },
                "example": {
                  "id": "cmpl_example",
                  "object": "text_completion",
                  "created": 1700000000,
                  "model": "YOUR_MODEL_ID",
                  "choices": [
                    {
                      "index": 0,
                      "text": " explain completion states.",
                      "finish_reason": "stop"
                    }
                  ]
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "data: {\"choices\":[{\"index\":0,\"text\":\"Hello\",\"finish_reason\":null}]}\n\ndata: {\"choices\":[{\"index\":0,\"text\":\"\",\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n\n"
              }
            }
          },
          "default": {
            "description": "错误格式与状态取决于入口 / Error status and shape depend on the entry."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "stream": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": true,
                "required": [
                  "model",
                  "prompt"
                ]
              }
            }
          }
        }
      }
    },
    "/v1beta/models/{model}:embedContent": {
      "post": {
        "operationId": "gemini_embed",
        "summary": "Gemini 单条向量 / Gemini single embedding",
        "description": "发送 `content.parts`，每个文本 part 使用 `text`；返回 `embedding.values`。 / Send `content.parts` with text parts; read `embedding.values`.",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/relay-router.go",
          "relaykit/dto/gemini.go",
          "relay/gemini_handler.go",
          "relay/channel/gemini/relay-gemini-native.go"
        ],
        "responses": {
          "200": {
            "description": "读取业务字段，不只检查 HTTP 状态 / Validate business fields, not only HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "embedding": {
                      "type": "object",
                      "properties": {
                        "values": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        }
                      },
                      "additionalProperties": true,
                      "required": [
                        "values"
                      ]
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "embedding"
                  ]
                },
                "example": {
                  "embedding": {
                    "values": [
                      0.1,
                      0.2
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误格式与状态取决于入口 / Error status and shape depend on the entry."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "models/ 前缀的模型名 / Model name prefixed with models/"
                  },
                  "content": {
                    "type": "object",
                    "properties": {
                      "parts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true,
                          "required": [
                            "text"
                          ]
                        }
                      }
                    },
                    "additionalProperties": true,
                    "required": [
                      "parts"
                    ]
                  },
                  "taskType": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "outputDimensionality": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "additionalProperties": true,
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "GeminiApiKey": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1beta/models/{model}:batchEmbedContents": {
      "post": {
        "operationId": "gemini_batch_embed",
        "summary": "Gemini 同步批量向量 / Gemini synchronous batch embeddings",
        "description": "发送 `requests` 数组，每项包含 `model` 和 `content.parts`，同一请求使用相同模型。返回 `embeddings[].values`，按输入顺序关联。 / Send `requests`, each with `model` and `content.parts`, using one model per batch. Associate `embeddings[].values` with inputs in order. 当前版本要求路径模型名含小写 embed，详见指南 / This revision requires lowercase embed in the path model name; see the guide.",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/relay-router.go",
          "relaykit/dto/gemini.go",
          "relay/gemini_handler.go",
          "relay/channel/gemini/relay-gemini-native.go"
        ],
        "responses": {
          "200": {
            "description": "读取业务字段，不只检查 HTTP 状态 / Validate business fields, not only HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "embeddings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "values": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          }
                        },
                        "additionalProperties": true,
                        "required": [
                          "values"
                        ]
                      }
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "embeddings"
                  ]
                },
                "example": {
                  "embeddings": [
                    {
                      "values": [
                        0.1,
                        0.2
                      ]
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "错误格式与状态取决于入口 / Error status and shape depend on the entry."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "requests": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "model": {
                          "type": "string",
                          "description": "models/ 前缀的模型名 / Model name prefixed with models/"
                        },
                        "content": {
                          "type": "object",
                          "properties": {
                            "parts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "text": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": true,
                                "required": [
                                  "text"
                                ]
                              }
                            }
                          },
                          "additionalProperties": true,
                          "required": [
                            "parts"
                          ]
                        },
                        "taskType": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "outputDimensionality": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": true,
                      "required": [
                        "content"
                      ]
                    }
                  }
                },
                "additionalProperties": true,
                "required": [
                  "requests"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "GeminiApiKey": []
          },
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/tasks/{key}": {
      "post": {
        "operationId": "tasks_submit",
        "summary": "提交通用插件任务 / Submit a generic plugin task",
        "description": "路径 `key` 是已启用插件 key；JSON 必须含 `model`，其他字段为插件的规范化请求格式。不是任意供应商原生 body 的透明转发。 / Path `key` is an enabled plugin key. JSON requires `model`; other fields follow the plugin normalized request format, not arbitrary native provider payloads.",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/task-router.go",
          "controller/task.go",
          "controller/relay.go",
          "middleware/task_plugin.go"
        ],
        "responses": {
          "200": {
            "description": "读取业务字段，不只检查 HTTP 状态 / Validate business fields, not only HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "task_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "id",
                    "task_id",
                    "status"
                  ]
                },
                "example": {
                  "id": "task_example",
                  "task_id": "task_example",
                  "status": "queued",
                  "model": "YOUR_MODEL_ID",
                  "created_at": 1700000000
                }
              }
            }
          },
          "default": {
            "description": "错误格式与状态取决于入口 / Error status and shape depend on the entry."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  }
                },
                "additionalProperties": true,
                "required": [
                  "model"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "get": {
        "operationId": "tasks_retrieve",
        "summary": "查询通用任务 / Retrieve a task",
        "description": "读取保存的任务状态，即使结果已丢弃也可能可读 / Read persisted task state, which can remain accessible even if results were discarded.",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/task-router.go",
          "controller/task.go",
          "controller/relay.go",
          "middleware/task_plugin.go"
        ],
        "responses": {
          "200": {
            "description": "读取业务字段，不只检查 HTTP 状态 / Validate business fields, not only HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "task_id": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "NOT_START",
                        "SUBMITTED",
                        "QUEUED",
                        "IN_PROGRESS",
                        "SUCCESS",
                        "FAILURE",
                        "NEEDS_REVIEW",
                        "UNKNOWN"
                      ]
                    },
                    "progress": {
                      "type": "string"
                    },
                    "fail_reason": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "integer"
                    },
                    "finished_at": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "task_id",
                    "status"
                  ]
                },
                "example": {
                  "task_id": "task_example",
                  "platform": "example",
                  "status": "IN_PROGRESS",
                  "progress": "50%",
                  "fail_reason": "",
                  "created_at": 1700000000,
                  "finished_at": 0
                }
              }
            }
          },
          "default": {
            "description": "错误格式与状态取决于入口 / Error status and shape depend on the entry."
          }
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tasks/{key}/artifacts": {
      "get": {
        "operationId": "task_artifacts",
        "summary": "列出任务产物 / List task artifacts",
        "description": "`key` 是公开任务 ID。返回 `task_id` 与 `artifacts` 数组，元素含 `key`、`type`、可选 `mime_type` 与 `content_url`。 / `key` is the public task ID. Read `task_id` and `artifacts`, whose entries contain `key`, `type`, optional `mime_type`, and `content_url`.",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/task-router.go",
          "controller/task.go",
          "controller/relay.go",
          "middleware/task_plugin.go"
        ],
        "responses": {
          "200": {
            "description": "读取业务字段，不只检查 HTTP 状态 / Validate business fields, not only HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "task_id": {
                      "type": "string"
                    },
                    "artifacts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "image",
                              "audio",
                              "video",
                              "file"
                            ]
                          },
                          "mime_type": {
                            "type": "string"
                          },
                          "content_url": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true,
                        "required": [
                          "key",
                          "type",
                          "content_url"
                        ]
                      }
                    },
                    "legacy_content_url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "task_id",
                    "artifacts"
                  ]
                },
                "example": {
                  "task_id": "task_example",
                  "artifacts": [
                    {
                      "key": "video",
                      "type": "video",
                      "mime_type": "video/mp4",
                      "content_url": "https://gateway.example.com/v1/tasks/task_example/artifacts/video/content"
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "错误格式与状态取决于入口 / Error status and shape depend on the entry."
          }
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tasks/{key}/artifacts/{artifact_key}/content": {
      "get": {
        "operationId": "task_artifact_content",
        "summary": "下载任务产物 / Download task artifact",
        "description": "`key` 是任务 ID，`artifact_key` 取自列表。请求需具备该任务访问权限；服务生成的临时访问 URL 是另一种受限访问方式，客户端不要自行构造签名。 / `key` is the task ID; select `artifact_key` from the listing. Task access is required. Server-generated temporary URLs provide a separate scoped access mechanism; clients must not invent signatures.",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/task-router.go",
          "controller/task.go",
          "controller/relay.go",
          "middleware/task_plugin.go"
        ],
        "responses": {
          "200": {
            "description": "完整内容或 HEAD 头 / Complete content or HEAD headers",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "部分内容 / Partial content",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "未修改 / Not modified"
          },
          "404": {
            "description": "未找到 / Not found"
          },
          "409": {
            "description": "未就绪 / Not ready"
          },
          "416": {
            "description": "范围无效 / Invalid range"
          },
          "503": {
            "description": "插件不可用 / Plugin unavailable"
          }
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artifact_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Range",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Modified-Since",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "head": {
        "operationId": "task_artifact_head",
        "summary": "检查任务产物 / Inspect task artifact",
        "description": "`key` 是任务 ID，`artifact_key` 取自列表。请求需具备该任务访问权限；服务生成的临时访问 URL 是另一种受限访问方式，客户端不要自行构造签名。 / `key` is the task ID; select `artifact_key` from the listing. Task access is required. Server-generated temporary URLs provide a separate scoped access mechanism; clients must not invent signatures.",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/task-router.go",
          "controller/task.go",
          "controller/relay.go",
          "middleware/task_plugin.go"
        ],
        "responses": {
          "200": {
            "description": "完整内容或 HEAD 头 / Complete content or HEAD headers"
          },
          "206": {
            "description": "部分内容 / Partial content"
          },
          "304": {
            "description": "未修改 / Not modified"
          },
          "404": {
            "description": "未找到 / Not found"
          },
          "409": {
            "description": "未就绪 / Not ready"
          },
          "416": {
            "description": "范围无效 / Invalid range"
          },
          "503": {
            "description": "插件不可用 / Plugin unavailable"
          }
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artifact_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Range",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Modified-Since",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/alpha/search": {
      "post": {
        "operationId": "alpha_search",
        "summary": "Alpha Search 专用请求 / Alpha Search request",
        "description": "必填 `model`；`id`、`stream` 可被解析，其他字段保留原始 JSON。模型映射改写 `model`，参数覆盖可能改变请求。 / Requires `model`; `id` and `stream` are parsed, and other raw JSON fields are retained. Mapping rewrites `model`; parameter overrides may change the request.",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/relay-router.go",
          "relay/alpha_search_handler.go",
          "relaykit/dto/alpha_search_request.go"
        ],
        "responses": {
          "200": {
            "description": "读取业务字段，不只检查 HTTP 状态 / Validate business fields, not only HTTP status.",
            "content": {
              "*/*": {
                "schema": {},
                "example": "Upstream-defined response; no uniform result schema."
              }
            }
          },
          "default": {
            "description": "错误格式与状态取决于入口 / Error status and shape depend on the entry."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  },
                  "stream": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": true,
                "required": [
                  "model"
                ]
              }
            }
          }
        }
      }
    },
    "/mj/task/{id}/fetch": {
      "get": {
        "operationId": "midjourney_task",
        "summary": "查询 Midjourney 任务 / Retrieve a Midjourney task",
        "description": "`id` 是当前用户与项目可访问的公开任务 ID。成功返回任务对象，含 `id`、`status`、`progress`、`imageUrl` 等；失败可能返回 HTTP 200 的 `code` / `description` 信封。 / `id` is a public task ID accessible to the current user and project. Success returns a task object with `id`, `status`, `progress`, `imageUrl`, and extensions. Failure may use HTTP 200 with `code` / `description`.",
        "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
        "x-source-files": [
          "router/relay-router.go",
          "relay/mjproxy_handler.go",
          "dto/midjourney.go"
        ],
        "responses": {
          "200": {
            "description": "读取业务字段，不只检查 HTTP 状态 / Validate business fields, not only HTTP status.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "progress": {
                          "type": "string"
                        },
                        "imageUrl": {
                          "type": "string"
                        },
                        "videoUrl": {
                          "type": "string"
                        },
                        "videoUrls": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": true
                          }
                        }
                      },
                      "additionalProperties": true,
                      "required": [
                        "id",
                        "status"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "description": {
                          "type": "string"
                        },
                        "result": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": true,
                      "required": [
                        "code",
                        "description"
                      ]
                    }
                  ]
                },
                "example": {
                  "id": "mj_example",
                  "status": "IN_PROGRESS",
                  "progress": "50%"
                }
              }
            }
          },
          "default": {
            "description": "错误格式与状态取决于入口 / Error status and shape depend on the entry."
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "模型调用 API Key，不是控制台登录凭据 / Model API key, not console login credentials"
      },
      "ClaudeApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "网关令牌 / Gateway token"
      },
      "GeminiApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-goog-api-key",
        "description": "网关令牌 / Gateway token"
      }
    },
    "schemas": {
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "模型列表返回的原始 ID；需要支持当前接口 / Exact ID from the model list; must support this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "object": {
            "type": "string",
            "example": "model"
          },
          "created": {
            "type": "integer",
            "description": "元数据时间戳，不代表实际上架时间 / Metadata timestamp, not necessarily the publication date"
          },
          "owned_by": {
            "type": "string",
            "description": "部署返回的模型归属标识 / Model ownership label returned by the deployment"
          },
          "supported_endpoint_types": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            },
            "description": "部署元数据提示，不保证每项具体参数能力 / Deployment metadata hints, not guarantees for every parameter"
          }
        },
        "required": [
          "id"
        ]
      },
      "Models": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "object": {
            "type": "string",
            "example": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Model"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "ModelListFailure": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "message"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "param": {
                "type": "string",
                "nullable": true
              },
              "code": {
                "nullable": true,
                "description": "错误标识；类型随上游变化 / Error identifier; type varies by upstream"
              }
            }
          }
        }
      },
      "Message": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "消息角色，支持范围由模型决定 / Message role; support depends on the model",
            "example": "user"
          },
          "content": {
            "description": "文本、模型支持的多模态内容块，或工具调用时的 null / Text, supported multimodal content blocks, or null for tool calls",
            "oneOf": [
              {
                "type": "string",
                "nullable": true
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "input_audio": {
                      "type": "object",
                      "required": [
                        "data",
                        "format"
                      ],
                      "properties": {
                        "data": {
                          "type": "string",
                          "description": "纯 Base64 音频，不带 Data URL 前缀 / Plain Base64 audio without a Data URL prefix"
                        },
                        "format": {
                          "type": "string",
                          "example": "wav",
                          "description": "真实编码格式；需模型支持 / Actual encoding format; model support required"
                        }
                      }
                    }
                  }
                }
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "tool_call_id": {
            "type": "string",
            "description": "tool 消息对应的工具调用 ID / Tool call ID for a tool message"
          },
          "tool_calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolCall"
            }
          },
          "reasoning_content": {
            "type": "string",
            "description": "部分渠道的推理文本扩展；不是最终回答，续聊语义由渠道决定 / Channel-specific reasoning text; not a final answer; replay semantics are channel dependent",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
            "nullable": true
          },
          "reasoning": {
            "type": "string",
            "description": "部分渠道使用的推理文本别名 / Reasoning-text alias used by some channels",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
            "nullable": true
          }
        },
        "required": [
          "role"
        ]
      },
      "ToolCall": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "example": "function"
          },
          "function": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "arguments": {
                "type": "string",
                "description": "JSON 编码的参数字符串 / JSON-encoded argument string"
              }
            }
          }
        }
      },
      "Tool": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "example": "function"
          },
          "function": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "parameters": {
                "type": "object",
                "description": "描述工具参数的 JSON Schema / JSON Schema describing tool arguments",
                "additionalProperties": true
              },
              "strict": {
                "type": "boolean",
                "description": "原生支持依模型；当前 Chat ↔ Responses 函数工具转换不复制此字段 / Native support depends on model; current Chat ↔ Responses function-tool conversion does not copy this field"
              }
            },
            "required": [
              "name"
            ]
          }
        },
        "required": [
          "type",
          "function"
        ]
      },
      "ChatRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "模型列表返回的原始 ID；需要支持当前接口 / Exact ID from the model list; must support this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "messages": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "stream": {
            "type": "boolean",
            "description": "是否返回 SSE 事件；取决于模型和渠道支持 / Return SSE events when supported by the model and channel",
            "default": false
          },
          "stream_options": {
            "type": "object",
            "properties": {
              "include_usage": {
                "type": "boolean",
                "description": "请求流末尾的用量；部分渠道不支持 / Request final stream usage; not supported by every channel"
              },
              "include_obfuscation": {
                "type": "boolean",
                "description": "默认过滤；需渠道允许 / Filtered by default; channel permission required"
              }
            },
            "description": "仅在 stream=true 时使用 / Use with stream=true"
          },
          "temperature": {
            "type": "number",
            "description": "采样温度；范围、默认值和是否可用由模型决定 / Sampling temperature; range, default, and support depend on the model"
          },
          "top_p": {
            "type": "number",
            "description": "核采样；范围、默认值和是否可用由模型决定 / Nucleus sampling; range, default, and support depend on the model"
          },
          "max_tokens": {
            "type": "integer",
            "description": "生成上限；模型可能要求更小的值，并限制与其他字段组合 / Output limit; models may impose a smaller limit or parameter restrictions",
            "minimum": 0,
            "maximum": 1073741823
          },
          "max_completion_tokens": {
            "type": "integer",
            "description": "生成上限；模型可能要求更小的值，并限制与其他字段组合 / Output limit; models may impose a smaller limit or parameter restrictions",
            "minimum": 0,
            "maximum": 1073741823
          },
          "stop": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "停止序列；支持情况取决于模型 / Stop sequences; model dependent"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tool"
            }
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "additionalProperties": true
              }
            ],
            "description": "auto / required / none 或指定函数；Chat 为嵌套 function.name，Responses 为同层 name，需模型支持 / auto / required / none or a selected function; nested function.name in Chat, sibling name in Responses; requires model support"
          },
          "response_format": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "example": "text"
              },
              "json_schema": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "description": "输出格式；json_object / json_schema 需模型支持 / Output format; json_object / json_schema require model support；json_object 只请求 JSON，仍需校验业务字段 / json_object requests JSON only; validate business fields"
          },
          "prompt_cache_key": {
            "type": "string",
            "description": "缓存分组提示；不保证命中、亲和或权限隔离 / Cache grouping hint; no guarantee of hits, affinity, or authorization isolation",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d"
          },
          "prompt_cache_retention": {
            "type": "string",
            "description": "缓存保留提示，值依赖上游模型；跨协议转换不保证保留 / Retention hint with model-dependent values; not guaranteed across conversion",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d"
          },
          "reasoning_effort": {
            "type": "string",
            "description": "原生 Chat 推理强度；模型名修饰符和转换可影响最终值，需模型支持 / Native Chat reasoning effort; modifiers and conversion can affect the effective value; model support required",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
            "example": "medium"
          },
          "reasoning": {
            "type": "object",
            "description": "OpenRouter 风格推理输入，按渠道方言转换；不是 Responses reasoning 结构 / OpenRouter-style reasoning input converted by channel dialect; not the Responses reasoning schema",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "effort": {
                "type": "string"
              },
              "max_tokens": {
                "type": "integer",
                "description": "推理预算，限制与归一化依赖模型和转换路径 / Reasoning budget; limits and normalization depend on model and conversion"
              },
              "exclude": {
                "type": "boolean",
                "description": "控制推理内容可见性，不等于关闭推理 / Controls reasoning visibility, not disabling computation"
              }
            },
            "additionalProperties": true
          },
          "seed": {
            "type": "number",
            "description": "尽力复现的种子；建议整数，不能保证确定性 / Best-effort seed; use integers, not a determinism guarantee"
          },
          "frequency_penalty": {
            "type": "number",
            "description": "频率惩罚；范围与支持依模型，显式零保留 / Frequency penalty; model-specific range and support; explicit zero retained"
          },
          "presence_penalty": {
            "type": "number",
            "description": "出现惩罚；范围与支持依模型，显式零保留 / Presence penalty; model-specific range and support; explicit zero retained"
          },
          "logprobs": {
            "type": "boolean",
            "description": "请求 token 对数概率；模型适配器可能移除 / Request token log probabilities; model adapter may remove it"
          },
          "top_logprobs": {
            "type": "integer",
            "description": "候选数；需要 logprobs，范围与实际返回数依模型 / Alternative count; requires logprobs, limits and returned count depend on model"
          },
          "service_tier": {
            "type": "string",
            "description": "默认过滤，需渠道允许和上游支持 / Filtered by default; requires channel permission and upstream support"
          },
          "safety_identifier": {
            "type": "string",
            "description": "默认过滤，需渠道允许 / Filtered by default; requires channel permission"
          },
          "store": {
            "type": "boolean",
            "description": "默认允许；DisableStore 删除字段而非强制 false，不是保留策略保证 / Allowed by default; DisableStore removes rather than forces false; not a retention guarantee"
          },
          "logit_bias": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "description": "以目标 tokenizer 的 token ID 为键，范围依模型 / Target-tokenizer token IDs as keys; model-specific ranges"
          },
          "web_search_options": {
            "type": "object",
            "properties": {
              "search_context_size": {
                "type": "string"
              },
              "user_location": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "description": "条件支持的 Chat 原生搜索结构，不是 Responses tools / Conditional native Chat search options, not Responses tools"
          },
          "prediction": {
            "type": "object",
            "description": "原生 Chat 条件支持；转 Responses 当前无映射，不保证加速 / Conditional native Chat support; currently unmapped to Responses; no speedup guarantee",
            "properties": {
              "type": {
                "type": "string",
                "example": "content"
              },
              "content": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                ]
              }
            },
            "additionalProperties": true,
            "x-source-files": [
              "relaykit/dto/openai_request.go",
              "relay/channel/openai/adaptor.go",
              "relaykit/relayconvert/internal/oai_chat/to_oai_responses_req.go"
            ]
          },
          "modalities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "目标输出模态，需模型与路径支持；本例仅文本 / Target output modalities; model/path dependent; example covers text only"
          },
          "audio": {
            "type": "object",
            "properties": {
              "voice": {
                "type": "string"
              },
              "format": {
                "type": "string"
              }
            },
            "additionalProperties": true,
            "description": "条件支持的音频输出选项，不是 input_audio 输入内容 / Conditional audio output options, not input_audio content"
          },
          "parallel_tool_calls": {
            "type": "boolean",
            "description": "显式 false 请求单轮最多一个函数调用；模型/渠道条件支持，不调度应用并发 / Explicit false requests at most one function call per turn; model/channel dependent, not application concurrency control"
          }
        },
        "required": [
          "model",
          "messages"
        ],
        "x-source-files": [
          "relaykit/dto/openai_request.go",
          "relay/channel/openai/adaptor.go",
          "relaykit/relayconvert/reasoning/intent.go",
          "relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go",
          "relaykit/relayconvert/internal/oai_chat/to_oai_responses_req.go",
          "relay/channel/openai/relay-openai.go",
          "relay/common/relay_info.go"
        ]
      },
      "ChatUsage": {
        "type": "object",
        "properties": {
          "prompt_tokens": {
            "type": "integer"
          },
          "completion_tokens": {
            "type": "integer"
          },
          "total_tokens": {
            "type": "integer"
          },
          "prompt_tokens_details": {
            "type": "object",
            "nullable": true,
            "properties": {
              "cached_tokens": {
                "type": "integer",
                "description": "报告的缓存读取 token；缺失不等于零，不代表最终账单 / Reported cache-read tokens; absence is not zero and this is not an invoice",
                "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                "minimum": 0
              },
              "cache_write_tokens": {
                "type": "integer",
                "description": "支持渠道报告的缓存写入 token；不要跨协议机械相加 / Cache-write tokens reported by supporting channels; do not mechanically sum across protocols",
                "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                "minimum": 0
              }
            },
            "additionalProperties": true
          },
          "completion_tokens_details": {
            "type": "object",
            "nullable": true,
            "properties": {
              "reasoning_tokens": {
                "type": "integer",
                "description": "报告的推理 token；可能缺失，不等同于可见文本长度 / Reported reasoning tokens; may be absent, not visible text length",
                "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                "minimum": 0
              }
            },
            "additionalProperties": true
          }
        },
        "description": "用量字段随上游变化，不是最终账单 / Usage varies by upstream and is not an invoice"
      },
      "ChatResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "example": "chat.completion"
          },
          "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",
                  "nullable": true,
                  "description": "如 stop、length、tool_calls、content_filter / For example stop, length, tool_calls, or content_filter"
                },
                "logprobs": {
                  "type": "object",
                  "nullable": true,
                  "description": "可选 token 元数据；强制格式化和转换可能丢失 / Optional token metadata; may be lost under forced formatting or conversion",
                  "properties": {
                    "content": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "token": {
                            "type": "string"
                          },
                          "logprob": {
                            "type": "number"
                          },
                          "bytes": {
                            "type": "array",
                            "nullable": true,
                            "items": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 255
                            }
                          },
                          "top_logprobs": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "token": {
                                  "type": "string"
                                },
                                "logprob": {
                                  "type": "number"
                                },
                                "bytes": {
                                  "type": "array",
                                  "nullable": true,
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 255
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "usage": {
            "$ref": "#/components/schemas/ChatUsage"
          }
        },
        "x-source-files": [
          "relaykit/dto/openai_request.go",
          "relay/channel/openai/relay-openai.go",
          "relay/common/relay_info.go"
        ]
      },
      "ResponsesRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "模型列表返回的原始 ID；需要支持当前接口 / Exact ID from the model list; must support this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            ],
            "description": "文本或输入项数组；内容块和工具项需模型支持 / Text or input items; content blocks and tool items require model support；原生 input_file 可携带 filename 和 Data URL file_data，需上游支持 / Native input_file may carry filename and Data URL file_data; upstream support required"
          },
          "instructions": {
            "type": "string"
          },
          "stream": {
            "type": "boolean",
            "description": "是否返回 SSE 事件；取决于模型和渠道支持 / Return SSE events when supported by the model and channel",
            "default": false
          },
          "max_output_tokens": {
            "type": "integer",
            "description": "生成上限；模型可能要求更小的值，并限制与其他字段组合 / Output limit; models may impose a smaller limit or parameter restrictions",
            "minimum": 0,
            "maximum": 1073741823
          },
          "temperature": {
            "type": "number",
            "description": "采样温度；范围、默认值和是否可用由模型决定 / Sampling temperature; range, default, and support depend on the model"
          },
          "top_p": {
            "type": "number",
            "description": "核采样；范围、默认值和是否可用由模型决定 / Nucleus sampling; range, default, and support depend on the model"
          },
          "previous_response_id": {
            "type": "string",
            "description": "关联先前响应；依赖渠道的状态保存及路由能力 / Reference a previous response; requires compatible state retention and routing"
          },
          "store": {
            "type": "boolean",
            "description": "默认允许；DisableStore 删除字段而非强制 false，不是保留策略保证 / Allowed by default; DisableStore removes rather than forces false; not a retention guarantee"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "工具定义；不同于 Chat Completions 工具结构 / Tool definitions; differ from Chat Completions tool objects；内置 web_search_preview / web_search 需原生上游支持，不保证跨协议语义 / Built-in web_search_preview or web_search needs native upstream support; cross-protocol semantics not guaranteed"
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "additionalProperties": true
              }
            ],
            "description": "auto / required / none 或指定函数；Chat 为嵌套 function.name，Responses 为同层 name，需模型支持 / auto / required / none or a selected function; nested function.name in Chat, sibling name in Responses; requires model support"
          },
          "reasoning": {
            "type": "object",
            "description": "Responses 推理配置；可用字段和值由模型和转换路径决定 / Responses reasoning configuration; supported fields and values depend on model and conversion",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
            "properties": {
              "effort": {
                "type": "string",
                "example": "medium"
              },
              "summary": {
                "type": "string",
                "description": "请求公开推理摘要，不是内部完整思维过程 / Requests a public summary, not a full internal reasoning trace"
              },
              "mode": {
                "description": "条件支持的原生扩展；不保证跨协议保留 / Conditional native extension; not guaranteed across protocols"
              },
              "context": {
                "description": "条件支持的上下文策略；值依模型而定 / Conditional reasoning context policy; model-dependent values"
              }
            },
            "additionalProperties": true
          },
          "text": {
            "type": "object",
            "additionalProperties": true,
            "description": "输出文本及格式选项；需模型支持 / Text output and format options; require model support",
            "properties": {
              "format": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "example": "json_object"
                  }
                },
                "additionalProperties": true,
                "description": "json_object 或 json_schema 等模型支持格式，不是 Chat 的 response_format / Model-supported format such as json_object or json_schema; not Chat response_format"
              }
            }
          },
          "include": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "请求附加输出，如 reasoning.encrypted_content；依赖模型和渠道支持 / Request extra output such as reasoning.encrypted_content; requires model and channel support",
            "example": [
              "reasoning.encrypted_content"
            ]
          },
          "background": {
            "type": "boolean",
            "description": "后台执行依赖渠道；插件必须声明 background，检索仅适用于宿主任务响应 / Background execution depends on the channel; plugins must declare background; retrieval covers only host task responses"
          },
          "prompt_cache_key": {
            "type": "string",
            "description": "缓存分组提示；不保证命中、亲和或权限隔离 / Cache grouping hint; no guarantee of hits, affinity, or authorization isolation",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d"
          },
          "prompt_cache_retention": {
            "type": "string",
            "description": "缓存保留提示，值依赖上游模型；跨协议转换不保证保留 / Retention hint with model-dependent values; not guaranteed across conversion",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d"
          },
          "prompt_cache_options": {
            "type": "object",
            "description": "支持该字段的原生上游专用；Responses 转 Chat 当前不映射 / For supporting native upstreams; currently not mapped from Responses to Chat",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
            "additionalProperties": true
          },
          "truncation": {
            "type": "string",
            "description": "上游截断策略，例如 disabled / auto；原生模型需支持，转 Chat 不映射 / Upstream truncation policy such as disabled / auto; native support required, not mapped to Chat",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d"
          },
          "context_management": {
            "type": "array",
            "description": "原生上下文管理条目；依赖模型，Responses 转 Chat 会拒绝该字段 / Native context-management entries; model dependent; Responses-to-Chat conversion rejects this field",
            "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "service_tier": {
            "type": "string",
            "description": "默认过滤，需渠道允许和上游支持 / Filtered by default; requires channel permission and upstream support"
          },
          "safety_identifier": {
            "type": "string",
            "description": "默认过滤，需渠道允许 / Filtered by default; requires channel permission"
          },
          "parallel_tool_calls": {
            "type": "boolean",
            "description": "显式 false 请求单轮最多一个函数调用；模型/渠道条件支持，不调度应用并发 / Explicit false requests at most one function call per turn; model/channel dependent, not application concurrency control"
          }
        },
        "required": [
          "model",
          "input"
        ],
        "x-source-files": [
          "relaykit/dto/openai_request.go",
          "relay/channel/openai/adaptor.go",
          "relaykit/relayconvert/reasoning/intent.go",
          "relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go",
          "relaykit/relayconvert/internal/oai_chat/to_oai_responses_req.go",
          "relay/channel/openai/relay-openai.go",
          "relay/common/relay_info.go"
        ]
      },
      "OutputItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "example": "message"
          },
          "role": {
            "type": "string",
            "example": "assistant"
          },
          "status": {
            "type": "string"
          },
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "example": "output_text"
                },
                "text": {
                  "type": "string"
                },
                "annotations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "example": "url_citation"
                      },
                      "url": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "start_index": {
                        "type": "integer"
                      },
                      "end_index": {
                        "type": "integer"
                      }
                    },
                    "additionalProperties": true
                  },
                  "description": "引用偏移属于该原始文本块；不要合并后复用索引 / Citation offsets belong to this original text block; do not reuse after merging"
                },
                "refusal": {
                  "type": "string",
                  "description": "type 为 refusal 时的拒答文本 / Refusal text when type is refusal"
                }
              }
            }
          },
          "call_id": {
            "type": "string",
            "description": "function_call 的结果关联 ID，不等同于输出项 id / Correlates function_call results; distinct from the output item id"
          },
          "name": {
            "type": "string",
            "description": "function_call 的函数名称 / Function name for a function_call"
          },
          "arguments": {
            "type": "string",
            "description": "函数参数的 JSON 字符串；执行前校验 / JSON-encoded function arguments; validate before execution"
          },
          "summary": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              }
            },
            "description": "推理摘要项；可能为空 / Reasoning summary items; may be empty"
          },
          "encrypted_content": {
            "type": "string",
            "description": "支持的渠道返回的不透明推理状态；原样保留，不解码 / Opaque reasoning state returned by supporting channels; preserve without decoding"
          },
          "phase": {
            "type": "string",
            "description": "支持的模型返回的消息阶段；重放时保留 / Message phase returned by supporting models; preserve when replaying"
          }
        },
        "description": "也可能是工具调用、推理或其他输出项；不要假定第一项就是文本 / May also be a tool, reasoning, or other output item; do not assume the first item is text；原生搜索项可为 web_search_call，检查其 status / Native search items may use web_search_call; check their status",
        "x-source-files": [
          "relaykit/dto/openai_request.go",
          "relay/channel/openai/relay-openai.go",
          "relay/common/relay_info.go"
        ]
      },
      "ResponsesResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "example": "response"
          },
          "created_at": {
            "type": "number"
          },
          "model": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "必须检查完成状态，例如 completed、failed、incomplete / Check completion status, for example completed, failed, or incomplete"
          },
          "output": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutputItem"
            }
          },
          "error": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "incomplete_details": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "integer"
              },
              "output_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              },
              "input_tokens_details": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "cached_tokens": {
                    "type": "integer",
                    "description": "报告的缓存读取 token；缺失不等于零，不代表最终账单 / Reported cache-read tokens; absence is not zero and this is not an invoice",
                    "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                    "minimum": 0
                  },
                  "cache_write_tokens": {
                    "type": "integer",
                    "description": "支持渠道报告的缓存写入 token；不要跨协议机械相加 / Cache-write tokens reported by supporting channels; do not mechanically sum across protocols",
                    "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                    "minimum": 0
                  }
                },
                "additionalProperties": true
              },
              "output_tokens_details": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "reasoning_tokens": {
                    "type": "integer",
                    "description": "报告的推理 token；可能缺失，不等同于可见文本长度 / Reported reasoning tokens; may be absent, not visible text length",
                    "x-source-revision": "30a6d88a4fa41009755d0f157d1656ced297803d",
                    "minimum": 0
                  }
                },
                "additionalProperties": true
              }
            },
            "nullable": true
          }
        }
      },
      "ImageGenerateRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "prompt": {
            "type": "string",
            "description": "任务描述；遵循模型的长度和内容要求 / Task description; follow model length and content requirements"
          },
          "n": {
            "type": "integer",
            "description": "请求图片数，模型通常有更小限制；建议从 1 开始 / Requested image count; models usually impose a smaller limit; start with 1",
            "minimum": 1,
            "maximum": 128
          },
          "size": {
            "type": "string",
            "description": "模型支持的尺寸，使用 x 而不是 × / Model-supported size; use x rather than ×"
          },
          "quality": {
            "type": "string",
            "description": "质量档位，由模型决定 / Quality setting determined by the model"
          },
          "response_format": {
            "type": "string",
            "description": "url 或 b64_json，仅在模型支持时指定；有些模型固定返回 Base64 / url or b64_json when supported; some models always return Base64"
          },
          "output_format": {
            "type": "string",
            "description": "输出编码，例如 png、jpeg、webp；需模型支持 / Output encoding such as png, jpeg, webp; requires model support"
          },
          "background": {
            "type": "string",
            "description": "背景选项；透明背景需模型和编码支持 / Background option; transparency requires model and format support"
          }
        },
        "required": [
          "model",
          "prompt"
        ]
      },
      "ImageEditMultipart": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "prompt": {
            "type": "string",
            "description": "任务描述；遵循模型的长度和内容要求 / Task description; follow model length and content requirements"
          },
          "n": {
            "type": "integer",
            "description": "请求图片数，模型通常有更小限制；建议从 1 开始 / Requested image count; models usually impose a smaller limit; start with 1",
            "minimum": 1,
            "maximum": 128
          },
          "size": {
            "type": "string",
            "description": "模型支持的尺寸，使用 x 而不是 × / Model-supported size; use x rather than ×"
          },
          "quality": {
            "type": "string",
            "description": "质量档位，由模型决定 / Quality setting determined by the model"
          },
          "response_format": {
            "type": "string",
            "description": "url 或 b64_json，仅在模型支持时指定；有些模型固定返回 Base64 / url or b64_json when supported; some models always return Base64"
          },
          "output_format": {
            "type": "string",
            "description": "输出编码，例如 png、jpeg、webp；需模型支持 / Output encoding such as png, jpeg, webp; requires model support"
          },
          "background": {
            "type": "string",
            "description": "背景选项；透明背景需模型和编码支持 / Background option; transparency requires model and format support"
          },
          "image": {
            "type": "string",
            "description": "输入图片文件；重复 image[] 的支持取决于渠道 / Input image file; repeated image[] support depends on the channel",
            "format": "binary"
          },
          "mask": {
            "type": "string",
            "description": "可选蒙版；格式、尺寸与透明区域语义由模型决定 / Optional mask; format, dimensions, and transparent-area semantics depend on the model",
            "format": "binary"
          }
        },
        "required": [
          "model",
          "prompt",
          "image"
        ]
      },
      "ImageEditJSON": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "prompt": {
            "type": "string",
            "description": "任务描述；遵循模型的长度和内容要求 / Task description; follow model length and content requirements"
          },
          "n": {
            "type": "integer",
            "description": "请求图片数，模型通常有更小限制；建议从 1 开始 / Requested image count; models usually impose a smaller limit; start with 1",
            "minimum": 1,
            "maximum": 128
          },
          "size": {
            "type": "string",
            "description": "模型支持的尺寸，使用 x 而不是 × / Model-supported size; use x rather than ×"
          },
          "quality": {
            "type": "string",
            "description": "质量档位，由模型决定 / Quality setting determined by the model"
          },
          "response_format": {
            "type": "string",
            "description": "url 或 b64_json，仅在模型支持时指定；有些模型固定返回 Base64 / url or b64_json when supported; some models always return Base64"
          },
          "output_format": {
            "type": "string",
            "description": "输出编码，例如 png、jpeg、webp；需模型支持 / Output encoding such as png, jpeg, webp; requires model support"
          },
          "background": {
            "type": "string",
            "description": "背景选项；透明背景需模型和编码支持 / Background option; transparency requires model and format support"
          },
          "images": {
            "type": "array",
            "description": "模型支持时使用 URL 引用；不是所有渠道的通用格式 / URL references when supported; not a universal format across channels",
            "items": {
              "type": "object",
              "properties": {
                "image_url": {
                  "type": "string",
                  "description": "HTTPS 或 data URL / HTTPS or data URL"
                }
              },
              "required": [
                "image_url"
              ]
            }
          }
        },
        "required": [
          "model",
          "prompt",
          "images"
        ]
      },
      "ImageResult": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "description": "Unix 秒 / Unix seconds"
          },
          "data": {
            "type": "array",
            "description": "检查每项的 url 或 b64_json，不能仅凭 HTTP 200 判断有图片 / Check url or b64_json in each item; HTTP 200 alone does not guarantee an image",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "可能短期有效；不要向此 URL 发送网关密钥 / May expire; never send the gateway key to this URL"
                },
                "b64_json": {
                  "type": "string",
                  "description": "图片字节的 Base64，不是 data URL / Base64 image bytes, not a data URL"
                },
                "revised_prompt": {
                  "type": "string",
                  "description": "可选改写提示词 / Optional revised prompt"
                }
              }
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "SpeechRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "input": {
            "type": "string",
            "description": "待合成文本 / Text to speak"
          },
          "voice": {
            "type": "string",
            "description": "模型支持的音色标识 / Voice ID supported by the model"
          },
          "response_format": {
            "type": "string",
            "description": "常见 mp3、wav、opus、aac、flac、pcm；支持情况由模型决定 / Common formats include mp3, wav, opus, aac, flac, pcm; support depends on model"
          },
          "instructions": {
            "type": "string",
            "description": "可选风格指令，非所有模型支持 / Optional style instructions; not supported by every model"
          },
          "speed": {
            "type": "number",
            "description": "语速；范围由模型决定 / Speed; accepted range depends on the model"
          },
          "stream_format": {
            "type": "string",
            "description": "audio 或 sse 需渠道支持；本指南使用音频字节 / audio or sse requires channel support; this guide uses audio bytes"
          }
        },
        "required": [
          "model",
          "input",
          "voice"
        ]
      },
      "TranscriptionRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "file": {
            "type": "string",
            "description": "上传音频文件，保留正确扩展名；不是路径字符串或 URL / Uploaded audio file with correct extension, not a path string or URL",
            "format": "binary"
          },
          "response_format": {
            "type": "string",
            "description": "示例使用 json；text、srt、vtt、verbose_json 等需模型支持 / Examples use json; text, srt, vtt, verbose_json and other formats require model support"
          },
          "prompt": {
            "type": "string",
            "description": "可选上下文提示，不是翻译目标语言 / Optional context hint, not the target translation language"
          },
          "temperature": {
            "type": "number",
            "description": "采样温度，需模型支持 / Sampling temperature when supported"
          },
          "language": {
            "type": "string",
            "description": "输入语言提示，例如 zh、en；模型决定格式 / Input-language hint such as zh or en; model determines format"
          },
          "timestamp_granularities[]": {
            "type": "array",
            "description": "word 或 segment，通常配合 verbose_json；需模型支持 / word or segment, usually with verbose_json; requires support",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "model",
          "file"
        ]
      },
      "TranslationRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "file": {
            "type": "string",
            "description": "上传音频文件，保留正确扩展名；不是路径字符串或 URL / Uploaded audio file with correct extension, not a path string or URL",
            "format": "binary"
          },
          "response_format": {
            "type": "string",
            "description": "示例使用 json；text、srt、vtt、verbose_json 等需模型支持 / Examples use json; text, srt, vtt, verbose_json and other formats require model support"
          },
          "prompt": {
            "type": "string",
            "description": "可选上下文提示，不是翻译目标语言 / Optional context hint, not the target translation language"
          },
          "temperature": {
            "type": "number",
            "description": "采样温度，需模型支持 / Sampling temperature when supported"
          }
        },
        "required": [
          "model",
          "file"
        ]
      },
      "AudioText": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "转写或翻译文本，静音可能为空 / Transcribed or translated text; silence may yield empty text"
          }
        },
        "required": [
          "text"
        ]
      },
      "VerboseAudioText": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "duration": {
            "type": "number",
            "description": "秒 / Seconds"
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "words": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "text"
        ]
      },
      "VideoCreateJSON": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "prompt": {
            "type": "string",
            "description": "任务描述；遵循模型的长度和内容要求 / Task description; follow model length and content requirements"
          },
          "seconds": {
            "type": "string",
            "description": "请求时长，单位秒；使用插件和模型允许的值，不以宿主安全上限作为模型能力 / Duration in seconds; use plugin/model values, not the host safety ceiling",
            "example": "4"
          },
          "size": {
            "type": "string",
            "description": "模型支持的宽x高 / Model-supported widthxheight",
            "example": "1280x720"
          },
          "input_reference": {
            "type": "string",
            "description": "可选图片 URL/data URL，具体形式由插件决定 / Optional image URL/data URL; exact form depends on plugin"
          }
        },
        "required": [
          "model",
          "prompt"
        ]
      },
      "VideoCreateMultipart": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "prompt": {
            "type": "string",
            "description": "任务描述；遵循模型的长度和内容要求 / Task description; follow model length and content requirements"
          },
          "seconds": {
            "type": "string",
            "description": "请求时长，单位秒；使用插件和模型允许的值，不以宿主安全上限作为模型能力 / Duration in seconds; use plugin/model values, not the host safety ceiling",
            "example": "4"
          },
          "size": {
            "type": "string",
            "description": "模型支持的宽x高 / Model-supported widthxheight",
            "example": "1280x720"
          },
          "input_reference": {
            "type": "string",
            "description": "可选参考图片文件，格式与尺寸需模型支持 / Optional reference image file; format and dimensions must be supported",
            "format": "binary"
          }
        },
        "required": [
          "model",
          "prompt"
        ]
      },
      "Video": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "网关公开任务 ID，后续查询/下载使用此值 / Public gateway task ID; use for retrieval/download",
            "example": "task_example"
          },
          "object": {
            "type": "string",
            "example": "video"
          },
          "model": {
            "type": "string",
            "description": "当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "status": {
            "type": "string",
            "description": "以状态判断完成；unknown 必须单独处理 / Determine completion from status; handle unknown separately",
            "enum": [
              "queued",
              "in_progress",
              "completed",
              "failed",
              "unknown"
            ]
          },
          "progress": {
            "type": "integer",
            "description": "进度提示，不等同于完成保证 / Progress hint, not proof of completion"
          },
          "created_at": {
            "type": "integer",
            "description": "Unix 秒 / Unix seconds"
          },
          "completed_at": {
            "type": "integer",
            "description": "完成时间，可省略 / Completion timestamp; may be omitted"
          },
          "expires_at": {
            "type": "integer",
            "description": "渠道可能提供的过期时间 / Optional expiry from channel"
          },
          "seconds": {
            "type": "string"
          },
          "size": {
            "type": "string"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "metadata": {
            "type": "object"
          }
        },
        "required": [
          "id",
          "object",
          "model",
          "status",
          "progress",
          "created_at"
        ]
      },
      "VideoSubmission": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "新任务的网关 ID / Gateway ID for the new task"
          },
          "task_id": {
            "type": "string",
            "description": "兼容旧客户端的字段 / Legacy compatibility field"
          },
          "status": {
            "type": "string"
          },
          "model": {
            "type": "string",
            "description": "当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "created_at": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "status"
        ]
      },
      "TaskFailure": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "nullable": true
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "VideoRemixRequest": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "description": "任务描述；遵循模型的长度和内容要求 / Task description; follow model length and content requirements"
          }
        },
        "required": [
          "prompt"
        ]
      },
      "EmbeddingRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "支持此接口且当前密钥可用的模型 / Model available to this key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "input": {
            "description": "可迁移基线：非空文本或非空文本数组；token ID 输入不保证跨渠道兼容 / Portable baseline: nonempty text or text array; token-ID inputs are not guaranteed across channels",
            "oneOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            ]
          },
          "encoding_format": {
            "type": "string",
            "description": "请求向量编码，需渠道支持；推荐显式 float / Requested vector encoding when supported; explicitly request float for the baseline",
            "enum": [
              "float",
              "base64"
            ]
          },
          "dimensions": {
            "type": "integer",
            "description": "输出维度，仅部分模型/渠道支持，不能任意截断 / Output dimensions, only for supporting models/channels; do not truncate arbitrarily",
            "minimum": 1
          },
          "user": {
            "type": "string",
            "description": "可选应用用户标识；非认证凭据，转发取决于渠道 / Optional application user identifier, not authentication; forwarding depends on channel"
          }
        },
        "required": [
          "model",
          "input"
        ]
      },
      "EmbeddingResult": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "example": "list"
          },
          "model": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "example": "embedding"
                },
                "index": {
                  "type": "integer",
                  "description": "输入的零基索引，不是数组顺序保证 / Zero-based input index; array ordering is not a guarantee",
                  "minimum": 0
                },
                "embedding": {
                  "description": "float 数组；Base64 字符串仅在实际支持时返回 / Float array; Base64 string only when actually supported",
                  "oneOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              },
              "required": [
                "index",
                "embedding"
              ]
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "RerankRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "支持此接口且当前密钥可用的模型 / Model available to this key and supporting this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "query": {
            "type": "string",
            "description": "非空查询文本 / Nonempty query text",
            "minLength": 1
          },
          "documents": {
            "type": "array",
            "description": "非空候选列表；优先字符串，对象字段由渠道决定 / Nonempty candidates; prefer strings, object fields depend on channel",
            "minItems": 1,
            "items": {
              "oneOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            }
          },
          "top_n": {
            "type": "integer",
            "description": "建议正整数且不超过候选数；Cohere 省略或非正数时转为 1，其他渠道默认不同 / Use a positive count no larger than candidates; Cohere maps omitted/nonpositive to 1, other defaults differ",
            "minimum": 1
          },
          "return_documents": {
            "type": "boolean",
            "description": "请求回传原文；Cohere 强制 true，Ali 省略时默认 true；不能作为通用不回传保证 / Request source text; Cohere forces true, Ali defaults to true when omitted; not a universal suppression guarantee"
          },
          "max_chunk_per_doc": {
            "type": "integer",
            "description": "可选渠道参数；注意单数拼写，部分适配器不转发 / Optional channel parameter; singular spelling, not forwarded by all adaptors"
          },
          "overlap_tokens": {
            "type": "integer",
            "description": "可选分块重叠参数；支持情况由渠道决定 / Optional chunk overlap; support depends on channel"
          }
        },
        "required": [
          "model",
          "query",
          "documents"
        ]
      },
      "RerankResult": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "description": "候选的相关性结果；可为空 / Candidate relevance results; may be empty",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "description": "本次 documents 的零基索引，不是排名或业务 ID / Zero-based position in this request's documents, not rank or application ID",
                  "minimum": 0
                },
                "relevance_score": {
                  "type": "number",
                  "description": "分数越高越相关；没有全渠道统一的范围或概率含义 / Higher scores indicate greater relevance; no universal range or probability interpretation"
                },
                "document": {
                  "description": "可选原文；可能为字符串或包含 text 的对象，不保证返回 / Optional source, possibly a string or object containing text; not guaranteed",
                  "nullable": true,
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "object",
                      "additionalProperties": true
                    }
                  ]
                }
              },
              "required": [
                "index",
                "relevance_score"
              ]
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          }
        },
        "required": [
          "results"
        ]
      },
      "ModerationRequest": {
        "type": "object",
        "required": [
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "显式选择可用审核模型；省略时网关历史默认 text-moderation-latest 不保证可用 / Explicitly choose an available moderation model; the gateway historical default text-moderation-latest may be unavailable"
          },
          "input": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            ],
            "description": "本规范覆盖文本与文本数组；不承诺全渠道多模态审核 / This specification covers text and text arrays, not universal multimodal moderation"
          }
        }
      },
      "ModerationResult": {
        "type": "object",
        "required": [
          "results"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "flagged",
                "categories",
                "category_scores"
              ],
              "properties": {
                "flagged": {
                  "type": "boolean",
                  "description": "总体审核信号 / Overall moderation signal"
                },
                "categories": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  },
                  "description": "分类键由模型决定 / Category keys depend on the model"
                },
                "category_scores": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "description": "分类置信评分，不是跨模型统一阈值 / Category confidence scores, not universal cross-model thresholds"
                },
                "category_applied_input_types": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "description": "上游可选输入类型说明 / Optional upstream input-type details"
                }
              }
            }
          }
        }
      },
      "CompactionRequest": {
        "type": "object",
        "required": [
          "model"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "模型列表返回的原始 ID；需要支持当前接口 / Exact ID from the model list; must support this endpoint",
            "example": "YOUR_MODEL_ID"
          },
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            ],
            "description": "文本或输入项数组；内容块和工具项需模型支持 / Text or input items; content blocks and tool items require model support"
          },
          "instructions": {
            "type": "string",
            "description": "本次压缩指令；续聊时再次明确发送所需指令 / Instructions for this compaction; explicitly send needed instructions again when continuing"
          },
          "previous_response_id": {
            "type": "string",
            "description": "DTO 接收但状态解析依赖上游；建议显式历史 / Accepted by the DTO but state resolution requires upstream support; prefer explicit history"
          }
        }
      },
      "CompactionResult": {
        "type": "object",
        "required": [
          "object",
          "output"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "enum": [
              "response.compaction"
            ]
          },
          "created_at": {
            "type": "number"
          },
          "output": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string"
                },
                "encrypted_content": {
                  "type": "string",
                  "description": "压缩项中的不透明密文；保持原样 / Opaque ciphertext in compaction items; preserve unchanged"
                }
              }
            },
            "description": "下一轮完整上下文窗口，保留所有条目及顺序 / Complete next context window; retain all items and their order"
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "integer"
              },
              "output_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              }
            },
            "nullable": true
          }
        }
      }
    }
  }
}
