Kilo Code: custom provider and kilo.jsonc limits
Add uttapen to Kilo Code as an OpenAI Compatible provider, set limit.context and limit.output in kilo.jsonc, and pick a cheap Small Model for titles.
Updated: 22 Sep 2026
Kilo Code version 7 is built on the opencode core and shares one config file across VS Code, JetBrains and the terminal. You add uttapen as a Custom provider. This page was checked against Kilo's official docs for 7.x.
Adding the provider in the UI
- Settings (gear) → Providers tab → Custom provider at the bottom of the list.
- Fill in the dialog:
| Field | Value |
|---|---|
| Provider ID | uttapen (lowercase) |
| Display name | uttapen |
| Provider API | OpenAI Compatible |
| Base URL | https://api.uttapen.ir/v1 |
| API key | your sk-up-… key from Dashboard → API keys |
- Once the URL is valid, Kilo fetches the catalogue from
GET /v1/models; pick the models you want from that list and press Submit.
Kilo's docs suggest OpenAI Responses for OpenAI models and Anthropic Messages for Anthropic ones. Don't follow that here: both point at endpoints uttapen doesn't serve. Always choose OpenAI Compatible, including for openai/… and anthropic/… ids.
Output and context limits in kilo.jsonc
The dialog has no token-limit fields; those live in the config file, either ~/.config/kilo/kilo.jsonc globally or kilo.jsonc in the project root.
{
"$schema": "https://app.kilo.ai/config.json",
"provider": {
"uttapen": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"apiKey": "{env:UTTAPEN_API_KEY}",
"baseURL": "https://api.uttapen.ir/v1"
},
"models": {
"anthropic/claude-sonnet-5": {
"name": "Claude Sonnet 5",
"tool_call": true,
"limit": { "context": 200000, "output": 8192 }
},
"openai/gpt-5-nano": {
"name": "GPT-5 nano",
"limit": { "context": 400000, "output": 1024 }
}
}
}
},
"model": "uttapen/anthropic/claude-sonnet-5",
"small_model": "uttapen/openai/gpt-5-nano"
}
limit.outputis sent to us asmax_tokens, and Kilo's internal default for it is 32,000. Since uttapen reserves the cost of that ceiling before the request goes out (pricing), a large number locks up your balance for nothing.8192is enough for code edits.- Leave
limitout and both values resolve to zero, which disables automatic context management: the conversation is never compacted and each prompt grows larger and pricier. {env:UTTAPEN_API_KEY}reads the key from the environment, so it never sits in the file.- Kilo model names are
provider_id/model_idand only the first/separates them, souttapen/anthropic/claude-sonnet-5is correct.
Always set a Small Model
Kilo uses the Small Model (the Settings → Models tab, or the small_model key) for session titles, commit messages and prompt enhancement. Leave it empty and Kilo first looks for a cheap model on the same provider; because our custom provider isn't in its built-in catalogue, it either falls back to Kilo's own service or reuses your main model with the same large reservation. Point it at something cheap such as openai/gpt-5-nano or google/gemini-2.5-flash-lite.
For the main model, take ids from the model list: anthropic/claude-sonnet-5 and openai/gpt-5 for heavy work, qwen/qwen3-coder and deepseek/deepseek-v3.2 when cost matters.
Checking that it works
Send a small request from the Kilo panel or the CLI, then look at Dashboard → Usage: you should see two rows, one for the main model and a tiny one for the Small Model.
Troubleshooting
| Error | Cause in Kilo | Fix |
|---|---|---|
401 invalid_api_key | The key isn't stored on the provider, or the environment variable is empty | Re-enter the key in the provider dialog, or export UTTAPEN_API_KEY |
404 model_not_found | A hand-typed, wrong model id | Pick from Kilo's fetched list (the 404 also lists the closest ids it guessed, in uttapen.suggestions) |
404 not_found | Provider API is OpenAI Responses or Anthropic Messages | Switch to OpenAI Compatible |
402 insufficient_balance | Oversized hold from a missing limit.output, or a low balance | Set limit.output and top up |
429 | The key's rate or monthly limit (rate limits) | Wait, or raise the key's limit |
| "Response may be incomplete" warning | The model hit limit.output | Raise it, or turn reasoning off |
If your available balance can't cover the full max_tokens, uttapen trims the output ceiling to fit the balance (never below 1,024 tokens) and returns the granted value in the X-Uttapen-Max-Tokens header — which is when you see Kilo's "response may be incomplete" warning. Only if even 1,024 tokens don't fit do you get 402.
Other tools live in integrations; error codes are in errors.
Sign up with a phone number, top up your wallet from 100,000 toman and create a key. Free models work without a top-up — up to 50 requests a day. Create an API key →