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.
The five building blocks
| Concept | Role in Stravia | Where configured |
|---|---|---|
| Provider | An upstream connection (base_url, credentials/OAuth, proxy setting, vendor plugin, cost plan, discovered model inventory). | Setup → Providers |
| Model Route | A 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 Key | A client credential (sk-...) that scopes allowed models, RPM limits, decimal spend_limit, MCP access, and transparent tool injections. | Setup → API Keys |
| Console Chat | Built-in web chat client calling /v1/responses with your selected API key, storing conversations locally in your browser's IndexedDB. | Chat (/) |
| Observations | Server-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:
- Authentication & Admission: Stravia validates the API key, checks its
spend_limit, checks its sliding 60-secondrpm_limit, and verifiesmy-modelis in the key's allowlist. - Purpose Gate: Each endpoint only dispatches compatible route purposes (
inferencefor chat/responses/messages/Gemini,image_generationfor media generation,web_searchfor external search routes). - Target Selection & Failover: Stravia selects an enabled, non-cooled-down target from priority lanes, respecting upstream model RPM queues and pre-commit retry rules.
- 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
- Providers & Credentials — configure built-in vendors, OAuth, model sync, and cost plans.
- Models, Routing & Thinking — bind targets, set priority lanes, and map thinking levels.
- API Keys, Spend Limits & Access — control budgets, MCP permissions, and tool injection.