OpenAPI 规范
面向客户端的 /v1 端点机器可读 OpenAPI 规范。
范围
本规范仅覆盖 /v1 HTTP 接口,不包含管理 API(/api/*)、MCP 代理(/servers/*) 和兼容路径别名(/v1/v1/...、末尾斜杠)。WebSocket 端点(WS /v1/responses、 WS /v1/realtime)不在 OpenAPI 范围内,请参见流式响应和 端点索引。
The client-facing contract of the proxy: the OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages protocols plus the media endpoints, all served under /v1. Request schemas are generated from the same Pydantic models the server validates with; response schemas are descriptive and permissive, since upstream bodies are passed through. See https://zwldarren.github.io/llm-proxy/api/ for the full reference, including WebSocket and streaming behaviour.
Servers
List models
The model catalogue, filtered by the calling key's allowlist.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Responses
The visible models.
batch
Batch mode: upload a JSONL file and run its chat requests as one asynchronous job on OpenAI, OpenRouter or Gemini.
List batch files
Files uploaded by this API key, newest first. after is an id cursor.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Query Parameters
100120Responses
A page of files.
Upload a batch file
Upload a JSONL file of batch requests (one {custom_id, method, url, body} object per line). The proxy stores it and every batch created from it is forwarded to the upstream's own batch API. See Batch mode.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
JSONL batch input file. Required. One request per line.
File purpose. batch for an input file; batch_output is what the proxy writes for results.
"batch""batch_output"Responses
The stored file.
Retrieve a batch file
File metadata. Files are scoped to the API key that uploaded them.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Path Parameters
Responses
The file.
Delete a batch file
Delete a stored input or result file. An input file that a running batch reads answers 400 file_in_use; delete it once the batch is terminal.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Path Parameters
Responses
Deletion confirmation.
Download a batch file
The file's content. An input file is the JSONL that was uploaded; an output file is the materialized result JSONL.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Path Parameters
Responses
The file content (JSONL).
List batches
Batches created by this API key, newest first, in their last observed state. Listing does not poll upstreams.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Query Parameters
100120Responses
A page of batches.
Create a batch
Submit an uploaded JSONL file as one asynchronous job. Every line must target /v1/chat/completions and name the same model; the job goes to the highest-priority provider configured for that model when it supports batch mode. See Batch mode.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The created batch.
Retrieve a batch
The batch's current state, refreshed from the upstream while it is unfinished. The first read that observes a terminal status materializes the results as output_file_id / error_file_id.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Path Parameters
Responses
The batch.
Cancel a batch
Ask the upstream to cancel. A terminal batch answers with its current object; an upstream with no cancel endpoint (OpenRouter) answers 400 batch_cancel_unsupported.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Path Parameters
Responses
The (possibly cancelling) batch.
Compact response
Losslessly compact a conversation. Native upstream passthrough is tried first, with a local packing fallback.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The compacted response.
Retrieve response
Retrieve a stored response. Stored responses expire after 24 hours.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Path Parameters
Responses
The stored response.
Delete response
Delete a stored response. Deleting an unknown id is a 404, not a 200.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Path Parameters
Responses
Deletion confirmation.
Cancel response
Cancel a background response. Only background: true responses still queued/in_progress are cancellable; cancelling twice is idempotent.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Path Parameters
Responses
The (possibly cancelled) response.
List input items
List the input items of a stored response.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Parameters
Path Parameters
Query Parameters
100120"asc""desc""desc"Responses
The input items page.
Create response
OpenAI Responses API. background: true returns an in_progress response immediately and requires Redis-backed response storage.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The response object.
Estimate input tokens
Estimates the prompt size of a Responses request without invoking the model. Native upstream count when the provider offers one (MiniMax serves /v1/responses/input_tokens), otherwise a local o200k_base estimate.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The estimate.
List protocols
Registered client protocols with their base paths.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Responses
The registered protocols.
Anthropic Messages
Anthropic Messages API. Aliases /messages and /v1/v1/messages exist.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The message.
Count tokens
Native upstream count when the provider offers one, otherwise a local o200k_base estimate.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
Token count.
Create chat completion
OpenAI Chat Completions. Aliases /chat/completions and /v1/v1/chat/completions are served too. Set stream: true for text/event-stream frames; the stream ends with data: [DONE]. See Streaming.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The completion.
Create embeddings
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The embeddings.
Edit image
Accepts either a JSON body or the official multipart/form-data form.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The edited images.
Create image
JSON body. Unlike chat, the image schemas are strict: an unrecognized field returns 400 invalid_request_error.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The generated images.
decisions
Decisions evaluation (OpenAI's /v1/decisions; also served by System One upstreams through the bridge).
Operations
Answer typed questions about shared evidence
Sends shared evidence (input) and typed questions to a decision model and returns one typed answer per question. OpenAI serves this endpoint natively; a model on a System One upstream (typesafe, openrouter, ollama) is bridged: the request is translated to /v1/systemone and the answers translated back.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The answers, one per question.
Rerank documents
Scores a document list against a query and returns the most relevant documents, highest score first. Cohere-compatible: served by OpenRouter's /api/v1/rerank and the openai-compatible family's /rerank route. The named model must carry the supports_rerank flag, otherwise 400 invalid_request_error.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The ranked documents.
Create speech
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
Audio bytes in the requested response_format.
Create transcription
Multipart upload. Requires model and file.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Multipart form. Unknown fields are accepted and forwarded upstream.
Audio file to transcribe. Required.
Transcription model. Required.
ISO-639-1 language hint.
Optional style/vocabulary prompt.
"json""text""srt""verbose_json""vtt""diarized_json"Responses
The transcription.
Create translation
Multipart upload. Requires model and file.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Multipart form. Unknown fields are accepted and forwarded upstream.
Audio file to translate. Required.
Translation model. Required.
Optional style/vocabulary prompt.
"json""text""srt""verbose_json""vtt"Responses
The translation.
Evaluate a state with System One
Sends state and typed questions to a System One model such as Jev and returns one typed answer per question. TypeSafe and OpenRouter share the wire format. A model on the openai provider is bridged: its System One request is translated to /v1/decisions and the answers translated back.
Authorizations
API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.
API key sent as x-api-key: sk-… (what the Anthropic SDK sends).
Request Body
Responses
The answers, one per question id.