HTTP API¶
The gateway serves the endpoints of all three protocols on http://127.0.0.1:<port>. Each request is converted to the configured upstream protocol, or forwarded unchanged when the protocols match.
Endpoints¶
Method and path |
Protocol |
Notes |
|---|---|---|
|
Chat Completions |
JSON or |
|
Anthropic Messages |
JSON or SSE; the |
|
Anthropic Messages |
Needs |
|
Responses |
JSON or SSE |
|
Responses |
Needs |
|
Responses |
Native Responses upstream only, not streamed |
|
Messages or OpenAI list |
Serves the session’s model snapshot (set by the launchers); |
Authentication¶
Send the inbound token as Authorization: Bearer <token>. GET /v1/models also accepts x-api-key, alone or together with Authorization, as long as every credential sent matches. Requests without a valid token get 401.
Request headers¶
Content-Length is required; chunked or ambiguous framing is rejected (400/411). Bodies are limited to 8 MiB by default. Request headers must arrive within 15 seconds. On Messages routes anthropic-version and anthropic-beta are forwarded unchanged to a Messages upstream. X-Protoverta-Agent-ID and X-Protoverta-Chain-ID are hashed into diagnostics and never forwarded.
Response headers¶
Header |
Meaning |
|---|---|
|
A fresh ID for this request, also in diagnostics |
|
The output stopped at the token limit |
|
How a token count was produced ( |
|
The context preflight verdict and counts, when enabled |
|
Forwarded from the provider |
Errors¶
Errors use the envelope of the client’s protocol. Messages clients receive {"type": "error", "error": {...}}; Chat Completions and Responses clients receive {"error": {...}}. The error object carries:
type: the protocol’s error type (for exampleinvalid_request_error,authentication_error,rate_limit_error,overloaded_error,api_error);message: a readable message with known secrets removed;code: a stable Protoverta code (below) or the error kind;phase: where it failed (request,preflight,admission,upstream,response,stream), andfeature/pathwhen relevant.
Code |
Status |
Meaning |
|---|---|---|
|
422 |
A recognised feature cannot be carried to the upstream protocol |
|
422 |
Reasoning state the route cannot preserve |
|
422 |
A refusal or content filter the route cannot represent |
|
502 |
The provider sent an invalid stream or response |
|
502 |
The provider called a tool the request did not allow |
|
502 |
A stream exceeded a configured size limit |
|
502 / 504 |
The provider could not be reached or timed out |
|
504 |
The request’s total or progress deadline passed |
|
500 |
An unexpected gateway fault; nothing was retried |
|
400 |
The provider reported a context overflow |
Errors that will fail again if resent carry x-should-retry: false. Native routes return the provider’s own error body unchanged. Errors inside an SSE stream after the first event are sent as the protocol’s error event. See errors and resource limits for the full mapping.