Skip to content
Integration · Moonshot's terminal coding agent for Kimi models

Use g0i in Kimi Code CLI

Moonshot AI's official CLI (kimi-code-cli) for agentic coding with the Kimi K-series. Point it at g0i and run Kimi K3 plus the K2.7 variants through one OpenAI-compatible endpoint.

Why pair Kimi Code CLI with g0i

  • Genuine Kimi K3 (1M context) and all K2.x variants through one key
  • Auto-failover across a healthy pool — no dead upstreams to babysit
  • kimi provider add reads g0i's registry directly — no manual model list
  • Thinking + tool_use pass through cleanly for agentic loops
One-command setup

Set up Kimi Code CLI automatically

Paste one command, paste your API key, pick Kimi Code CLI — the script installs it if it's missing and writes the config for you. No files to edit; your old config is backed up.

Open a terminal and paste:

curl -fsSL https://g0i.ai/install.sh.txt | bash
  1. 1. Paste the command
  2. 2. Paste your key from API keys
  3. 3. Choose your tool and model

Re-run it any time to switch key or model. Prefer doing it by hand? The manual steps are below.

Manual setup

Kimi Code CLI reads a config.toml. Either import g0i as a custom registry (kimi provider add) or drop the config below into ~/.kimi-code/config.toml (Windows: %USERPROFILE%\.kimi-code\config.toml) with your key. Install: npm i -g @moonshot-ai/kimi-code or the official script at code.kimi.com.

Base URL
https://api.g0i.ai/v1
API key
your-api-key (from g0i.ai/api-keys)
Provider type
openai
Default model
kimi-k3
# Option A — import g0i as a custom registry (auto-populates models):
kimi provider add https://api.g0i.ai/v1/models --api-key your-api-key

# Option B — write ~/.kimi-code/config.toml directly:
# Kimi Code CLI — custom provider: g0i.ai (OpenAI-compatible)
default_model = "kimi-k3"
default_permission_mode = "manual"
default_plan_mode = false
telemetry = false

[providers.g0i]
type = "openai"
base_url = "https://api.g0i.ai/v1"
api_key = "your-api-key"

[models."kimi-k3"]
provider = "g0i"
model = "kimi-k3"
max_context_size = 1048576
max_output_size = 8192
capabilities = ["thinking", "tool_use"]
display_name = "Kimi K3"

[models."kimi-k2.7"]
provider = "g0i"
model = "kimi-k2.7"
max_context_size = 200000
max_output_size = 8192
capabilities = ["thinking", "tool_use"]
display_name = "Kimi K2.7"

[models."kimi-k2.7-code"]
provider = "g0i"
model = "kimi-k2.7-code"
max_context_size = 262144
max_output_size = 8192
capabilities = ["thinking", "tool_use"]
display_name = "Kimi K2.7 Code"

[thinking]
enabled = true
effort = "high"
keep = "all"

[loop_control]
max_attempts_per_step = 10
reserved_context_size = 50000
Don't have a key yet? Sign up at g0i.ai/register — redeem a voucher or buy a plan to start.

Recommended models

Any of these can be used in Kimi Code CLI. Pick by task — see the full catalog at Models & Pricing.

Kimi K3
Flagship — 1M context, thinking + tool_use
kimi-k3
Kimi K2.7 Code
Code-tuned, 256K context
kimi-k2.7-code
Kimi K2.7
Fast general-purpose K2 variant
kimi-k2.7

Troubleshooting

"Skipping invalid entry 'object'" on kimi provider add
That was an old client/endpoint mismatch. g0i now serves Kimi Code CLI a proper custom registry when it detects the kimi-code-cli User-Agent — re-run kimi provider add https://api.g0i.ai/v1/models --api-key your-api-key.
Imports the provider but shows no models
Use the config.toml above (Option B) so the model list is explicit, or run /model in the TUI to refresh. kimi-k3 should appear as "Kimi K3".
Getting 401 / Could not validate credentials
api_key must be a real g0i key from g0i.ai/api-keys (redeem a voucher or buy a plan first). Put it in [providers.g0i].api_key or pass --api-key.

Ready to ship in Kimi Code CLI?

Choose a subscription, add pay-as-you-go credits, or redeem a community voucher.