Kilo Code
Connect Kilo Code in VS Code or JetBrains to Inference.net with the OpenAI Compatible provider, verified 1M-context models, and prompt caching.
Last updated
Connect Kilo Code to Inference.net by choosing the OpenAI Compatible API provider, setting Base URL to https://api.inference.net/v1, pasting your Inference.net API key, and entering a verified tool-calling model ID such as deepseek-v4.1-flash-1017, glm-5.3, or moonshotai/kimi-k3.
Quick configuration
If you do not have a key yet, create a free account and generate a project key in API keys. Enter these values in Kilo Code's provider settings:
| Setting | Value |
|---|---|
| API Provider | OpenAI Compatible |
| Base URL | https://api.inference.net/v1 |
| US-only Base URL (optional) | https://us.api.inference.net/v1 |
| API Key | Your Inference.net API key (inf_sk_...) |
| Model ID | deepseek-v4.1-flash-1017 (or any verified tool model below) |
| Custom Header (optional) | x-inference-task-id: kilo-code |
Set up Kilo Code in VS Code or JetBrains
Open Kilo Code provider settings
Open the Kilo Code panel in VS Code or JetBrains and click the Settings (gear) icon to manage your API configuration profiles.
Create an OpenAI Compatible profile
Create a new profile (for example,
inference-deepseek) and set API Provider to OpenAI Compatible.Set Base URL and API key
Set Base URL to:
texthttps://api.inference.net/v1Use
https://us.api.inference.net/v1if you want requests pinned to US-hosted GPU clusters for US-served models (marked with theUSbadge in the model catalog). Paste your key from API keys into API Key.Enter Model ID and model limits
Enter
deepseek-v4.1-flash-1017in Model ID, then expand Model Configuration and set:- Context Window Size:
1040000 - Max Output Tokens:
393216 - Supports Images: Enabled (for
deepseek-v4.1-flash-1017,glm-5.3-flash,moonshotai/kimi-k3, andmoonshotai/kimi-k3.1-pro) - Supports Prompt Cache: Enabled
- Context Window Size:
Optional: tag requests for usage reporting
Under Custom Headers, add
x-inference-task-idset tokilo-codeso you can filter Kilo Code spend and cache hits on the Usage page.Save and run a verification task
Save the profile, start a new Kilo Code task, and ask it to inspect a file in your repository. Confirm tool calls succeed and check token counts under Usage.
Copy-paste JSON profile for Kilo Code
Kilo Code supports importing and exporting JSON provider profiles (the same OpenAI-compatible schema used by Roo Code). Save the snippet below as a local file, replace inf_sk_... with your real key, and import it from Kilo Code Settings. Never commit API keys to git.
{
"providerProfiles": {
"currentApiConfigName": "inference-deepseek",
"apiConfigs": {
"inference-deepseek": {
"apiProvider": "openai",
"openAiBaseUrl": "https://api.inference.net/v1",
"openAiApiKey": "inf_sk_...",
"openAiModelId": "deepseek-v4.1-flash-1017",
"openAiHeaders": {
"x-inference-task-id": "kilo-code"
},
"openAiCustomModelInfo": {
"contextWindow": 1040000,
"maxTokens": 393216,
"supportsImages": true,
"supportsPromptCache": true,
"inputPrice": 0.08,
"outputPrice": 0.635,
"cacheReadsPrice": 0.007
}
},
"inference-glm": {
"apiProvider": "openai",
"openAiBaseUrl": "https://api.inference.net/v1",
"openAiApiKey": "inf_sk_...",
"openAiModelId": "glm-5.3",
"openAiHeaders": {
"x-inference-task-id": "kilo-code"
},
"openAiCustomModelInfo": {
"contextWindow": 1048576,
"maxTokens": 943718,
"supportsImages": false,
"supportsPromptCache": true,
"inputPrice": 0.084,
"outputPrice": 3.0,
"cacheReadsPrice": 0.079
}
},
"inference-kimi": {
"apiProvider": "openai",
"openAiBaseUrl": "https://api.inference.net/v1",
"openAiApiKey": "inf_sk_...",
"openAiModelId": "moonshotai/kimi-k3",
"openAiHeaders": {
"x-inference-task-id": "kilo-code"
},
"openAiCustomModelInfo": {
"contextWindow": 1048576,
"maxTokens": 1048576,
"supportsImages": true,
"supportsPromptCache": true,
"inputPrice": 0.245,
"outputPrice": 15.0,
"cacheReadsPrice": 0.224
}
}
}
}
}You can bind different profiles to Kilo Code modes (for example, inference-glm or moonshotai/kimi-k3.1-pro for Architect mode and inference-deepseek for Code and Debug modes).
Verified flagship models for Kilo Code
Kilo Code relies on tool calls to read files, apply diffs, and run terminal commands. All models below expose supports_tools: true in GET https://api.inference.net/v1/models (verified 2026-12-06):
| Model ID | Context window | Max output | Input / Cached / Output ($/1M) | Image input | Model page |
|---|---|---|---|---|---|
deepseek-v4.1-flash-1017 | 1,040,000 | 393,216 | $0.08 / $0.007 / $0.635 | Yes | DeepSeek V4.1 Flash |
glm-5.3 | 1,048,576 | 943,718 | $0.084 / $0.079 / $3.00 | No | GLM 5.3 |
glm-5.3-flash | 1,048,576 | 262,144 | $0.10 / $0.03 / $0.35 | Yes | GLM 5.3 Flash |
moonshotai/kimi-k3 | 1,048,576 | 1,048,576 | $0.245 / $0.224 / $15.00 | Yes | Kimi K3 |
moonshotai/kimi-k3.1-pro | 1,048,576 | 1,048,576 | $1.80 / $0.198 / $9.00 | Yes | Kimi K3.1 Pro |
Prompt caching tips for Kilo Code
Multi-turn Kilo Code sessions replay your system instructions, workspace rules, and tool schemas on every step. Follow these practices to capture automatic $0.007/1M cached input reads on deepseek-v4.1-flash-1017 (a 91.3% reduction vs. $0.08/1M fresh input):
- Keep workspace rules and custom instructions stable: Avoid editing
.kilocode/rulesor toggling MCP servers mid-task. Any change to the leading system prompt or tool list invalidates the cached prefix. - Stay in one mode across multi-step edits: Switching modes mid-session changes the system prompt and starts a fresh cache prefix. Use Architect mode to write a plan, then start a clean Code task when implementing.
- Enable
Supports Prompt Cachein Model Configuration: AddingcacheReadsPricein your custom model info lets Kilo Code display accurate cached-token cost estimates in the task header. - Estimate your savings: Model your repository size and turn count in the Prompt Cache Calculator or LLM Pricing Calculator.
Verify connectivity with cURL
If requests fail inside your editor, verify your key and model ID directly from a terminal:
export INFERENCE_API_KEY="inf_sk_..."
curl https://api.inference.net/v1/chat/completions \
-H "Authorization: Bearer $INFERENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017",
"messages": [{"role": "user", "content": "Reply with OK."}]
}'Troubleshooting
401 Unauthorized: Re-paste your API key without whitespace and confirm it is active on API keys.404or HTML response: Confirm Base URL ishttps://api.inference.net/v1(with/v1), nothttps://inference.net/v1.- Model not found: Keep exact owner prefixes from
GET https://api.inference.net/v1/models(for example,moonshotai/kimi-k3rather thankimi-k3). - Context limit errors: Ensure Context Window Size and Max Output Tokens do not exceed the model's
context_lengthandmax_completion_tokensinGET /v1/models. - Inference Pass plan keys: Plan keys work directly in Kilo Code for models included in your plan. Check API keys for plan rules.
Ready to start? Create an API key for DeepSeek V4.1 Flash, explore the model catalog, or browse all guides in the Integrations hub.