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 & PathProtocolNotes
POST /v1/chat/completionsOpenAI Chat CompletionsJSON or SSE (stream: true); Bearer auth.
POST /v1/responsesOpenAI Responses (2026-04-24)JSON or SSE (stream: true). Requires single non-empty Bearer key; background: true is rejected.
GET /v1/responsesOpenAI Responses WebSocketUpgrades to WebSocket; send response.create events and receive response event frames.
POST /v1/messagesAnthropic 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}:generateContentGoogle Gemini (JSON)Action split at final :; authenticates via x-goog-api-key or ?key=.
POST /v1beta/models/{model}:streamGenerateContentGoogle Gemini (streaming)Streaming is triggered by :streamGenerateContent (not alt).
GET /v1/modelsOpenAI-compatible discoveryReturns {"object":"list","data":[...]} scoped to API key allowlist.
GET /codex/modelsLive Codex catalogReturns {"models":[...]} for authorized inference routes only (excludes image_generation and web_search).
POST /v1/artifactsArtifact uploadRaw file bytes in body with file MIME in Content-Type (no multipart); returns { path, mime_type, size }.
POST /mcp (Streamable HTTP)MCPRequires 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 WebSocket response.create support standalone compaction when the final input item 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 keys update_use_proxy, proxy_enabled, proxy_url, proxy_bypass, and proxy_force_http1 are rejected; outbound_proxy rejects unknown fields such as legacy bypass and force_http1 and stores {"proxies": [...]} instead; providers, web providers, OAuth flows, and updates use proxy_mode ("none", "system", or "<proxy_id>") instead of use_proxy.
  • POST /v1/responses/compact (Responses V1 standalone compaction endpoint removed; use V2 compaction_trigger).
  • POST /v1/embeddings and 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 via GET /api/v1/web-provider-kinds).
  • Legacy inbound thinking budgets (HTTP 400): Anthropic Messages requests sending thinking.type = "enabled" or non-null thinking.budget_tokens, and Google Gemini requests sending non-null thinkingConfig.thinkingBudget, are rejected fail-closed with migration guidance. Use Anthropic thinking: {"type": "adaptive"} + output_config.effort (or thinking: {"type": "disabled"}; adaptive without output_config.effort defaults to high) and Gemini thinkingConfig.thinkingLevel; explicit null resets remain valid.

Transport compression & body limits

LayerBehavior in v0.7.8
HTTP Request DecompressionAccepts Content-Encoding: gzip, deflate, br, or zstd across inference, artifact upload, and /mcp. Unknown encoding returns 415; corrupt payloads return 400.
HTTP JSON Body Limit140 MiB (PROXY_JSON_BODY_LIMIT_BYTES) measured after decompression.
HTTP Response CompressionNegotiates Accept-Encoding (gzip, deflate, br, zstd), skipping SSE streams, images, audio, video, gRPC, and payloads < 32 bytes.
WebSocket CompressionNegotiates 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.