API & Protocol Compatibility
Stravia serves normalized model inference, artifact upload, and MCP endpoints from one listener (default http://127.0.0.1:23471).
Gateway inference & discovery endpoints
| Method & Path | Protocol | Notes |
|---|---|---|
POST /v1/chat/completions | OpenAI Chat Completions | JSON or SSE (stream: true); Bearer auth. |
POST /v1/responses | OpenAI Responses (2026-04-24) | JSON or SSE (stream: true). Requires single non-empty Bearer key; background: true is rejected. |
GET /v1/responses | OpenAI Responses WebSocket | Upgrades to WebSocket; send response.create events and receive response event frames. |
POST /v1/messages | Anthropic Messages (2023-06-01) | JSON or SSE; authenticates via x-api-key + anthropic-version: 2023-06-01. Anthropic remote compaction is unsupported. |
POST /v1beta/models/{model}:generateContent | Google Gemini (JSON) | Action split at final :; authenticates via x-goog-api-key or ?key=. |
POST /v1beta/models/{model}:streamGenerateContent | Google Gemini (streaming) | Streaming is triggered by :streamGenerateContent (not alt). |
GET /v1/models | OpenAI-compatible discovery | Returns {"object":"list","data":[...]} scoped to API key allowlist. |
GET /codex/models | Live Codex catalog | Returns {"models":[...]} for authorized inference routes only (excludes image_generation and web_search). |
POST /v1/artifacts | Artifact upload | Raw file bytes in body with file MIME in Content-Type (no multipart); returns { path, mime_type, size }. |
POST /mcp (Streamable HTTP) | MCP | Requires mcp_access_enabled on the API key; tools/list reflects enabled capabilities. |
Responses V2 standalone compaction
- HTTP & WebSocket: Both
POST /v1/responses(stream: true) and WebSocketresponse.createsupport standalone compaction when the finalinputitem is a single{"type":"compaction_trigger"}. Stravia streams native compaction items so the client rebuilds its retained context window. - Strict validation: Non-streaming HTTP requests, duplicate triggers, or misplaced triggers are rejected (
invalid_request).
Removed endpoints & breaking rules
The following legacy routes, protocol identifiers, admin settings, and inbound thinking parameters are removed or rejected in v0.7.8:
- Legacy proxy settings & booleans (v0.7.8, migration
0060): Setting keysupdate_use_proxy,proxy_enabled,proxy_url,proxy_bypass, andproxy_force_http1are rejected;outbound_proxyrejects unknown fields such as legacybypassandforce_http1and stores{"proxies": [...]}instead; providers, web providers, OAuth flows, and updates useproxy_mode("none","system", or"<proxy_id>") instead ofuse_proxy. POST /v1/responses/compact(Responses V1 standalone compaction endpoint removed; use V2compaction_trigger).POST /v1/embeddingsand all embedding protocol aliases (openai-compatible/embeddings/v1,openai/embeddings/v1,openai-embeddings,embeddings).- Anthropic explicit remote context compaction requests.
/api/v1/web-access/browser(removed along with built-in local Chromium management; Web Provider kinds are discovered dynamically viaGET /api/v1/web-provider-kinds).- Legacy inbound thinking budgets (HTTP
400): Anthropic Messages requests sendingthinking.type = "enabled"or non-nullthinking.budget_tokens, and Google Gemini requests sending non-nullthinkingConfig.thinkingBudget, are rejected fail-closed with migration guidance. Use Anthropicthinking: {"type": "adaptive"}+output_config.effort(orthinking: {"type": "disabled"};adaptivewithoutoutput_config.effortdefaults tohigh) and GeminithinkingConfig.thinkingLevel; explicitnullresets remain valid.
Transport compression & body limits
| Layer | Behavior in v0.7.8 |
|---|---|
| HTTP Request Decompression | Accepts Content-Encoding: gzip, deflate, br, or zstd across inference, artifact upload, and /mcp. Unknown encoding returns 415; corrupt payloads return 400. |
| HTTP JSON Body Limit | 140 MiB (PROXY_JSON_BODY_LIMIT_BYTES) measured after decompression. |
| HTTP Response Compression | Negotiates Accept-Encoding (gzip, deflate, br, zstd), skipping SSE streams, images, audio, video, gRPC, and payloads < 32 bytes. |
| WebSocket Compression | Negotiates RFC 7692 permessage-deflate when offered by the client; decompressed WebSocket message limit is 100 MiB. |
Protocol translation & parameter allowlisting
Stravia uses an explicit native parameter allowlist per upstream target: unknown keys are omitted rather than blindly forwarded, supported aliases are normalized (e.g. n/candidateCount, logprobs/top_logprobs, safety_identifier/user), and unrepresentable content or unsupported hosted tools are omitted when converting between protocols.