Stravia

Stravia is a local, self-hostable AI gateway written in Rust. It gives your coding agents, SDKs, and chat interfaces a single gateway endpoint while handling upstream provider connections, failover routing, API key budgets, platform-hosted tools, and request observability.

Conceptual flow from AI clients through Stravia Gateway and Model Routes to upstream providers

What Stravia does

  • Unified gateway protocols: Serve OpenAI Chat Completions, OpenAI Responses (HTTP and WebSocket), Anthropic Messages, Google Gemini, and MCP (/mcp) from one instance.
  • Purpose-based model routes: Group upstream models under logical Model ID routes typed by inference, image_generation, or web_search, with priority lanes, pre-commit failover, and thinking-level mapping.
  • API keys with spend and tool controls: Issue scoped keys with allowed models, sliding-window RPM limits, decimal spend budgets, MCP access, and per-capability transparent tool injection.
  • Built-in platform capabilities: Host Web search, Media understanding (image, Office documents, audio), Media generation, History recall, and local Credential Protection without trusting every client with upstream keys.
  • Observable operations: Inspect live and historical interactions, per-bucket usage and cost analytics, upstream provider allowance windows, and exportable diagnostics.

Desktop vs. Server at a glance

AspectStravia DesktopStravia Server
RuntimeNative Tauri app (Win / macOS / Linux)Headless binary, Docker image, or NixOS module
Admin authAutomatic native session (NativeAdminSession)One-time /setup token + cookie session login
Client setupWrites global config files directly (Write configuration)Generates portable config snippets to copy
DatabaseBuilt-in SQLite (no Redis required)SQLite or PostgreSQL (PostgreSQL requires Redis ≥ 6.2)

See Deployment Modes: Desktop vs Server for hosting details and security boundaries.

Where to go next

  • First time here? Follow Getting Started to configure a provider, create your first model route, issue an API key, and verify a request.
  • Connecting an agent? Jump to Connect Clients for Codex, ChatGPT, Claude Code, OpenCode, OMP, and 7 more built-in integrations.
  • Upgrading to v0.7.8? Read What's New & Upgrading to v0.7.8 before replacing your binary or database schema.