Install Kilo Code and Connect It to Moyi API
Kilo Code is an open-source AI coding agent for VS Code (it also has a CLI). It lets you add your own provider and choose which API protocol to use for it, so you can run Claude, GPT and other models in Kilo Code with one Moyi API API key.
New accounts start with a $0 balance — top up before your first request. Top up from $5. If a request returns 402 with "wallet balance is insufficient", your balance is empty — your base URL and key are fine. Top up and retry.
Field names below were checked against Kilo Code's documentation on 2026-11-03 (Kilo Code 7.8). We tested every connection on this page with the Kilo CLI 7.8.18, which uses the same configuration as the VS Code extension.
1. Install Kilo Code
Already have Kilo Code? Skip to "2. Get your Moyi API API Key".
- Open VS Code and press
Command + Shift + Xon macOS, orCtrl + Shift + Xon Windows and Linux, to open Extensions. - Search for Kilo Code.
- Click the dropdown arrow next to Install and choose Install Pre-Release Version. Kilo publishes its current extension on the pre-release channel and recommends it for all users.
- Click the Kilo Code icon in the side bar to open the chat panel.
VS Code-compatible editors without the Microsoft marketplace (VSCodium, Windsurf and others) can install it from Open VSX. On first launch Kilo Code asks you to sign in to a free Kilo account. You don't need Kilo credits to use Moyi API.
2. Get your Moyi API API Key
Open the Moyi API dashboard, create an account, create an API Key and copy it.
3. Add Moyi API as a custom provider
Kilo Code lets you choose the API protocol for each custom provider. Pick the protocol by model family, so add Moyi API once per family you use:
| Models | Provider API | Base URL | Why |
|---|---|---|---|
| Claude | Anthropic Messages | https://api.moyi-api.com/v1 |
Native Claude protocol, so prompt caching and thinking work |
| GPT | OpenAI Responses | https://api.moyi-api.com/v1 |
Kilo recommends Responses for OpenAI models |
| DeepSeek, GLM, Kimi, Qwen, MiniMax, Gemini, Grok | OpenAI Compatible | https://api.moyi-api.com/v1 |
Chat Completions format |
To add one:
- In the Kilo Code panel, click the gear icon to open Settings, then open the Providers tab.
- Scroll to the bottom and click Custom provider.
- Fill in the dialog. For Claude, for example:
- Provider ID:
moyiapi-claude(any unique name; usemoyiapi-gptandmoyiapifor the other two) - Display name:
Moyi API Claude - Provider API: Anthropic Messages
- Base URL:
https://api.moyi-api.com/v1(keep/v1) - API key: the key you created in the Moyi API dashboard
- Models: pick models from the list Kilo Code fetches, or add model IDs by hand, such as
claude-opus-5-5,claude-sonnet-5-5andclaude-haiku-5-5. Only add Claude models to this provider. - Headers: leave empty.
- Provider ID:
- Click Submit. Repeat for GPT (OpenAI Responses) and for other models (OpenAI Compatible) if you use them.
Don't add Claude models to the OpenAI Compatible provider. Over the OpenAI format, Claude requests can miss the prompt cache, which costs more. In our test through Anthropic Messages, the second step of a task read Kilo Code's whole 54,000-token prompt from cache.
Model IDs you can use:
GPT9
gpt-6.1-solgpt-6-astragpt-6-solgpt-6-lunagpt-5.6-solgpt-5.6-terragpt-5.6-lunagpt-5.5gpt-5.4
Claude12
claude-opus-5-5claude-sonnet-5-5claude-haiku-5-5claude-fable-5-1claude-opus-5claude-fable-5claude-sonnet-5claude-opus-4-8claude-opus-4-7claude-opus-4-6claude-sonnet-4-6claude-haiku-4-5
Gemini5
gemini-3.8-flashgemini-3.7-flashgemini-3.6-flashgemini-3.5-flash-litegemini-3.1-pro-preview
DeepSeek4
deepseek-flashdeepseek-v4-flash-vision-expdeepseek-v4-prodeepseek-v4-flash
GLM3
glm-5.3-flashglm-5.3glm-5.2
Grok1
grok-4.6
Or edit kilo.json directly
The extension and the CLI both save providers in kilo.json (~/.config/kilo/kilo.json for all projects, or kilo.json in a project folder). You can paste the configuration instead of using the dialog. This is the configuration we tested:
{
"provider": {
"moyiapi-claude": {
"npm": "@ai-sdk/anthropic",
"name": "Moyi API Claude",
"options": { "baseURL": "https://api.moyi-api.com/v1", "apiKey": "your Moyi API API Key" },
"models": {
"claude-opus-5-5": { "name": "Claude Opus 5.5", "limit": { "context": 200000, "output": 16384 } },
"claude-sonnet-5-5": { "name": "Claude Sonnet 5.5", "limit": { "context": 200000, "output": 16384 } }
}
},
"moyiapi-gpt": {
"npm": "@ai-sdk/openai",
"name": "Moyi API GPT",
"options": { "baseURL": "https://api.moyi-api.com/v1", "apiKey": "your Moyi API API Key" },
"models": {
"gpt-6.1-sol": { "name": "GPT-6.1 Sol", "limit": { "context": 200000, "output": 16384 } }
}
},
"moyiapi": {
"npm": "@ai-sdk/openai-compatible",
"name": "Moyi API",
"options": { "baseURL": "https://api.moyi-api.com/v1", "apiKey": "your Moyi API API Key" },
"models": {
"deepseek-v4-pro": { "name": "DeepSeek V4 Pro", "limit": { "context": 128000, "output": 8192 } }
}
}
},
"model": "moyiapi-claude/claude-sonnet-5-5"
}
limit tells Kilo Code how much context it can use and how long a reply can be, so it knows when to compact a long conversation.
4. Start using Kilo Code
- In the Kilo Code chat panel, open the model picker and choose a Moyi API model.
- Describe the task in plain language, for example "add error handling to src/api.ts", and press Enter.
- Kilo Code reads files, edits code and asks before running shell commands. To change what needs approval, open Settings → Auto-Approve.
Common errors
- 402 "wallet balance is insufficient": your Moyi API balance is $0. Top up and retry.
- 401 or "Invalid API Key": check that the key was pasted in full, without spaces, and that it hasn't been deleted in the dashboard.
- 404 or "Model Not Found": check the model ID spelling, and that the model is added to the right provider (Claude under Anthropic Messages, GPT under OpenAI Responses).
- No model list after filling in the base URL: check that the base URL ends in
/v1, then click Fetch models. You can always type model IDs by hand. - Connection errors: check that
https://api.moyi-api.comopens from your network and that VS Code's proxy settings are correct.