Relay an API request
Sends body to the upstream endpoint url and relays the JSON or SSE response, including its status. The proxy sends the caller's key as x-goog-api-key for Gemini and x-api-key for Messages. Messages also receives anthropic-version: 2023-06-01 and, when body contains speed, anthropic-beta: fast-mode-2026-02-01. Chat Completions and Responses receive Authorization. The proxy blocks redirects, omits cookies and applies a 250-second timeout. Cancelling the call cancels the upstream request.
授权
upstreamKey The API key of the upstream service. The proxy does not store it.
位置: header
请求主体
application/json
TypeScript 定义
在 TypeScript 中使用 request body 类型。
响应主体
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/proxy" \ -H "Content-Type: application/json" \ -d '{ "url": "https://api.example.com/v1/chat/completions", "format": "gemini", "body": { "contents": [ {} ] } }'{}最后更新于