Getting Started

This tutorial takes you through the shortest path to a working request: complete initial setup, add one upstream provider, publish a Model ID, issue a scoped API key, connect a client, and verify the result in Request history.

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

Prerequisites

  • Installed Stravia: Download and install Stravia Desktop or start Stravia Server. See Installation & Upgrade if you have not installed it yet.
  • Upstream credential: An API key or supported OAuth account for at least one upstream model provider.

Steps

  1. Complete initial setup (Server only)

    If you run Stravia Desktop, skip this step—Desktop creates a local native admin session automatically and opens directly to the console.

    If you run Stravia Server, check the startup logs for the one-time /setup URL and token, open it in your browser, select SQLite (or configure PostgreSQL + Redis first), and create your administrator account.

    Stravia Server first-time setup form showing database backend selection

  2. Add an upstream provider

    Open Setup → Providers and select Add provider. Choose a built-in vendor (such as OpenAI) or an installed vendor plugin, enter your credentials, and save the connection. Stravia immediately syncs the provider's discovered models.

    Add provider drawer with OpenAI selected in Stravia WebUI

  3. Create a model route and bind a target

    Open Setup → Models → New model. Set a client-facing Model ID (for example my-model), a Display name, and choose Purpose: Inference.

    Model editor contract section highlighting Model ID and Purpose fields

    Scroll to the Targets section (or open the new route directly from the provider's upstream model list), bind at least one enabled upstream target in Lane 0, verify there are no thinking-mapping or purpose warnings, and save the route.

    Model editor target lane showing a valid bound upstream model

  4. Create an API key

    Open Setup → API Keys and click Create key. Give the key a descriptive name, select the model(s) it may access (such as my-model), and optionally set an RPM limit or decimal spend limit. Copy the generated key (formatted like sk-stravia-demo-not-a-real-key in examples) before closing the dialog.

    Create API Key sheet showing model allowlist selection

  5. Connect a client or send a test request

    Open Setup → Connect clients. On the Clients tab, choose your tool (such as Codex, Claude Code, or OpenCode), select your API key, and click Write configuration (Desktop) or copy the generated config snippet (Server). Alternatively, switch to the Code tab and run the generated cURL command:

    Connect clients Code tab with model selector and cURL snippet

    curl http://127.0.0.1:23471/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-stravia-demo-not-a-real-key" \
      -d '{"model":"my-model","messages":[{"role":"user","content":"Hello, Stravia!"}]}'
    sh

Verify

Open Monitor → Request history (/logs). You should see a Completed interaction card matching my-model with your prompt, model response, and token usage counters.

Request history page displaying a completed interaction card

TIP

Seeing a configuration preview or saving a client config file only confirms the patch was written—always send one request and confirm a Completed card in Request history before moving on.

Troubleshooting

  • 401 Unauthorized when calling /v1/*: Confirm the API key is enabled, has not expired, has not exceeded its spend_limit, and allows the requested Model ID.
  • Target shows a purpose or thinking warning: Check that the bound upstream model supports Inference and save any generated thinking-level mappings before testing.
  • Server asks for a setup token again: Ensure your data directory (~/.stravia or --data-dir) is persistent and writable across restarts.

Next