Core Concepts & Architecture

Stravia separates client-facing endpoints from upstream vendor accounts so you can swap providers, enforce spend and rate limits, and audit traffic without reconfiguring your tools.

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

The five building blocks

ConceptRole in StraviaWhere configured
ProviderAn upstream connection (base_url, credentials/OAuth, proxy setting, vendor plugin, cost plan, discovered model inventory).Setup → Providers
Model RouteA logical Model ID called by clients, typed with a single purpose (inference, image_generation, or web_search) and one or more prioritized upstream Targets.Setup → Models
API KeyA client credential (sk-...) that scopes allowed models, RPM limits, decimal spend_limit, MCP access, and transparent tool injections.Setup → API Keys
Console ChatBuilt-in web chat client calling /v1/responses with your selected API key, storing conversations locally in your browser's IndexedDB.Chat (/)
ObservationsServer-side interaction history (/logs), persistent 15-minute bucket analytics (/stats), and upstream quota snapshots (/allowances).Monitor

Why logical Model IDs matter

Clients never specify an upstream vendor credential or raw upstream model slug directly. Instead, a client sends model: "my-model" to Stravia:

  1. Authentication & Admission: Stravia validates the API key, checks its spend_limit, checks its sliding 60-second rpm_limit, and verifies my-model is in the key's allowlist.
  2. Purpose Gate: Each endpoint only dispatches compatible route purposes (inference for chat/responses/messages/Gemini, image_generation for media generation, web_search for external search routes).
  3. Target Selection & Failover: Stravia selects an enabled, non-cooled-down target from priority lanes, respecting upstream model RPM queues and pre-commit retry rules.
  4. Protocol Normalization: Inbound OpenAI, Anthropic, or Gemini requests are mapped to the upstream vendor plugin's native protocol while unsupported parameters are explicitly omitted rather than silently leaked.

Where to go next