Use Kimi (Moonshot) as a coding agent
Export MOONSHOT_API_KEY and run oharness -m moonshot/kimi-k2.7-code. A Kimi Code subscription is a separate provider, kimi-coding, with its own key variable.
Three commands
npm install -g oharnessexport MOONSHOT_API_KEY="..."oharness -m moonshot/kimi-k2.7-codeWhich model
| Model id | Context | Input / cached / output ($/M) |
|---|---|---|
kimi-k2.7-code | 256K | 0.95 / 0.19 / 4.00 |
kimi-k2.6 | 256K | 0.95 / 0.16 / 4.00 |
kimi-k3 | 1M | 3.00 / 0.30 / 15.00 |
List prices from the models.dev snapshot OHarness ships (2026-09-19).
Mainland accounts
The moonshot provider points at the international platform. A mainland account uses api.moonshot.cn — override the base URL:
{ "providers": { "moonshot": { "baseUrl": "https://api.moonshot.cn/v1" } } }Kimi Code plan
export KIMI_CODING_API_KEY="..."Then pick a model from the kimi-coding provider under /models. The plan key is refused on the pay-as-you-go host and vice versa, which is why the two are separate providers.
Common questions
Can I use Kimi with a Claude Code-style agent?
Yes. OHarness has Moonshot as a built-in provider: set MOONSHOT_API_KEY (or KIMI_API_KEY) and run oharness -m moonshot/kimi-k2.7-code.
What is the Kimi API base URL?
https://api.moonshot.ai/v1 for the international platform and https://api.moonshot.cn/v1 for mainland accounts. Both are OpenAI-compatible.
Moonshot (Kimi) reference
| Provider id | moonshot |
| Base URL | https://api.moonshot.ai/v1 |
| Protocol | OpenAI-compatible chat completions |
| API key | MOONSHOT_API_KEY or KIMI_API_KEY |
| Model discovery | Yes — the model list is asked of the endpoint rather than shipped. |
Connecting it
The endpoint above is built in, so there is nothing to configure. Put the key in the environment and the provider appears in the model picker:
export MOONSHOT_API_KEY="..."Keys are issued by Moonshot (Kimi) — where to get one.
Models on Moonshot (Kimi)
The newest models Moonshot (Kimi) serves that can call tools, from the models.dev snapshot OHarness ships. The harness also asks the endpoint for its live list, so a model released after this snapshot still appears in the picker.
| Model id | Context / output | $/M in / cached / out | Reasoning |
|---|---|---|---|
kimi-k3 | 1.05M / 131K | 3 / 0.3 / 15 | Yes |
kimi-k2.7-code | 262K / 262K | 0.95 / 0.19 / 4 | Yes |
kimi-k2.7-code-highspeed | 262K / 262K | 1.9 / 0.38 / 8 | Yes |
kimi-k2.6 | 262K / 262K | 0.95 / 0.16 / 4 | Yes |
List prices in USD per million tokens, read from models.dev on 2026-09-19. Moonshot (Kimi) changes its prices and models; its own pricing page is the authority. Start a session on the newest:
oharness -m moonshot/kimi-k3Worth knowing
The international platform. Mainland accounts use https://api.moonshot.cn/v1 — override baseUrl in a user catalog. A Kimi Code plan is a separate endpoint; see kimi-coding.
Pointing it somewhere else
A regional host, a gateway, or a server of your own. Overrides in ~/.oharness/config.json are field level, so changing the endpoint does not mean restating the rest of the provider — this is the whole block, shown holding the default so the shape is clear:
{
"providers": {
"moonshot": {
"baseUrl": "https://api.moonshot.ai/v1"
}
}
}What you get either way
The same agent loop, the same tools, the same MCP servers and the same permission rules, whichever provider is underneath — and switching between them mid-session converts nothing, because history is never stored in a vendor’s shape. What an agent harness is covers why that is the hard part, and the providers reference covers the catalogue itself.