---
title: Bring your own key (BYOK) quickstart
description: Connect an upstream provider credential and route eligible inference through it.
---

**Bring Your Own Key (BYOK)** allows your organization to store encrypted provider credentials in Zorveus. Requests matching your provider policy route directly through your upstream account.

<KeyInserter type="api" label="API Key Tester" placeholder="zrv_your_api_key" />

<Callout type="important" title="Billing Transparency">
  BYOK is **not free AI**. When using BYOK credentials, Zorveus does not debit your Zorveus wallet for model usage ($0 Zorveus sell cost), but **the upstream model provider bills your credit card or billing account directly**. Zorveus continues to meter token volume and provider cost for visibility.
</Callout>

---

## 1. Add a provider credential

Add provider credentials under **Provider Credentials** in the dashboard. Credential management is not a supported service-key operation.

<Steps>
  <Step title="Navigate to Provider Credentials">
    In [app.zorveus.com](https://app.zorveus.com), go to **Settings** -> **Provider Credentials**.
  </Step>
  <Step title="Select Provider and Enter Key">
    Choose your provider (e.g. `openai`, `anthropic`, `gemini`, `openrouter`) and paste your raw API secret (e.g. `sk-...`).
  </Step>
  <Step title="Configure Model Policy">
    Set the model policy to determine which models resolve to this key:
    - `*`: Matches all models allowed for the credential
    - `openai/*`: Resolves all OpenAI models
    - `openai/gpt-4.1-mini`: Resolves only this specific model
  </Step>
</Steps>

---

## 2. Route a request

After saving the credential, create or update an app connection whose model policy permits the route. Credentials in `auto_resolve` mode can be selected automatically. Credentials in `manual_grant_only` mode also need an explicit grant to the connection.

<CodeGroup titles={["Python (OpenAI SDK)", "TypeScript (OpenAI SDK)", "cURL"]}>

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.zorveus.com/v1",
    api_key="zrv_your_api_key",
)

# The route uses BYOK when an eligible OpenAI credential resolves.
response = client.chat.completions.create(
    model="openai/gpt-4.1-mini",
    messages=[
        {"role": "user", "content": "Explain the advantages of vector databases."}
    ],
)

print(response.choices[0].message.content)
```

```typescript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.zorveus.com/v1",
  apiKey: "zrv_your_api_key",
});

async function main() {
  const completion = await client.chat.completions.create({
    model: "openai/gpt-4.1-mini",
    messages: [
      { role: "user", content: "Explain the advantages of vector databases." },
    ],
  });

  console.log(completion.choices[0].message.content);
}

main();
```

```bash
curl https://api.zorveus.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer zrv_your_api_key" \
  -d '{
    "model": "openai/gpt-4.1-mini",
    "messages": [
      {"role": "user", "content": "Explain the advantages of vector databases."}
    ]
  }'
```

</CodeGroup>

---

## 3. Verify BYOK usage accounting

In your Zorveus Dashboard under **Usage Analytics**:
- **Billing mode**: Tagged as `byok`.
- **Sell cost**: The platform fee charged by Zorveus. **$0.00 for the first $25,000/month** in BYOK traffic. Volume above $25k incurs a configured platform routing fee.
- **Provider cost**: The estimated upstream model cost (e.g. OpenAI or Anthropic rates) recorded for analytics.
- **Tokens**: Token counts measured by the gateway or returned by upstream providers.

<Callout type="tip" title="BYOK Pricing & Free Tier">
  All organizations receive up to **$25,000/month in free BYOK traffic**. See [BYOK Pricing & Cost Accounting](/wallet-and-billing/byok-costs) for complete details on volume tiers and wallet settlement.
</Callout>

---

## Next steps

<CardGroup cols={2}>
  <Card title="Provider Credentials Deep Dive" icon="key" href="/startups/provider-credentials">
    Learn about priority ordering, key rotation, and connection-specific overrides.
  </Card>
  <Card title="Supported Providers" icon="cpu" href="/providers/overview">
    Explore provider-specific setups for Anthropic, Gemini, Azure OpenAI, and NVIDIA NIM.
  </Card>
</CardGroup>
