Skip to main content
BYOK (Bring Your Own Key) is the default way Kodus uses LLMs across every plan — Community, Teams, and Enterprise. You connect your own provider accounts, enable the models you want, and choose which model runs each task. You pay your provider directly, Kodus never marks up tokens, and Kodus never sees your key in plain text.

How this maps to plans

BYOK is free on Community, included on Teams ($10/active dev/month on top of your token spend), and one of two options on Enterprise (the other being a Kodus-managed API key).

How BYOK works

BYOK is provider-first: you connect a provider once, add the models you want to it, and then route those models to Kody’s tasks. The /byok screen has three tabs:

Providers

Connect providers with your key and enable models on each one. The count badge shows how many providers you’ve connected.

Routing

Choose which model runs each task — one default for everything, an optional fallback, and per-agent overrides.

Budget

Set an optional monthly spend limit across your connected models.
Who can edit this. The BYOK page is Owner-only — connecting, testing, and deleting keys requires the Owner role. Other roles (Billing Manager, Repo Admin, Contributor) can’t access /byok. See Workspace Roles.

Connect a provider

1

Open BYOK settings

Go to app.kodus.io/byok. On a fresh workspace you’ll see Connect your first provider.
2

Pick a provider

The provider grid is split in two:
  • Providers — first-class providers you connect with just an API key (OpenAI, Anthropic, Google AI Studio, OpenRouter, Novita…).
  • Custom — providers you point at your own endpoint or run an arbitrary model on: OpenAI-compatible, Anthropic-compatible, Google Vertex AI, and Amazon Bedrock. These are marked with a Custom endpoint hint.
A provider you’ve already connected shows Connected · N models.
3

Add a model

Picking a provider opens its Add a model form. Paste the API key once (reused for every model you add to that provider afterward), then choose the model:
  • If Kodus can list the provider’s models, you get a dropdown.
  • Otherwise (custom endpoints, self-hosted, or when platform keys aren’t configured), type the exact model ID.
Custom endpoints (OpenAI-compatible / Anthropic-compatible) also ask for a base URL first.
4

Tune advanced settings (optional)

Under Advanced settings: thinking/reasoning, temperature, max output tokens, max input tokens, and max concurrent requests. Defaults are sensible for most providers — see Reasoning and Temperature for the fields Kodus locks or hides per model.
5

Test and save

Click Test to probe the provider, or Test & save to run the test and persist on success. Add as many models to the provider as you want — the key is only pasted once.
Add another provider any time from the Providers tab. Each provider keeps its own key; enabling more models on a connected provider never re-asks for it.

Test before you save

The Test button verifies your configuration before it can break a real review. What it does depends on the provider: On the chat-probe path, Test also validates the tuning you configured against the model’s own rules and returns an early, specific error instead of saving a config the model would silently ignore:
  • A temperature an always-thinking model won’t honor (it’s pinned to 1 — see Temperature).
  • Reasoning turned Off on a model that always reasons and can’t be disabled.
Because the chat providers now exercise the real model, a typo in the model ID is caught at Test time rather than at your first review — the response comes back Model not found.

Routing: which model runs each task

Once you’ve connected two or more models, the Routing tab decides which model runs what. Routing is flat: every task uses the default until you override it.
1

Policy

Manual · you choose is active today. Auto · Kodus optimizes is coming soon.
2

Defaults

  • Model for all tasks — the one model every task uses unless overridden.
  • Fallback (optional) — a different model Kody re-runs a call on once when the task’s model fails: a bad or expired key, no credit, or the provider being down (after its own retries).
3

Per agent

Different Kody tasks (code review, Kody Rules, chat, summaries, and more) can each run a different model — a pricier model for deep review, a cheaper one for summaries. A model that can’t do a given task is disabled in that row with a tooltip, before you can save it.
Click Save routing to persist. Reset agents to default sends every per-agent override back to the default and clears the fallback (the default model itself is kept). A read-only Per repository panel below mirrors any per-repo model overrides set in Code Review Settings.
With a single connected model, routing is skipped — every task uses that model. Connect a second model to make routing meaningful.

Choosing models

Any model your provider serves works. If you’re not sure where to start, these are solid choices for code review:

Claude Sonnet / Opus

Best balance / flagship quality. Anthropic’s adaptive extended thinking and strong cross-file analysis. Keys: console.anthropic.com.

Gemini Pro

Largest context. Google’s flagship — strongest on large PRs and monorepos. Keys: aistudio.google.com/apikey.

GPT (latest)

Fast and consistent. OpenAI’s flagship line — reliable low latency, broad knowledge. Keys: platform.openai.com/api-keys.

Kimi / GLM (coding plans)

Cheapest via subscription. Moonshot’s Kimi and Z.ai’s GLM offer flat-rate coding plans that cap monthly spend. See Connecting Kimi and GLM below.
Our default recommendation: start with Claude Sonnet for the best overall experience. If cost is the priority, a GLM Coding Plan or Kimi Code Plan gives a flat-rate subscription. Enter the exact model ID your provider documents — Kodus derives the display name from it.

Connecting Kimi (Moonshot) and GLM (Z.ai)

Moonshot and Z.ai each offer a subscription plan on a different endpoint than their pay-per-token Developer API. Each plan is a separate account with its own key — pick the base URL that matches the key you have.
Kimi Code Plan is documented at a cap of 30 concurrent requests — set maxConcurrentRequests=30. Always-reasoning Kimi variants (e.g. kimi-k2p7-code, kimi-k3) lock temperature to 1 and can’t turn reasoning off — see Temperature.

Supported Providers

Best for: Latest GPT models and reliable performance.Get an API key:
  1. Visit OpenAI API Keys
  2. Create a new key for Kodus
  3. Add billing information

Reasoning / Extended Thinking

The Add a model form exposes a Thinking toggle (Off / Low / Medium / High / Custom) under Advanced settings. The available options mirror what the model can actually do:
  • A model that can’t reason is locked to Off with a note.
  • A model that only reasons at certain levels (e.g. GPT-5’s medium/high) disables the invalid ones.
  • A reasoning-by-default model gets Medium as a sensible starting point.

Preset levels

When you pick Low / Medium / High, Kodus translates the level to each provider’s native format automatically:
Kimi and GLM currently expose reasoning as a single on/off flag. Picking Low, Medium, or High all emit the same payload (thinking enabled). Always-reasoning variants (Kimi k2p7-code/k3, GLM-5.3) reason unconditionally — they can’t be turned Off, and the form disables that option.

Custom JSON override

Picking Custom in the Thinking toggle reveals a JSON textarea. Paste the provider options directly — Kodus auto-wraps them under the active provider’s namespace. You don’t need to know the Vercel AI SDK routing rules. Use this when:
  • You need a specific budgetTokens value for Claude (instead of the preset effort mapping)
  • You want to enable/disable thinking on a per-model basis for OpenAI-compatible providers
  • You want fields beyond reasoning — caching, service tier, safety settings, user tagging, etc. The override is merged into providerOptions, so any adapter field passes through
  • The provider ships a new field Kodus hasn’t wrapped yet

Examples (paste directly — no namespace needed)

Override Claude’s thinking budget to exactly 20,000 tokens:
Enable prompt caching (non-reasoning example):

Going manual with namespaces (power users)

If your JSON already starts with a known namespace key at the top level — any key from the mapping table below — Kodus leaves it untouched. Useful if you want to mix multiple provider namespaces or be explicit:
Under the hood, these are the namespace mappings Kodus uses:

Gotchas

  • Valid JSON only. Missing commas or trailing commas break the parse and Kodus ignores the override.
  • Precedence: the JSON override fully replaces the effort-preset’s namespace block — if you override anthropic.thinking but forget anthropic.effort, that field won’t be sent. OpenRouter routing (Pin providers / Allow fallbacks) is the one exception: it deep-merges with your override under openrouter.
  • Unknown provider = no wrap. If your BYOK provider isn’t in the namespace table above, Kodus passes the JSON through as-is.

Temperature

Temperature lives under Advanced settings, and the field adapts to the model’s rules — set by the provider, not guessed by the form:
On the chat-probe providers, Test validates the temperature you set against these rules and returns an error before saving — so you never persist a value the model won’t honor.

Pinning OpenRouter providers

OpenRouter is a router — when you request a model (e.g. moonshotai/kimi-k2), it forwards the call to one of several upstream providers (Moonshot direct, Together, Groq, Fireworks, Novita…). Each call can land on a different backend. That’s convenient, but it introduces silent variance:
  • Quality drift — upstreams run different precisions (FP8, INT4, full) and give subtly different outputs for identical prompts
  • Tool-calling inconsistency — some backends don’t support function calling the same way, leading to malformed tool use
  • Reasoning format variance — one upstream honors reasoning_effort, another only thinking.enabled, another ignores both
  • Latency swings — p50 can jump from 800ms to 4s between calls as routing changes
  • Rate-limit surprises — you hit quota on a backend you didn’t explicitly choose

How to pin

When your BYOK provider is OpenRouter, the Advanced settings panel shows an OpenRouter routing section with two fields:
  • Pin providers (in order) — comma-separated list of upstream names (e.g. moonshot, together). OpenRouter tries them in order and uses the first available.
  • Allow fallbacks — when off, requests hard-fail if none of the pinned providers are available. When on (default), OpenRouter can fall back to any other upstream that serves the model.
For a stable setup, pin a single provider and turn off fallbacks (Pin: moonshot, Allow fallbacks: off). Requests will always hit the same upstream or fail loudly — no silent quality changes. The tradeoff is zero resilience if that one upstream goes down; pair it with a different Routing Fallback (e.g. Anthropic) to absorb outages.
Upstream names must match OpenRouter’s catalog. Check the provider tags on openrouter.ai/docs/features/provider-routing — common values include moonshot, together, groq, fireworks, novita.
Under the hood, Kodus emits this into the Vercel AI SDK call:

Advanced: raw JSON override

If you need fields beyond order and allow_fallbacks (e.g. ignore, data_collection, require_parameters), switch Thinking to Custom in Advanced settings and paste the full routing payload — it’s merged into providerOptions alongside any reasoning config:

Concurrency and rate limits

The maxConcurrentRequests field (under Advanced settings) caps how many inflight requests Kodus sends to your provider in parallel. Most of the time, the default is fine — but subscription plans with strict concurrency caps need it set explicitly.

Values to set

When to tune it

Raise it

  • You have a high-tier recharge on Moonshot/OpenRouter and want higher throughput on big PRs
  • You bumped your GLM Coding Plan to Max and want to use the full 30-concurrent budget
  • Reviews feel serialized on multi-file PRs and you’re not seeing 429s

Lower it

  • You see 429 or Too much concurrency errors in review logs
  • Your provider warns about rate limits on the dashboard
  • You want to conserve Coding Plan window (5h/weekly) across more PRs
Concurrency vs. RPM vs. TPM. maxConcurrentRequests only caps parallel inflight requests. Many providers also enforce separate RPM (requests per minute) and TPM (tokens per minute) limits. If you’re hitting RPM/TPM while concurrency looks fine, the fix is usually to upgrade your tier or spread load across time — not to change maxConcurrentRequests.
Fallback interaction. When a task’s model hits a 429 and Kody fails over to the Routing Fallback, the Fallback’s own maxConcurrentRequests applies. Setting a generous Fallback on a different provider is a good way to absorb bursts when your main model is on a tight subscription.

Best Practices

Security

Dedicated Keys

Create separate API keys for Kodus. Makes usage auditing and key rotation easier.

Regular Rotation

Rotate keys periodically and update them in BYOK settings.

Monitor Usage

Check your provider dashboards for unusual patterns.

Secure Storage

Never commit keys to repositories. Kodus stores them encrypted at rest and in transit.

Routing strategy

  • Use a different provider for your default and fallback (e.g. Anthropic default, Google fallback). Protects against provider-specific outages.
  • Subscriptions with tight concurrency limits (GLM Coding Plan Lite/Pro, Kimi Code Plan) make poor solo configurations — pair them with a pay-per-token fallback so bursty PRs don’t starve.
  • Route the heavy tasks (deep code review) to your strongest model and the light ones (summaries, chat) to a cheaper one under Per agent.

Troubleshooting

  • Copy the key without extra spaces, quotes, or trailing newlines.
  • Confirm billing is enabled and the account has credits.
  • For GLM Coding Plan / Kimi Code Plan keys, make sure the base URL matches the plan — subscription keys don’t work on the Developer API endpoint and vice versa.
  • For the chat-probe providers (Anthropic-compatible, OpenAI-compatible, Novita), Test sends a real request to the model, so a wrong or misspelled model ID fails here — this is expected and better than failing at review time.
  • Copy the exact model ID from the provider’s dashboard. Some providers use deep paths (e.g. Fireworks accounts/fireworks/models/kimi-k2p7-code) or spell versions differently (k2p7 vs k2.7).
  • Verify the base URL matches the provider exactly (trailing slash matters for some).
  • For OpenAI-compatible providers, the endpoint is usually {baseURL}/chat/completions (Kodus adds the path).
  • Some models pin temperature or always reason (Kimi k2p7-code/k3, GLM-5.3; Claude 4.7+/GPT-5 remove temperature entirely). Test validates your tuning against the model’s rules and returns a specific message — follow it (leave temperature unset or use the required value; don’t turn reasoning Off on an always-reasoning model). See Temperature.
  • Lower Max concurrent requests in Advanced settings.
  • On GLM Coding Plan Lite/Pro, stay at 1 concurrent. Upgrade to Max (30 concurrent) if you need more throughput.
  • On Kimi Code Plan, the documented cap is 30 concurrent.
  • If Kodus is configured via .env (self-hosted Fixed Mode), the BYOK screen shows a blue info banner with the active provider/model — the key is never displayed for security.
  • Connecting a model and saving overrides the .env configuration.
  • Reasoning adds tokens. If cost is spiking, lower Thinking from Medium to Low, or route heavy tasks to a cheaper model under Per agent.
  • Check your provider dashboard for the per-model breakdown, and set a cap under the Budget tab.

Frequently Asked Questions

Yes. The change takes effect for the next review — no redeploy required.
Reviews automatically switch to the Routing Fallback if one is configured. Without a Fallback, the review fails and returns an error. Always configure a Fallback.
Every task uses the default model unless you override it per agent in Routing. If a task’s model fails (rate limit, 5xx, timeout, bad key), Kody retries once on the Fallback. You pay only for the provider that actually processed the call.
Yes — that’s what Routing → Per agent is for. Route deep code review to a strong model and summaries or chat to a cheaper one. You need at least two connected models for routing to be meaningful.
Yes. Keys are encrypted at rest and in transit and never logged in plain text. The BYOK status endpoint never returns the raw key.
Yes — via the OpenAI Compatible provider (under Custom). Enter your endpoint’s base URL, the model ID it exposes, and a placeholder API key (most self-hosted runtimes ignore the key header but still require one).