BYOK · Bring Your Own Key
Every buddy (orchestrator included) can route through your own Anthropic or OpenAI account instead of Waypath’s metered billing. The setting is per-buddy, so you can keep the orchestrator on Metered while running Campaign on BYOK Claude, or whatever combination fits your cost model.
Three modes
| Mode | Billing | Provider |
|---|---|---|
| Metered | Waypath ai_tokens meter via Stripe | Waypath-managed Claude |
| BYOK Claude | Your Anthropic account | claude-* family |
| BYOK OpenAI | Your OpenAI account | gpt-* family; same agent contract, different backend |
Default is Metered if unset. BYOK sessions skip Waypath’s Stripe
ai_tokens meter but still trace to Langfuse for debugging.
Setup
1 · Generate a provider API key
- Anthropic: console.anthropic.com → API Keys. Keys start with
sk-ant-. - OpenAI: platform.openai.com/api-keys . Keys start with
sk-.
2 · Configure the key in Waypath
Open Settings → Integrations and scroll to LLM Providers. Paste
your key into the Claude or OpenAI field and click Save. Waypath
validates each key with a free GET /v1/models probe before accepting
it.
Under the hood:
POST /api/integrations/claude/configure
Content-Type: application/json
Authorization: Bearer <token>
{ "apiKey": "sk-ant-..." }POST /api/integrations/openai/configure
Content-Type: application/json
Authorization: Bearer <token>
{ "apiKey": "sk-..." }Either endpoint returns { "status": "configured", "provider": "<claude|openai>" }
on success or 401 Invalid <provider> key on bad credentials.
3 · Route each buddy
Open Settings → Buddies and set the model mode for each buddy you
want on BYOK. The setting persists in localStorage at
wp-buddy-models-{wsId} and is sent on every chat request.
Revoke
DELETE /api/integrations/claude # or /api/integrations/openai
Authorization: Bearer <token>This clears the stored key and removes the provider from the connected platforms list. Any buddy currently routed through that provider falls back to Metered on the next turn.
Resolution order
resolveModelForBuddy() (in packages/server/src/agents/model-resolver.ts)
picks the active provider + key per request. Order:
- Per-buddy client override: what the user picked in Settings → Buddies
- Workspace-level BYOK config: the key stored via
/configure - Env fallback.
ANTHROPIC_API_KEYon the server (Metered)
A missing BYOK key silently falls back to Metered and logs a warning on the server. No client-facing error. The turn succeeds, it just bills to Waypath.
What changes under BYOK
| Behavior | Metered | BYOK |
|---|---|---|
| Token cost | Billed to your Waypath plan’s ai_tokens meter | Billed to your provider account |
| Langfuse trace | Yes | Yes |
| Agent contract | Identical | Identical (OpenAI adapter yields the same SSE shape) |
| Tool allowlist | Identical (per-buddy) | Identical (per-buddy) |
| Delegation | Identical | Identical |
Which model is used?
resolveModelForBuddy() returns a modelId alongside the key:
- Metered →
claude-sonnet-4-6(Waypath-managed) - BYOK Claude →
claude-sonnet-4-6(your account) - BYOK OpenAI →
gpt-*family, selected to match the capabilities needed by the buddy’s tools
The modelId is captured in the Langfuse generation span + persisted on
each agent_sessions row so you can audit which model ran which turn.