Kilo Code API setup: configuration and troubleshooting
Kilo Code is an open-source coding agent that ships as a VS Code extension and a CLI. Add FlyRouter as a custom provider and Claude, GPT and other models all work.
Updated:
Set up in the VS Code extension
Open provider settings
Click the settings icon in the Kilo Code panel, open the Providers tab, scroll to the bottom and click Custom provider.
Fill in the provider
| Field | Value |
|---|---|
| Provider ID | flyrouter |
| Display name | FlyRouter |
| Provider API | OpenAI Compatible |
| Base URL | https://api.flyrouter.ai/v1 |
| API key | Your FlyRouter key (sk-...) |
Choose models
Once the base URL and key are in, Kilo Code fetches the model list. Tick the models you want under Models. If nothing loads, click Fetch models to retry, or type model IDs by hand, for example claude-sonnet-5-5 or gpt-6.1-sol.
Save and test
Click Submit, pick a FlyRouter model in the model picker and send a message.
Set up in the CLI
The Kilo Code CLI reads ~/.config/kilo/kilo.jsonc (a kilo.jsonc in the project root takes priority):
{
"model": "flyrouter/claude-sonnet-5-5",
"provider": {
"flyrouter": {
"name": "FlyRouter",
"options": {
"baseURL": "https://api.flyrouter.ai/v1",
"apiKey": "sk-..."
},
"models": {
"claude-sonnet-5-5": { "name": "Claude Sonnet 5.5" },
"gpt-6.1-sol": { "name": "GPT-6.1 Sol" }
}
}
}
}The top-level model field sets the default model, written as provider ID/model ID.
A custom provider does not detect a model's context length or output limit and falls back to defaults. If you hit context errors, set the model's real limits in kilo.jsonc.
Troubleshooting
- Invalid API Key: check the key is complete, with no stray spaces.
- Model Not Found: use the model ID exactly as shown on the pricing page, without a vendor prefix.
- Connection errors or 404: the base URL must include
/v1.