Developer field guide
Kimi CLI setup with an AngelAPI key
Need a step-by-step Kimi CLI setup guide backed by prepaid token packs in Malaysian Ringgit or USD? Below we document how to connect Moonshot's terminal coding agent using verified official documentation, what changed between the legacy kimi-cli package and its successor Kimi Code CLI, and how one AngelAPI key runs Kimi K2.5–K3, GLM 5.4, and DeepSeek V4.1 Flash from a single config file.
Kimi CLI vs Kimi Code CLI: what the official docs state
Moonshot AI officially archived the original Python kimi-cli repository and replaced it with Kimi Code CLI (CLI command: kimi, available via npm @moonshot-ai/kimi-code or Moonshot's standalone installer). Legacy installations of Python kimi-cli no longer receive updates or security patches. Crucially for API developers, the modern Kimi Code CLI explicitly documents support for third-party OpenAI-compatible gateways alongside native Moonshot endpoints—letting you point base_url at AngelAPI without hacking client code.
Configure Kimi CLI with an OpenAI-compatible AngelAPI key & base URL
Verified against official Kimi Code CLI configuration docs (moonshotai.github.io/kimi-code), add a provider block inside ~/.kimi-code/config.toml (or relocate via KIMI_CODE_HOME). Notice two important rules: quote model table keys that contain dots (for example [models."angelapi/kimi-k3"]), and never set both api_key and api_key_env at once because the credential parser treats them as mutually exclusive. Using api_key_env = "ANGELAPI_KEY" keeps plaintext secrets out of dotfiles cleanly:
default_model = "angelapi/kimi-k3"
[providers.angelapi]
type = "openai"
base_url = "https://api.angelapi.cc/v1"
api_key_env = "ANGELAPI_KEY"
[models."angelapi/kimi-k3"]
provider = "angelapi"
model = "kimi-k3"
max_context_size = 262144
[models."angelapi/kimi-k2.5"]
provider = "angelapi"
model = "kimi-k2.5"
max_context_size = 262144
[models."angelapi/glm-5.4"]
provider = "angelapi"
model = "glm-5.4"
max_context_size = 262144export ANGELAPI_KEY="YOUR_ANGELAPI_KEY"
kimi --config '{"default_model":"angelapi/kimi-k3","providers":{"angelapi":{"type":"openai","base_url":"https://api.angelapi.cc/v1","api_key_env":"ANGELAPI_KEY"}},"models":{"angelapi/kimi-k3":{"provider":"angelapi","model":"kimi-k3","max_context_size":262144}}}'Interactive /provider setup vs TOML config overrides
If you prefer interactive menus over hand-editing TOML tables, install Kimi Code CLI, run kimi inside your project directory, and enter /provider in the TUI. Selecting [ Add New Platform ] lets you register an OpenAI-compatible base URL (https://api.angelapi.cc/v1) and paste an AngelAPI key obtained from your signed-in Account after buying any prepaid pack from RM1.12 on Pricing.
Note one security guardrail from Moonshot's own CLI credential rules: outside explicit api_key_env bindings in config.toml, Kimi Code CLI does not blindly scrape random shell environment variables at startup. Setting api_key_env = "ANGELAPI_KEY" in your TOML table guarantees predictable credential loading across terminal tabs and CI containers.
Live Kimi and alternative models to pair inside Kimi CLI
Because your TOML config supports switching across multiple [models."..."] blocks under one provider, you can reserve heavy 1M-context Kimi K3 calls for complex refactoring while keeping rapid low-cost loops on DeepSeek V4.1 Flash or GLM 5.4:
| Model ID | Status | Context / Max out | Input mult (MYR / 1M) | Output mult (MYR / 1M) | Est. coding (MYR / 1M) |
|---|---|---|---|---|---|
deepseek-v4.1-flash (DeepSeek guide) | online | 1M / 384K | ×0.1659 (RM0.0186) | ×0.6638 (RM0.0743) | ×0.0917 (RM0.0103) |
glm-5.4 (GLM guide) | online | 1M / 128K | ×1.55 (RM0.174) | ×4.8715 (RM0.546) | ×0.9008 (RM0.101) |
kimi-k2.5 (Kimi guide) | online | 164K / 32K | ×0.9492 (RM0.106) | ×4.8539 (RM0.544) | ×0.9208 (RM0.103) |
kimi-k3 (Kimi guide) | online | 1M / 128K | ×4 (RM0.448) | ×20 (RM2.240) | ×2.5091 (RM0.281) |
| Pack | Prepaid tokens | MYR price | Rate per 1M units |
|---|---|---|---|
| 10M | 10M | RM1.12 | RM0.112 |
| 50M | 50M | RM5.59 | RM0.112 |
| 100M | 100M | RM11.18 | RM0.112 |
| 200M | 200M | RM22.35 | RM0.112 |
| 300M | 300M | RM33.53 | RM0.112 |
| 500M | 500M | RM55.88 | RM0.112 |
| 1B | 1B | RM111.77 | RM0.112 |
Kimi CLI vs Claude Code CLI vs OpenCode workflows
| Feature | Kimi Code CLI | Claude Code CLI | OpenCode CLI |
|---|---|---|---|
| Gateway protocol | openai (/v1) or Anthropic | Anthropic (/v1/messages) | @ai-sdk/openai-compatible |
| Custom provider UI | Interactive /provider TUI + TOML | Env vars or ~/.claude/settings.json | /connect + opencode.json |
| Prepaid AngelAPI pack support | Yes via https://api.angelapi.cc/v1 | Yes via https://api.angelapi.cc | Yes via https://api.angelapi.cc/v1 |
Troubleshooting Kimi CLI config.toml and endpoint errors
- Validation warning ignoring a config section: TOML section names are case-sensitive and snake_case (
default_model,max_context_size). Always quote dotted model IDs inside[models."angelapi/..."]brackets so TOML does not split dots into nested tables. - 401 authentication failure at startup: Confirm
ANGELAPI_KEYis exported in the same shell session runningkimiand verify you did not set bothapi_keyandapi_key_envtogether. - Compare alternative setups: See our OpenCode API setup or Claude Code custom API tutorial, and check live status before picking a primary model ID.
Related model APIs and developer guides
Frequently asked questions
Does Kimi CLI still use the old Python kimi-cli repository?
No. Moonshot AI officially archived the Python kimi-cli repo and replaced it with Kimi Code CLI (command: kimi), which continues to support ~/.kimi-code/config.toml custom providers.
Does Kimi Code CLI accept a custom API base URL and AngelAPI key?
Yes. According to Moonshot’s Kimi Code CLI provider docs, setting type = "openai" with base_url = "https://api.angelapi.cc/v1" and api_key_env = "ANGELAPI_KEY" in ~/.kimi-code/config.toml routes tool calls cleanly through AngelAPI.
Can I configure AngelAPI interactively inside Kimi CLI without editing TOML by hand?
Yes. Start kimi in your terminal and run /provider to open the interactive provider manager where custom OpenAI-compatible endpoints and keys can be registered.
Is AngelAPI affiliated with Moonshot AI or Kimi Code CLI?
No. AngelAPI is an independent third-party prepaid API gateway that provides OpenAI-compatible routing usable by Kimi Code CLI.
Related developer guides
- Cheap Claude Code API cost comparison
- Use Claude Code with a custom API
- GLM API Malaysia setup & MYR payment
- Claude Code alternative models & tools
- Claude Code vs Codex comparison
- Cursor vs Claude Code setup guide
- OpenCode API setup & comparison
- AI API pricing & ChatGPT API cost guide
- Free AI API & AI API key honest guide
- Cheap AI API & low-cost LLM API guide
- OpenRouter alternative (MYR & crypto)