Skip to content

Usage-based keys

Add an API key when you pay a provider per token. Open Settings > Inference > Usage-based. The page says “Add API keys from providers that bill per token.”

The Usage-based settings page with provider cards and Add key buttons.

Add a key

  1. Open Settings > Inference > Usage-based.
  2. Search the list under “Search providers…” and click Add key on the provider you want. You can also open the provider and use Add key there.
  3. Fill in the form:
    • Label: a name for this key, for example “Personal Anthropic key”.
    • Provider: pick from the list.
    • API key: paste it. It is never shown again after saving. To change an existing key, enter the key again.
    • Base URL (optional): only if you use a proxy or compatible gateway.
    • Wire protocol: the shape the provider’s API speaks: OpenAI Chat Completions, Anthropic Messages or OpenAI Responses. It only needs to match the provider.
    • Priority: lower tries first when several keys share a provider.
    • Active: inactive keys are skipped by Tyrn router.
  4. Click Add key.

Use Remove key on a key to delete it.

Providers

Providers include Anthropic, OpenAI, Google Gemini, Google Vertex AI, Amazon Bedrock, OpenRouter, Groq, Mistral AI, DeepSeek, xAI, Z.AI, Cerebras, Fireworks AI, Hugging Face, Meta Llama, MiniMax, Moonshot AI, Kimi, NVIDIA, Qwen Cloud, Xiaomi MiMo and more. The app shows the current list.

Use a key

Keys are used when a session’s Inference is Tyrn router. Pick a model in the session form, or click Connect provider there to add one without leaving the form. See Start a session.

Model ids appear exactly as the provider names them. In settings, refer to a model as "provider/model", or "provider:account/model" to pin one key.

Where keys are stored and who sees them

Keys are stored under ~/.tyrn/router/credentials/, in files readable only by your user account. Encryption at rest is planned. Prompts and code go from your Mac to the provider you chose, not to Tyrn. Your provider bills you directly. Tyrn does not charge for model use.

Next steps