How this maps to plans
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
Routing
Budget
/byok. See Workspace Roles.Connect a provider
Open BYOK settings
Pick a provider
- 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.
Add a 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.
Tune advanced settings (optional)
Test and save
Test before you save
The Test button verifies your configuration before it can break a real review. What it does depends on the provider:- 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.
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.Policy
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).
Per agent
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
Gemini Pro
GPT (latest)
Kimi / GLM (coding plans)
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 (Moonshot AI)
- GLM (Z.ai)
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
- OpenAI
- Google Gemini
- Anthropic Claude
- Novita AI
- OpenRouter
- Google Vertex AI
- Amazon Bedrock
- OpenAI Compatible
- Anthropic-compatible
- Visit OpenAI API Keys
- Create a new key for Kodus
- 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: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
budgetTokensvalue 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,
usertagging, etc. The override is merged intoproviderOptions, so any adapter field passes through - The provider ships a new field Kodus hasn’t wrapped yet
Examples (paste directly — no namespace needed)
- Anthropic
- Google Gemini
- OpenAI
- OpenRouter
- OpenAI-compatible (Kimi, GLM, etc.)
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: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.thinkingbut forgetanthropic.effort, that field won’t be sent. OpenRouter routing (Pin providers / Allow fallbacks) is the one exception: it deep-merges with your override underopenrouter. - 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: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 onlythinking.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.
Advanced: raw JSON override
If you need fields beyondorder 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
ThemaxConcurrentRequests 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
429orToo much concurrencyerrors in review logs - Your provider warns about rate limits on the dashboard
- You want to conserve Coding Plan window (5h/weekly) across more PRs
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
Regular Rotation
Monitor Usage
Secure Storage
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
'Invalid API key' when clicking Test
'Invalid API key' when clicking Test
- 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.
'Model not found' when clicking Test
'Model not found' when clicking Test
- 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 (k2p7vsk2.7).
'Endpoint not found' when clicking Test
'Endpoint not found' when clicking Test
- 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).
Test rejects the temperature or reasoning I set
Test rejects the temperature or reasoning I set
- 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.
'Rate limited' or 'Too much concurrency'
'Rate limited' or 'Too much concurrency'
- 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.
Self-hosted env vars not showing
Self-hosted env vars not showing
- 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
.envconfiguration.
High or unexpected costs
High or unexpected costs
- 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
Can I switch providers anytime?
Can I switch providers anytime?
What happens if my API key runs out of credits?
What happens if my API key runs out of credits?
How does the default / fallback system work?
How does the default / fallback system work?
Can different tasks use different models?
Can different tasks use different models?
Do you store our API keys securely?
Do you store our API keys securely?
Can I use a self-hosted LLM (e.g. Ollama, vLLM)?
Can I use a self-hosted LLM (e.g. Ollama, vLLM)?