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:

~/.kimi-code/config.toml
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 = 262144
Single-run inline --config flag
export 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 IDStatusContext / Max outInput mult (MYR / 1M)Output mult (MYR / 1M)Est. coding (MYR / 1M)
deepseek-v4.1-flash (DeepSeek guide)online1M / 384K×0.1659 (RM0.0186)×0.6638 (RM0.0743)×0.0917 (RM0.0103)
glm-5.4 (GLM guide)online1M / 128K×1.55 (RM0.174)×4.8715 (RM0.546)×0.9008 (RM0.101)
kimi-k2.5 (Kimi guide)online164K / 32K×0.9492 (RM0.106)×4.8539 (RM0.544)×0.9208 (RM0.103)
kimi-k3 (Kimi guide)online1M / 128K×4 (RM0.448)×20 (RM2.240)×2.5091 (RM0.281)
PackPrepaid tokensMYR priceRate per 1M units
10M10MRM1.12RM0.112
50M50MRM5.59RM0.112
100M100MRM11.18RM0.112
200M200MRM22.35RM0.112
300M300MRM33.53RM0.112
500M500MRM55.88RM0.112
1B1BRM111.77RM0.112

Kimi CLI vs Claude Code CLI vs OpenCode workflows

FeatureKimi Code CLIClaude Code CLIOpenCode CLI
Gateway protocolopenai (/v1) or AnthropicAnthropic (/v1/messages)@ai-sdk/openai-compatible
Custom provider UIInteractive /provider TUI + TOMLEnv vars or ~/.claude/settings.json/connect + opencode.json
Prepaid AngelAPI pack supportYes via https://api.angelapi.cc/v1Yes via https://api.angelapi.ccYes 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_KEY is exported in the same shell session running kimi and verify you did not set both api_key and api_key_env together.
  • 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

Share this guide on Telegram