Skip to main content

Kimi Provider

CCS provides two distinct Kimi offerings: Provider aliases: kimi, moonshot both route to the same CLIProxy provider.

Quick Start

Authentication

ccs kimi — OAuth Mode (CLIProxy)

1

Trigger Login

Run ccs kimi --kimi-login — device code displayed in terminal
2

Activate Device

Visit the URL shown and enter the device code (no callback port needed)
3

Token Cached

OAuth token saved to ~/.ccs/cliproxy/auth/kimi-{email}.json
4

Auto Refresh

CLIProxy backend manages token refresh automatically
Device Code Flow: Polling-based authentication — no local callback server required. Works in headless/server environments.

ccs km — API Key Mode (Kimi for Coding)

1

Get API Key

Obtain a sk-... key from Moonshot AI platform
2

Configure

Run ccs km — prompted for API key on first use
3

Thinking Always On

All requests use extended thinking by default
ccs km connects directly to https://api.kimi.com/coding/. Default model: kimi-for-coding. The --preset kimi flag auto-maps to km for backward compatibility.

Multi-Account Support

Account Registry: ~/.ccs/cliproxy/accounts.json — aliases kimi and moonshot both map to the same provider.

Model Configuration

Available Models

ccs kimi (CLIProxy OAuth)

ccs km (API key direct)

Thinking budget: 1K–32K tokens, dynamic and zero allowed. Vision: Configurable via vision-model placeholder in settings.

Settings Template

Settings saved to ~/.ccs/km.settings.json from base-km.settings.json:
These env vars are injected automatically by CCS. Manual override is rarely needed.

Commands Reference

Troubleshooting

Device Code Expired

Symptom: “Device code expired” error during login Solution: Device codes have a short TTL. Re-run login and complete quickly:

API Key Rejected (km mode)

Symptom: 401 errors when using ccs km Solution: Verify key format (sk-...) and permissions on Moonshot AI platform.
API keys for ccs km are separate from OAuth tokens used by ccs kimi. Do not mix them.

Wrong Account Active

Symptom: Unexpected account being used Solution:

Storage Locations

Cost Information

Next Steps

Multi-Account Setup

Manage multiple Kimi accounts

API Preset (km)

Configure direct API key access

Remote Proxy

Connect to external CLIProxy server

All Providers

Explore other supported providers