跳转到正文

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​

http://localhost:8080Local proxy (default)

models​

The model catalogue visible to the calling API key.


List models​

GET
/v1/models

The model catalogue, filtered by the calling key's allowlist.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Responses​

The visible models.

application/json
JSON
{
  
"object": "list",
  
"data": [
  
  
{
  
  
  
"id": "string",
  
  
  
"provider": "string",
  
  
  
"object": "model"
  
  
}
  
]
}

Playground​

Authorization

Samples​


batch​


List batch files​

GET
/v1/files

Files uploaded by this API key, newest first. after is an id cursor.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Query Parameters

limit
Type
integer
Maximum
100
Minimum
1
Default
20
after
purpose

Responses​

A page of files.

application/json
JSON
{
  
"object": "list",
  
"data": [
  
  
{
  
  
  
"id": "string",
  
  
  
"object": "file",
  
  
  
"bytes": 0,
  
  
  
"created_at": 0,
  
  
  
"filename": "string",
  
  
  
"purpose": "string"
  
  
}
  
],
  
"first_id": "string",
  
"last_id": "string",
  
"has_more": false
}

Playground​

Authorization
Variables
Key
Value

Samples​


Upload a batch file​

POST
/v1/files

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​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

multipart/form-data

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.

Valid values"batch""batch_output"

Responses​

The stored file.

application/json
JSON
{
  
"id": "string",
  
"object": "file",
  
"bytes": 0,
  
"created_at": 0,
  
"filename": "string",
  
"purpose": "string"
}

Playground​

Authorization
Body

Samples​


Retrieve a batch file​

GET
/v1/files/{file_id}

File metadata. Files are scoped to the API key that uploaded them.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Path Parameters

file_id*
Type
string
Required

Responses​

The file.

application/json
JSON
{
  
"id": "string",
  
"object": "file",
  
"bytes": 0,
  
"created_at": 0,
  
"filename": "string",
  
"purpose": "string"
}

Playground​

Authorization
Variables
Key
Value

Samples​


Delete a batch file​

DELETE
/v1/files/{file_id}

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​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Path Parameters

file_id*
Type
string
Required

Responses​

Deletion confirmation.

application/json
JSON
{
  
"id": "string",
  
"object": "file",
  
"deleted": true
}

Playground​

Authorization
Variables
Key
Value

Samples​


Download a batch file​

GET
/v1/files/{file_id}/content

The file's content. An input file is the JSONL that was uploaded; an output file is the materialized result JSONL.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Path Parameters

file_id*
Type
string
Required

Responses​

The file content (JSONL).

application/jsonl

Playground​

Authorization
Variables
Key
Value

Samples​


List batches​

GET
/v1/batches

Batches created by this API key, newest first, in their last observed state. Listing does not poll upstreams.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Query Parameters

limit
Type
integer
Maximum
100
Minimum
1
Default
20
after

Responses​

A page of batches.

application/json
JSON
{
  
"object": "list",
  
"data": [
  
  
{
  
  
  
"id": "string",
  
  
  
"object": "batch",
  
  
  
"endpoint": "string",
  
  
  
"errors": {
  
  
  
  
"object": "list",
  
  
  
  
"data": [
  
  
  
  
  
{
  
  
  
  
  
  
"code": "string",
  
  
  
  
  
  
"message": "string",
  
  
  
  
  
  
"param": "string",
  
  
  
  
  
  
"line": 0
  
  
  
  
  
}
  
  
  
  
]
  
  
  
},
  
  
  
"input_file_id": "string",
  
  
  
"completion_window": "string",
  
  
  
"status": "string",
  
  
  
"output_file_id": "string",
  
  
  
"error_file_id": "string",
  
  
  
"created_at": 0,
  
  
  
"in_progress_at": 0,
  
  
  
"expires_at": 0,
  
  
  
"finalizing_at": 0,
  
  
  
"completed_at": 0,
  
  
  
"failed_at": 0,
  
  
  
"expired_at": 0,
  
  
  
"cancelling_at": 0,
  
  
  
"cancelled_at": 0,
  
  
  
"request_counts": {
  
  
  
  
"total": 0,
  
  
  
  
"completed": 0,
  
  
  
  
"failed": 0
  
  
  
},
  
  
  
"metadata": {
  
  
  
  
"additionalProperties": "string"
  
  
  
}
  
  
}
  
],
  
"first_id": "string",
  
"last_id": "string",
  
"has_more": false
}

Playground​

Authorization
Variables
Key
Value

Samples​


Create a batch​

POST
/v1/batches

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​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"input_file_id": "string",
  
"endpoint": "string",
  
"completion_window": "24h",
  
"metadata": {
  
  
"additionalProperties": "string"
  
}
}

Responses​

The created batch.

application/json
JSON
{
  
"id": "string",
  
"object": "batch",
  
"endpoint": "string",
  
"errors": {
  
  
"object": "list",
  
  
"data": [
  
  
  
{
  
  
  
  
"code": "string",
  
  
  
  
"message": "string",
  
  
  
  
"param": "string",
  
  
  
  
"line": 0
  
  
  
}
  
  
]
  
},
  
"input_file_id": "string",
  
"completion_window": "string",
  
"status": "string",
  
"output_file_id": "string",
  
"error_file_id": "string",
  
"created_at": 0,
  
"in_progress_at": 0,
  
"expires_at": 0,
  
"finalizing_at": 0,
  
"completed_at": 0,
  
"failed_at": 0,
  
"expired_at": 0,
  
"cancelling_at": 0,
  
"cancelled_at": 0,
  
"request_counts": {
  
  
"total": 0,
  
  
"completed": 0,
  
  
"failed": 0
  
},
  
"metadata": {
  
  
"additionalProperties": "string"
  
}
}

Playground​

Authorization
Body

Samples​


Retrieve a batch​

GET
/v1/batches/{batch_id}

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​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Path Parameters

batch_id*
Type
string
Required

Responses​

The batch.

application/json
JSON
{
  
"id": "string",
  
"object": "batch",
  
"endpoint": "string",
  
"errors": {
  
  
"object": "list",
  
  
"data": [
  
  
  
{
  
  
  
  
"code": "string",
  
  
  
  
"message": "string",
  
  
  
  
"param": "string",
  
  
  
  
"line": 0
  
  
  
}
  
  
]
  
},
  
"input_file_id": "string",
  
"completion_window": "string",
  
"status": "string",
  
"output_file_id": "string",
  
"error_file_id": "string",
  
"created_at": 0,
  
"in_progress_at": 0,
  
"expires_at": 0,
  
"finalizing_at": 0,
  
"completed_at": 0,
  
"failed_at": 0,
  
"expired_at": 0,
  
"cancelling_at": 0,
  
"cancelled_at": 0,
  
"request_counts": {
  
  
"total": 0,
  
  
"completed": 0,
  
  
"failed": 0
  
},
  
"metadata": {
  
  
"additionalProperties": "string"
  
}
}

Playground​

Authorization
Variables
Key
Value

Samples​


Cancel a batch​

POST
/v1/batches/{batch_id}/cancel

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​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Path Parameters

batch_id*
Type
string
Required

Responses​

The (possibly cancelling) batch.

application/json
JSON
{
  
"id": "string",
  
"object": "batch",
  
"endpoint": "string",
  
"errors": {
  
  
"object": "list",
  
  
"data": [
  
  
  
{
  
  
  
  
"code": "string",
  
  
  
  
"message": "string",
  
  
  
  
"param": "string",
  
  
  
  
"line": 0
  
  
  
}
  
  
]
  
},
  
"input_file_id": "string",
  
"completion_window": "string",
  
"status": "string",
  
"output_file_id": "string",
  
"error_file_id": "string",
  
"created_at": 0,
  
"in_progress_at": 0,
  
"expires_at": 0,
  
"finalizing_at": 0,
  
"completed_at": 0,
  
"failed_at": 0,
  
"expired_at": 0,
  
"cancelling_at": 0,
  
"cancelled_at": 0,
  
"request_counts": {
  
  
"total": 0,
  
  
"completed": 0,
  
  
"failed": 0
  
},
  
"metadata": {
  
  
"additionalProperties": "string"
  
}
}

Playground​

Authorization
Variables
Key
Value

Samples​


Compact response​

POST
/v1/responses/compact

Losslessly compact a conversation. Native upstream passthrough is tried first, with a local packing fallback.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"model": "string",
  
"input": "string",
  
"previous_response_id": "string",
  
"instructions": "string",
  
"prompt_cache_key": "string",
  
"tools": [
  
  
{
  
  
  
"type": "function",
  
  
  
"name": "string",
  
  
  
"description": "string",
  
  
  
"parameters": {
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"strict": false
  
  
}
  
],
  
"parallel_tool_calls": true,
  
"reasoning": {
  
  
"effort": "string",
  
  
"mode": "string",
  
  
"context": "string",
  
  
"summary": "string",
  
  
"generate_summary": "string",
  
  
"additionalProperties": "string"
  
},
  
"service_tier": "string",
  
"prompt_cache_options": {
  
  
"additionalProperties": "string"
  
},
  
"prompt_cache_retention": "string",
  
"text": {
  
  
"type": "text"
  
}
}

Responses​

The compacted response.

application/json
JSON
{
  
"id": "string",
  
"object": "response",
  
"created_at": 0,
  
"status": "string",
  
"model": "string",
  
"completed_at": 0,
  
"incomplete_details": {
  
  
"reason": "string"
  
},
  
"output": [
  
  
{
  
  
  
"type": "message",
  
  
  
"id": "string",
  
  
  
"status": "string",
  
  
  
"role": "string",
  
  
  
"content": [
  
  
  
  
{
  
  
  
  
  
"type": "output_text",
  
  
  
  
  
"text": "string",
  
  
  
  
  
"annotations": [
  
  
  
  
  
  
{
  
  
  
  
  
  
  
"type": "url_citation",
  
  
  
  
  
  
  
"url": "string",
  
  
  
  
  
  
  
"start_index": 0,
  
  
  
  
  
  
  
"end_index": 0,
  
  
  
  
  
  
  
"title": "string"
  
  
  
  
  
  
}
  
  
  
  
  
],
  
  
  
  
  
"logprobs": [
  
  
  
  
  
  
{
  
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
  
0
  
  
  
  
  
  
  
],
  
  
  
  
  
  
  
"top_logprobs": [
  
  
  
  
  
  
  
  
{
  
  
  
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
  
  
  
0
  
  
  
  
  
  
  
  
  
]
  
  
  
  
  
  
  
  
}
  
  
  
  
  
  
  
]
  
  
  
  
  
  
}
  
  
  
  
  
]
  
  
  
  
}
  
  
  
],
  
  
  
"phase": "string"
  
  
}
  
],
  
"error": {
  
  
"code": "string",
  
  
"message": "string",
  
  
"type": "string",
  
  
"param": "string"
  
},
  
"tools": [
  
  
{
  
  
  
"type": "function",
  
  
  
"name": "string",
  
  
  
"description": "string",
  
  
  
"parameters": {
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"strict": false
  
  
}
  
],
  
"tool_choice": "string",
  
"truncation": "string",
  
"parallel_tool_calls": true,
  
"text": {
  
  
"type": "text"
  
},
  
"top_p": 0,
  
"presence_penalty": 0,
  
"frequency_penalty": 0,
  
"top_logprobs": 0,
  
"temperature": 0,
  
"reasoning": {
  
  
"effort": "string",
  
  
"mode": "string",
  
  
"context": "string",
  
  
"summary": "string",
  
  
"generate_summary": "string",
  
  
"additionalProperties": "string"
  
},
  
"usage": {
  
  
"input_tokens": 0,
  
  
"output_tokens": 0,
  
  
"total_tokens": 0,
  
  
"input_tokens_details": {
  
  
  
"cached_tokens": 0,
  
  
  
"cache_write_tokens": 0,
  
  
  
"cache_write_tokens_details": {
  
  
  
  
"additionalProperties": 0
  
  
  
}
  
  
},
  
  
"output_tokens_details": {
  
  
  
"reasoning_tokens": 0
  
  
}
  
},
  
"logprobs": {
  
  
"content": [
  
  
  
{
  
  
  
  
"token": "string",
  
  
  
  
"logprob": 0,
  
  
  
  
"bytes": [
  
  
  
  
  
0
  
  
  
  
],
  
  
  
  
"top_logprobs": [
  
  
  
  
  
{
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
0
  
  
  
  
  
  
]
  
  
  
  
  
}
  
  
  
  
]
  
  
  
}
  
  
]
  
},
  
"max_output_tokens": 0,
  
"max_tool_calls": 0,
  
"store": true,
  
"background": true,
  
"service_tier": "string",
  
"metadata": {
  
  
"additionalProperties": "string"
  
},
  
"safety_identifier": "string",
  
"prompt_cache_key": "string",
  
"previous_response_id": "string",
  
"instructions": "string",
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


Retrieve response​

GET
/v1/responses/{response_id}

Retrieve a stored response. Stored responses expire after 24 hours.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Path Parameters

response_id*
Type
string
Required

Responses​

The stored response.

application/json
JSON
{
  
"id": "string",
  
"object": "response",
  
"created_at": 0,
  
"status": "string",
  
"model": "string",
  
"completed_at": 0,
  
"incomplete_details": {
  
  
"reason": "string"
  
},
  
"output": [
  
  
{
  
  
  
"type": "message",
  
  
  
"id": "string",
  
  
  
"status": "string",
  
  
  
"role": "string",
  
  
  
"content": [
  
  
  
  
{
  
  
  
  
  
"type": "output_text",
  
  
  
  
  
"text": "string",
  
  
  
  
  
"annotations": [
  
  
  
  
  
  
{
  
  
  
  
  
  
  
"type": "url_citation",
  
  
  
  
  
  
  
"url": "string",
  
  
  
  
  
  
  
"start_index": 0,
  
  
  
  
  
  
  
"end_index": 0,
  
  
  
  
  
  
  
"title": "string"
  
  
  
  
  
  
}
  
  
  
  
  
],
  
  
  
  
  
"logprobs": [
  
  
  
  
  
  
{
  
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
  
0
  
  
  
  
  
  
  
],
  
  
  
  
  
  
  
"top_logprobs": [
  
  
  
  
  
  
  
  
{
  
  
  
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
  
  
  
0
  
  
  
  
  
  
  
  
  
]
  
  
  
  
  
  
  
  
}
  
  
  
  
  
  
  
]
  
  
  
  
  
  
}
  
  
  
  
  
]
  
  
  
  
}
  
  
  
],
  
  
  
"phase": "string"
  
  
}
  
],
  
"error": {
  
  
"code": "string",
  
  
"message": "string",
  
  
"type": "string",
  
  
"param": "string"
  
},
  
"tools": [
  
  
{
  
  
  
"type": "function",
  
  
  
"name": "string",
  
  
  
"description": "string",
  
  
  
"parameters": {
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"strict": false
  
  
}
  
],
  
"tool_choice": "string",
  
"truncation": "string",
  
"parallel_tool_calls": true,
  
"text": {
  
  
"type": "text"
  
},
  
"top_p": 0,
  
"presence_penalty": 0,
  
"frequency_penalty": 0,
  
"top_logprobs": 0,
  
"temperature": 0,
  
"reasoning": {
  
  
"effort": "string",
  
  
"mode": "string",
  
  
"context": "string",
  
  
"summary": "string",
  
  
"generate_summary": "string",
  
  
"additionalProperties": "string"
  
},
  
"usage": {
  
  
"input_tokens": 0,
  
  
"output_tokens": 0,
  
  
"total_tokens": 0,
  
  
"input_tokens_details": {
  
  
  
"cached_tokens": 0,
  
  
  
"cache_write_tokens": 0,
  
  
  
"cache_write_tokens_details": {
  
  
  
  
"additionalProperties": 0
  
  
  
}
  
  
},
  
  
"output_tokens_details": {
  
  
  
"reasoning_tokens": 0
  
  
}
  
},
  
"logprobs": {
  
  
"content": [
  
  
  
{
  
  
  
  
"token": "string",
  
  
  
  
"logprob": 0,
  
  
  
  
"bytes": [
  
  
  
  
  
0
  
  
  
  
],
  
  
  
  
"top_logprobs": [
  
  
  
  
  
{
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
0
  
  
  
  
  
  
]
  
  
  
  
  
}
  
  
  
  
]
  
  
  
}
  
  
]
  
},
  
"max_output_tokens": 0,
  
"max_tool_calls": 0,
  
"store": true,
  
"background": true,
  
"service_tier": "string",
  
"metadata": {
  
  
"additionalProperties": "string"
  
},
  
"safety_identifier": "string",
  
"prompt_cache_key": "string",
  
"previous_response_id": "string",
  
"instructions": "string",
  
"additionalProperties": "string"
}

Playground​

Authorization
Variables
Key
Value

Samples​


Delete response​

DELETE
/v1/responses/{response_id}

Delete a stored response. Deleting an unknown id is a 404, not a 200.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Path Parameters

response_id*
Type
string
Required

Responses​

Deletion confirmation.

application/json
JSON
{
  
"id": "string",
  
"object": "response.deleted",
  
"deleted": true,
  
"additionalProperties": "string"
}

Playground​

Authorization
Variables
Key
Value

Samples​


Cancel response​

POST
/v1/responses/{response_id}/cancel

Cancel a background response. Only background: true responses still queued/in_progress are cancellable; cancelling twice is idempotent.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Path Parameters

response_id*
Type
string
Required

Responses​

The (possibly cancelled) response.

application/json
JSON
{
  
"id": "string",
  
"object": "response",
  
"created_at": 0,
  
"status": "string",
  
"model": "string",
  
"completed_at": 0,
  
"incomplete_details": {
  
  
"reason": "string"
  
},
  
"output": [
  
  
{
  
  
  
"type": "message",
  
  
  
"id": "string",
  
  
  
"status": "string",
  
  
  
"role": "string",
  
  
  
"content": [
  
  
  
  
{
  
  
  
  
  
"type": "output_text",
  
  
  
  
  
"text": "string",
  
  
  
  
  
"annotations": [
  
  
  
  
  
  
{
  
  
  
  
  
  
  
"type": "url_citation",
  
  
  
  
  
  
  
"url": "string",
  
  
  
  
  
  
  
"start_index": 0,
  
  
  
  
  
  
  
"end_index": 0,
  
  
  
  
  
  
  
"title": "string"
  
  
  
  
  
  
}
  
  
  
  
  
],
  
  
  
  
  
"logprobs": [
  
  
  
  
  
  
{
  
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
  
0
  
  
  
  
  
  
  
],
  
  
  
  
  
  
  
"top_logprobs": [
  
  
  
  
  
  
  
  
{
  
  
  
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
  
  
  
0
  
  
  
  
  
  
  
  
  
]
  
  
  
  
  
  
  
  
}
  
  
  
  
  
  
  
]
  
  
  
  
  
  
}
  
  
  
  
  
]
  
  
  
  
}
  
  
  
],
  
  
  
"phase": "string"
  
  
}
  
],
  
"error": {
  
  
"code": "string",
  
  
"message": "string",
  
  
"type": "string",
  
  
"param": "string"
  
},
  
"tools": [
  
  
{
  
  
  
"type": "function",
  
  
  
"name": "string",
  
  
  
"description": "string",
  
  
  
"parameters": {
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"strict": false
  
  
}
  
],
  
"tool_choice": "string",
  
"truncation": "string",
  
"parallel_tool_calls": true,
  
"text": {
  
  
"type": "text"
  
},
  
"top_p": 0,
  
"presence_penalty": 0,
  
"frequency_penalty": 0,
  
"top_logprobs": 0,
  
"temperature": 0,
  
"reasoning": {
  
  
"effort": "string",
  
  
"mode": "string",
  
  
"context": "string",
  
  
"summary": "string",
  
  
"generate_summary": "string",
  
  
"additionalProperties": "string"
  
},
  
"usage": {
  
  
"input_tokens": 0,
  
  
"output_tokens": 0,
  
  
"total_tokens": 0,
  
  
"input_tokens_details": {
  
  
  
"cached_tokens": 0,
  
  
  
"cache_write_tokens": 0,
  
  
  
"cache_write_tokens_details": {
  
  
  
  
"additionalProperties": 0
  
  
  
}
  
  
},
  
  
"output_tokens_details": {
  
  
  
"reasoning_tokens": 0
  
  
}
  
},
  
"logprobs": {
  
  
"content": [
  
  
  
{
  
  
  
  
"token": "string",
  
  
  
  
"logprob": 0,
  
  
  
  
"bytes": [
  
  
  
  
  
0
  
  
  
  
],
  
  
  
  
"top_logprobs": [
  
  
  
  
  
{
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
0
  
  
  
  
  
  
]
  
  
  
  
  
}
  
  
  
  
]
  
  
  
}
  
  
]
  
},
  
"max_output_tokens": 0,
  
"max_tool_calls": 0,
  
"store": true,
  
"background": true,
  
"service_tier": "string",
  
"metadata": {
  
  
"additionalProperties": "string"
  
},
  
"safety_identifier": "string",
  
"prompt_cache_key": "string",
  
"previous_response_id": "string",
  
"instructions": "string",
  
"additionalProperties": "string"
}

Playground​

Authorization
Variables
Key
Value

Samples​


List input items​

GET
/v1/responses/{response_id}/input_items

List the input items of a stored response.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Parameters​

Path Parameters

response_id*
Type
string
Required

Query Parameters

limit
Type
integer
Maximum
100
Minimum
1
Default
20
order
Type
string
Valid values
"asc""desc"
Default
"desc"
after
include

Responses​

The input items page.

application/json
JSON
{
  
"object": "string",
  
"data": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"first_id": "string",
  
"last_id": "string",
  
"has_more": true,
  
"additionalProperties": "string"
}

Playground​

Authorization
Variables
Key
Value

Samples​


Create response​

POST
/v1/responses

OpenAI Responses API. background: true returns an in_progress response immediately and requires Redis-backed response storage.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"model": "string",
  
"input": "string",
  
"previous_response_id": "string",
  
"conversation": "string",
  
"prompt": {
  
  
"additionalProperties": "string"
  
},
  
"background_options": {
  
  
"completion_window": "string",
  
  
"continuation_id": "string",
  
  
"additionalProperties": "string"
  
},
  
"include": [
  
  
"string"
  
],
  
"tools": [
  
  
{
  
  
  
"type": "function",
  
  
  
"name": "string",
  
  
  
"description": "string",
  
  
  
"parameters": {
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"strict": false
  
  
}
  
],
  
"tool_choice": "string",
  
"metadata": {
  
  
"additionalProperties": "string"
  
},
  
"text": {
  
  
"type": "text"
  
},
  
"temperature": 0,
  
"top_p": 0,
  
"presence_penalty": 0,
  
"frequency_penalty": 0,
  
"parallel_tool_calls": true,
  
"stream": false,
  
"stream_options": {
  
  
"include_obfuscation": true
  
},
  
"background": true,
  
"max_output_tokens": 0,
  
"max_tool_calls": 0,
  
"reasoning": {
  
  
"effort": "string",
  
  
"mode": "string",
  
  
"context": "string",
  
  
"summary": "string",
  
  
"generate_summary": "string",
  
  
"additionalProperties": "string"
  
},
  
"safety_identifier": "string",
  
"prompt_cache_key": "string",
  
"truncation": "string",
  
"instructions": "string",
  
"store": true,
  
"service_tier": "string",
  
"top_logprobs": 0,
  
"additionalProperties": "string"
}

Responses​

The response object.

JSON
{
  
"id": "string",
  
"object": "response",
  
"created_at": 0,
  
"status": "string",
  
"model": "string",
  
"completed_at": 0,
  
"incomplete_details": {
  
  
"reason": "string"
  
},
  
"output": [
  
  
{
  
  
  
"type": "message",
  
  
  
"id": "string",
  
  
  
"status": "string",
  
  
  
"role": "string",
  
  
  
"content": [
  
  
  
  
{
  
  
  
  
  
"type": "output_text",
  
  
  
  
  
"text": "string",
  
  
  
  
  
"annotations": [
  
  
  
  
  
  
{
  
  
  
  
  
  
  
"type": "url_citation",
  
  
  
  
  
  
  
"url": "string",
  
  
  
  
  
  
  
"start_index": 0,
  
  
  
  
  
  
  
"end_index": 0,
  
  
  
  
  
  
  
"title": "string"
  
  
  
  
  
  
}
  
  
  
  
  
],
  
  
  
  
  
"logprobs": [
  
  
  
  
  
  
{
  
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
  
0
  
  
  
  
  
  
  
],
  
  
  
  
  
  
  
"top_logprobs": [
  
  
  
  
  
  
  
  
{
  
  
  
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
  
  
  
0
  
  
  
  
  
  
  
  
  
]
  
  
  
  
  
  
  
  
}
  
  
  
  
  
  
  
]
  
  
  
  
  
  
}
  
  
  
  
  
]
  
  
  
  
}
  
  
  
],
  
  
  
"phase": "string"
  
  
}
  
],
  
"error": {
  
  
"code": "string",
  
  
"message": "string",
  
  
"type": "string",
  
  
"param": "string"
  
},
  
"tools": [
  
  
{
  
  
  
"type": "function",
  
  
  
"name": "string",
  
  
  
"description": "string",
  
  
  
"parameters": {
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"strict": false
  
  
}
  
],
  
"tool_choice": "string",
  
"truncation": "string",
  
"parallel_tool_calls": true,
  
"text": {
  
  
"type": "text"
  
},
  
"top_p": 0,
  
"presence_penalty": 0,
  
"frequency_penalty": 0,
  
"top_logprobs": 0,
  
"temperature": 0,
  
"reasoning": {
  
  
"effort": "string",
  
  
"mode": "string",
  
  
"context": "string",
  
  
"summary": "string",
  
  
"generate_summary": "string",
  
  
"additionalProperties": "string"
  
},
  
"usage": {
  
  
"input_tokens": 0,
  
  
"output_tokens": 0,
  
  
"total_tokens": 0,
  
  
"input_tokens_details": {
  
  
  
"cached_tokens": 0,
  
  
  
"cache_write_tokens": 0,
  
  
  
"cache_write_tokens_details": {
  
  
  
  
"additionalProperties": 0
  
  
  
}
  
  
},
  
  
"output_tokens_details": {
  
  
  
"reasoning_tokens": 0
  
  
}
  
},
  
"logprobs": {
  
  
"content": [
  
  
  
{
  
  
  
  
"token": "string",
  
  
  
  
"logprob": 0,
  
  
  
  
"bytes": [
  
  
  
  
  
0
  
  
  
  
],
  
  
  
  
"top_logprobs": [
  
  
  
  
  
{
  
  
  
  
  
  
"token": "string",
  
  
  
  
  
  
"logprob": 0,
  
  
  
  
  
  
"bytes": [
  
  
  
  
  
  
  
0
  
  
  
  
  
  
]
  
  
  
  
  
}
  
  
  
  
]
  
  
  
}
  
  
]
  
},
  
"max_output_tokens": 0,
  
"max_tool_calls": 0,
  
"store": true,
  
"background": true,
  
"service_tier": "string",
  
"metadata": {
  
  
"additionalProperties": "string"
  
},
  
"safety_identifier": "string",
  
"prompt_cache_key": "string",
  
"previous_response_id": "string",
  
"instructions": "string",
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


Estimate input tokens​

POST
/v1/responses/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​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"model": "string",
  
"input": "string",
  
"instructions": "string",
  
"tools": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"tool_choice": "string",
  
"text": {
  
  
"additionalProperties": "string"
  
},
  
"reasoning": {
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Responses​

The estimate.

application/json
JSON
{
  
"object": "response.input_tokens",
  
"input_tokens": 0
}

Playground​

Authorization
Body

Samples​


protocols​

Protocol introspection.


List protocols​

GET
/v1/protocols

Registered client protocols with their base paths.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Responses​

The registered protocols.

application/json
JSON
{
  
"protocols": [
  
  
{
  
  
  
"name": "string",
  
  
  
"path": "string",
  
  
  
"description": "string",
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"additionalProperties": "string"
}

Playground​

Authorization

Samples​


chat​

Chat Completions and Anthropic Messages wire protocols.


Anthropic Messages​

POST
/v1/messages

Anthropic Messages API. Aliases /messages and /v1/v1/messages exist.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"model": "string",
  
"max_tokens": 0,
  
"messages": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"system": "string",
  
"stop_sequences": [
  
  
"string"
  
],
  
"stream": false,
  
"temperature": 0,
  
"top_p": 0,
  
"top_k": 0,
  
"tools": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"tool_choice": {
  
  
"type": "auto",
  
  
"name": "string",
  
  
"disable_parallel_tool_use": true
  
},
  
"metadata": {
  
  
"additionalProperties": "string"
  
},
  
"thinking": {
  
  
"additionalProperties": "string"
  
},
  
"cache_control": {
  
  
"additionalProperties": "string"
  
},
  
"container": "string",
  
"inference_geo": "string",
  
"service_tier": "string",
  
"output_config": {
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Responses​

The message.

JSON
{
  
"id": "string",
  
"type": "message",
  
"role": "assistant",
  
"model": "string",
  
"content": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"stop_reason": "string",
  
"stop_sequence": "string",
  
"usage": {
  
  
"input_tokens": 0,
  
  
"output_tokens": 0,
  
  
"cache_creation_input_tokens": 0,
  
  
"cache_read_input_tokens": 0,
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


Count tokens​

POST
/v1/messages/count_tokens

Native upstream count when the provider offers one, otherwise a local o200k_base estimate.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"model": "string",
  
"messages": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"system": "string",
  
"tools": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"tool_choice": {
  
  
"type": "auto",
  
  
"name": "string",
  
  
"disable_parallel_tool_use": true
  
},
  
"thinking": {
  
  
"additionalProperties": "string"
  
},
  
"cache_control": {
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Responses​

Token count.

application/json
JSON
{
  
"input_tokens": 0
}

Playground​

Authorization
Body

Samples​


Create chat completion​

POST
/v1/chat/completions

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​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"model": "string",
  
"messages": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"temperature": 0,
  
"top_p": 0,
  
"max_tokens": 0,
  
"max_completion_tokens": 0,
  
"n": 0,
  
"stream": false,
  
"stream_options": {
  
  
"additionalProperties": "string"
  
},
  
"stop": [
  
  
"string"
  
],
  
"presence_penalty": 0,
  
"frequency_penalty": 0,
  
"logit_bias": {
  
  
"additionalProperties": 0
  
},
  
"logprobs": true,
  
"top_logprobs": 0,
  
"user": "string",
  
"response_format": {
  
  
"additionalProperties": "string"
  
},
  
"seed": 0,
  
"tools": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"tool_choice": "string",
  
"parallel_tool_calls": true,
  
"thinking": {
  
  
"additionalProperties": "string"
  
},
  
"audio": {
  
  
"additionalProperties": "string"
  
},
  
"modalities": [
  
  
"string"
  
],
  
"reasoning_effort": "string",
  
"prediction": {
  
  
"additionalProperties": "string"
  
},
  
"web_search_options": {
  
  
"additionalProperties": "string"
  
},
  
"service_tier": "string",
  
"verbosity": "string",
  
"store": true,
  
"metadata": {
  
  
"additionalProperties": "string"
  
},
  
"prompt_cache_key": "string",
  
"prompt_cache_retention": "string",
  
"safety_identifier": "string",
  
"additionalProperties": "string"
}

Responses​

The completion.

JSON
{
  
"id": "string",
  
"object": "chat.completion",
  
"created": 0,
  
"model": "string",
  
"choices": [
  
  
{
  
  
  
"index": 0,
  
  
  
"message": {
  
  
  
  
"role": "string",
  
  
  
  
"content": "string",
  
  
  
  
"tool_calls": [
  
  
  
  
  
{
  
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
  
}
  
  
  
  
],
  
  
  
  
"reasoning_content": "string",
  
  
  
  
"reasoning_signature": "string",
  
  
  
  
"encrypted_content": "string",
  
  
  
  
"reasoning_segments": [
  
  
  
  
  
{
  
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
  
}
  
  
  
  
],
  
  
  
  
"refusal": "string",
  
  
  
  
"audio": {
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
},
  
  
  
  
"annotations": [
  
  
  
  
  
{
  
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
  
}
  
  
  
  
],
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"delta": {
  
  
  
  
"role": "string",
  
  
  
  
"content": "string",
  
  
  
  
"tool_calls": [
  
  
  
  
  
{
  
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
  
}
  
  
  
  
],
  
  
  
  
"reasoning_content": "string",
  
  
  
  
"reasoning_signature": "string",
  
  
  
  
"encrypted_content": "string",
  
  
  
  
"reasoning_segments": [
  
  
  
  
  
{
  
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
  
}
  
  
  
  
],
  
  
  
  
"refusal": "string",
  
  
  
  
"audio": {
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
},
  
  
  
  
"annotations": [
  
  
  
  
  
{
  
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
  
}
  
  
  
  
],
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"finish_reason": "string",
  
  
  
"logprobs": {
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"usage": {
  
  
"input_tokens": 0,
  
  
"output_tokens": 0,
  
  
"total_tokens": 0,
  
  
"input_tokens_details": {
  
  
  
"cached_tokens": 0,
  
  
  
"cache_write_tokens": 0,
  
  
  
"cache_write_tokens_details": {
  
  
  
  
"additionalProperties": 0
  
  
  
}
  
  
},
  
  
"output_tokens_details": {
  
  
  
"reasoning_tokens": 0
  
  
}
  
},
  
"system_fingerprint": "string",
  
"service_tier": "string",
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


embeddings​

Text embeddings.


Create embeddings​

POST
/v1/embeddings

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"model": "string",
  
"input": "string",
  
"encoding_format": "float",
  
"dimensions": 0,
  
"user": "string",
  
"additionalProperties": "string"
}

Responses​

The embeddings.

application/json
JSON
{
  
"object": "list",
  
"data": [
  
  
{
  
  
  
"object": "embedding",
  
  
  
"embedding": [
  
  
  
  
0
  
  
  
],
  
  
  
"index": 0,
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"model": "string",
  
"usage": {
  
  
"prompt_tokens": 0,
  
  
"total_tokens": 0,
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


images​

Image generation and editing.


Edit image​

POST
/v1/images/edits

Accepts either a JSON body or the official multipart/form-data form.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

JSON
{
  
"prompt": "string",
  
"model": null,
  
"images": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"mask": {
  
  
"additionalProperties": "string"
  
},
  
"background": null,
  
"input_fidelity": null,
  
"moderation": null,
  
"n": null,
  
"output_compression": null,
  
"output_format": null,
  
"partial_images": null,
  
"quality": null,
  
"size": null,
  
"response_format": null,
  
"stream": null,
  
"user": null,
  
"additionalProperties": "string"
}

Responses​

The edited images.

application/json
JSON
{
  
"created": 0,
  
"data": [
  
  
{
  
  
  
"url": "string",
  
  
  
"b64_json": "string",
  
  
  
"revised_prompt": "string",
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"background": "string",
  
"output_format": "string",
  
"quality": "string",
  
"size": "string",
  
"usage": {
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


Create image​

POST
/v1/images/generations

JSON body. Unlike chat, the image schemas are strict: an unrecognized field returns 400 invalid_request_error.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"prompt": "string",
  
"model": null,
  
"n": null,
  
"quality": null,
  
"response_format": null,
  
"size": null,
  
"style": null,
  
"user": null,
  
"background": null,
  
"moderation": null,
  
"output_format": null,
  
"output_compression": null,
  
"frame_count": null,
  
"frame_duration_ms": null,
  
"complexity": null,
  
"partial_images": null,
  
"stream": null,
  
"additionalProperties": "string"
}

Responses​

The generated images.

application/json
JSON
{
  
"created": 0,
  
"data": [
  
  
{
  
  
  
"url": "string",
  
  
  
"b64_json": "string",
  
  
  
"revised_prompt": "string",
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"background": "string",
  
"output_format": "string",
  
"quality": "string",
  
"size": "string",
  
"usage": {
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


decisions​

Decisions evaluation (OpenAI's /v1/decisions; also served by System One upstreams through the bridge).


Answer typed questions about shared evidence​

POST
/v1/decisions

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​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"input": "string",
  
"model": "string",
  
"questions": [
  
  
{
  
  
  
"type": "string",
  
  
  
"instructions": "string",
  
  
  
"name": "string",
  
  
  
"choices": [
  
  
  
  
{
  
  
  
  
  
"value": "string",
  
  
  
  
  
"description": "string",
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
}
  
  
  
],
  
  
  
"levels": [
  
  
  
  
{
  
  
  
  
  
"label": "string",
  
  
  
  
  
"description": "string",
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
}
  
  
  
],
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"safety_identifier": "string",
  
"prompt_cache_key": "string",
  
"prompt_cache_options": {
  
  
"mode": "string",
  
  
"ttl": "string",
  
  
"additionalProperties": "string"
  
}
}

Responses​

The answers, one per question.

application/json
JSON
{
  
"model": "string",
  
"answers": [
  
  
{
  
  
  
"type": "string",
  
  
  
"name": "string",
  
  
  
"probability": 0,
  
  
  
"choice": "string",
  
  
  
"score": 0,
  
  
  
"confidence": 0,
  
  
  
"probabilities": {
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"usage": {
  
  
"input_tokens": 0,
  
  
"input_tokens_details": {
  
  
  
"cache_write_tokens": 0,
  
  
  
"cache_write_tokens_details": {
  
  
  
  
"ttl_12h_tokens": 0,
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"cached_tokens": 0,
  
  
  
"additionalProperties": "string"
  
  
},
  
  
"output_tokens": 0,
  
  
"output_tokens_details": {
  
  
  
"reasoning_tokens": 0,
  
  
  
"additionalProperties": "string"
  
  
},
  
  
"total_tokens": 0,
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


rerank​

Document reranking.


Rerank documents​

POST
/v1/rerank

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​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"model": "string",
  
"query": "string",
  
"documents": [
  
  
"string"
  
],
  
"top_n": 0,
  
"return_documents": true,
  
"user": "string",
  
"provider": {
  
  
"additionalProperties": "string"
  
},
  
"session_id": "string",
  
"trace": {
  
  
"additionalProperties": "string"
  
},
  
"max_tokens_per_doc": 0,
  
"relevant_spans": {
  
  
"mode": "enabled",
  
  
"threshold": 0,
  
  
"max_spans": 0,
  
  
"additionalProperties": "string"
  
},
  
"priority": 0,
  
"additionalProperties": "string"
}

Responses​

The ranked documents.

application/json
JSON
{
  
"id": "string",
  
"model": "string",
  
"provider": "string",
  
"results": [
  
  
{
  
  
  
"index": 0,
  
  
  
"relevance_score": 0,
  
  
  
"document": {
  
  
  
  
"text": "string",
  
  
  
  
"image": "string",
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"relevant_spans": [
  
  
  
  
{
  
  
  
  
  
"start": 0,
  
  
  
  
  
"end": 0,
  
  
  
  
  
"score": 0,
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
}
  
  
  
],
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"usage": {
  
  
"total_tokens": 0,
  
  
"search_units": 0,
  
  
"cost": 0,
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


audio​

Speech synthesis, transcription, and translation.


Create speech​

POST
/v1/audio/speech

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"model": "string",
  
"input": "string",
  
"voice": "string",
  
"instructions": "string",
  
"response_format": "mp3",
  
"speed": 1,
  
"stream_format": "string",
  
"stream": false,
  
"additionalProperties": "string"
}

Responses​

Audio bytes in the requested response_format.

application/octet-stream

Playground​

Authorization
Body

Samples​


Create transcription​

POST
/v1/audio/transcriptions

Multipart upload. Requires model and file.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

multipart/form-data

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.

Valid values"json""text""srt""verbose_json""vtt""diarized_json"

Responses​

The transcription.

application/json
JSON
{
  
"text": "string",
  
"task": "string",
  
"language": "string",
  
"duration": 0,
  
"segments": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"words": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"logprobs": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"usage": {
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


Create translation​

POST
/v1/audio/translations

Multipart upload. Requires model and file.

Authorizations​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

multipart/form-data

Multipart form. Unknown fields are accepted and forwarded upstream.

Audio file to translate. Required.

Translation model. Required.

Optional style/vocabulary prompt.

Valid values"json""text""srt""verbose_json""vtt"

Responses​

The translation.

application/json
JSON
{
  
"text": "string",
  
"task": "string",
  
"language": "string",
  
"duration": 0,
  
"segments": [
  
  
{
  
  
  
"additionalProperties": "string"
  
  
}
  
],
  
"usage": {
  
  
"additionalProperties": "string"
  
},
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


systemone​

System One evaluation (TypeSafe's Jev; also OpenRouter and Ollama).


Evaluate a state with System One​

POST
/v1/systemone

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​

ApiKeyBearer

API key sent as Authorization: Bearer sk-…. This is what every OpenAI SDK sends by default. Console JWTs are not accepted on /v1/*.

Type
HTTP (bearer)
or
ApiKeyHeader

API key sent as x-api-key: sk-… (what the Anthropic SDK sends).

Type
API Key (header: x-api-key)

Request Body​

application/json
JSON
{
  
"state": "string",
  
"model": "string",
  
"questions": {
  
  
"additionalProperties": {
  
  
  
"type": "string",
  
  
  
"instructions": "string",
  
  
  
"criteria": {
  
  
  
  
"additionalProperties": "string"
  
  
  
},
  
  
  
"additionalProperties": "string"
  
  
}
  
},
  
"images": [
  
  
"string"
  
],
  
"keep_alive": "string",
  
"assets": {
  
  
"additionalProperties": "string"
  
},
  
"provider": {
  
  
"additionalProperties": "string"
  
},
  
"session_id": "string",
  
"trace": {
  
  
"additionalProperties": "string"
  
},
  
"user": "string"
}

Responses​

The answers, one per question id.

application/json
JSON
{
  
"model": "string",
  
"answers": {
  
  
"additionalProperties": "string"
  
},
  
"usage": {
  
  
"input_tokens": 0,
  
  
"output_tokens": 0,
  
  
"cost": 0,
  
  
"additionalProperties": "string"
  
},
  
"id": "string",
  
"provider": "string",
  
"additionalProperties": "string"
}

Playground​

Authorization
Body

Samples​


MIT 许可