Skip to content
Mevichat

Bring your own LLM key (BYOK)

BYOK lets you plug your own Anthropic or OpenAI API key into Mevichat. Your bot still runs on our infrastructure — retrieval, caching, rate limiting, conversation history — but token usage bills to your provider account, not ours.

Why BYOK

  • Your usage, your bill. Spend lives on your existing Anthropic or OpenAI invoice.
  • Your rate limits. High-tier accounts already have higher TPM and RPM ceilings than our shared pool.
  • Your provider relationship. SOC 2, BAAs, and regional routing you already negotiated apply.
  • Predictable cost. No Mevichat markup on tokens — you pay the provider directly.

BYOK is available on Pro and Scale. Free workspaces run on Mevichat Mini — no key required.

Supported providers

ProviderModels
AnthropicClaude Sonnet 4.6 (Scale), Claude Haiku 4.5
OpenAIGPT-5 (Scale), GPT-5 Mini

Pro workspaces get Claude Haiku 4.5 and GPT-5 Mini. Scale adds Claude Sonnet 4.6 and GPT-5. Every plan keeps access to Mevichat Mini as a fallback. If a model isn't in this list, it isn't available yet — we add new models as providers release them.

Adding a key

  1. Open Workspace settings → Provider keys.
  2. Click Add key, choose Anthropic or OpenAI.
  3. Paste your API key (starts with sk-ant- for Anthropic, sk- for OpenAI).
  4. Click Validate & save.

We ping the provider with a minimal completion request. If the key is valid, it's encrypted with Fernet and stored. If not, you see the provider's error inline and nothing is persisted.

Validation flow

Keys are validated on save and re-checked automatically whenever a live request returns a 401/403 from the provider. If validation fails — revoked key, expired billing, quota exhausted — the key is marked invalid with a short reason string and surfaces in the dashboard. You can also trigger a manual re-test from the provider-keys row at any time.

Masked display

Once saved, we never render the full key again. The UI shows prefix + last 4 chars:

sk-ant-api03-••••••••••••••••••••••••••••••7xA2

To rotate, paste a new key — the old one is replaced atomically.

Cost attribution

Every bot message logs a token count and a provider. When you BYOK:

  • Input and output tokens count against your Anthropic or OpenAI account.
  • Mevichat's message quota still applies (Pro: 5 000/mo, Scale: 25 000/mo) — we count messages, not tokens.
  • Your provider dashboard is the source of truth for dollar spend. Mevichat shows token counts per bot for visibility.

Fallback behavior

When a BYOK key fails mid-conversation (revoked, rate-limited, provider outage):

  • The user sees a graceful message: "I'm having trouble reaching the AI right now, please try again."
  • The conversation is preserved so the user can retry once the key recovers.
  • A 401/403 from the provider flips the key to invalid so the next attempt surfaces the real reason in the dashboard instead of silently looping.

There's no auto-fallback to our shared paid pool — BYOK means your key, full stop. If you want a backup path, point the bot at Mevichat Mini (always available on every plan) or keep a second workspace on a different provider.

Rotating keys

Providers recommend rotating keys quarterly. The flow:

  1. Generate a new key on Anthropic or OpenAI.
  2. Paste it in Provider keys — the old key is replaced on save.
  3. Revoke the old key on the provider side.

No restart, no downtime. Requests in flight complete on whichever key they started on.

Plan gate

  • Free — Mevichat Mini. No BYOK, no external providers.
  • Pro — BYOK enabled. Claude Haiku 4.5 + GPT-5 Mini.
  • Scale — BYOK enabled. Adds Claude Sonnet 4.6 + GPT-5, plus priority support for provider issues.

If you upgrade from Free to Pro, existing bots keep Mevichat Mini until you switch them to a BYOK model. If you downgrade from a paid plan to Free, switch your bots back to mevichat:mini — paid-tier model choices are blocked on free workspaces. See pricing for the full matrix.

Troubleshooting

  • "Invalid API key" on save — confirm the key hasn't been revoked, and that the provider account has billing enabled.
  • Sporadic 429s — you're hitting your provider rate limit. Upgrade the provider tier or spread traffic across bots with separate keys.
  • Wrong model not available — the model list reflects what your account has access to. Some OpenAI and Anthropic models require tier-based approval.

Once BYOK is wired, customize the bot surface in Widget theming.