From 79cbb20988ec62c4a13b4e345e43af06a8450e72 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 12 Jan 2026 06:47:57 +0000 Subject: [PATCH] docs: add Moonshot provider setup --- docs/cli/index.md | 4 ++- docs/concepts/model-providers.md | 28 +++++++++++++++ docs/gateway/configuration.md | 42 +++++++++++++++++++++++ docs/providers/models.md | 1 + docs/providers/moonshot.md | 59 ++++++++++++++++++++++++++++++++ docs/start/wizard.md | 17 +++++++-- 6 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 docs/providers/moonshot.md diff --git a/docs/cli/index.md b/docs/cli/index.md index b57e36dd3..32b40899c 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -221,13 +221,15 @@ Options: - `--non-interactive` - `--mode ` - `--flow ` -- `--auth-choice ` +- `--auth-choice ` - `--token-provider ` (non-interactive; used with `--auth-choice token`) - `--token ` (non-interactive; used with `--auth-choice token`) - `--token-profile-id ` (non-interactive; default: `:manual`) - `--token-expires-in ` (non-interactive; e.g. `365d`, `12h`) - `--anthropic-api-key ` - `--openai-api-key ` +- `--openrouter-api-key ` +- `--moonshot-api-key ` - `--gemini-api-key ` - `--zai-api-key ` - `--minimax-api-key ` diff --git a/docs/concepts/model-providers.md b/docs/concepts/model-providers.md index 8ae6722ea..5b2c7b731 100644 --- a/docs/concepts/model-providers.md +++ b/docs/concepts/model-providers.md @@ -110,6 +110,34 @@ Clawdbot ships with the pi‑ai catalog. These providers require **no** Use `models.providers` (or `models.json`) to add **custom** providers or OpenAI/Anthropic‑compatible proxies. +### Moonshot AI (Kimi) + +Moonshot uses OpenAI-compatible endpoints, so configure it as a custom provider: + +- Provider: `moonshot` +- Auth: `MOONSHOT_API_KEY` +- Example model: `moonshot/kimi-k2-0905-preview` +- CLI: `clawdbot onboard --auth-choice moonshot-api-key` + +```json5 +{ + agents: { + defaults: { model: { primary: "moonshot/kimi-k2-0905-preview" } } + }, + models: { + mode: "merge", + providers: { + moonshot: { + baseUrl: "https://api.moonshot.ai/v1", + apiKey: "${MOONSHOT_API_KEY}", + api: "openai-completions", + models: [{ id: "kimi-k2-0905-preview", name: "Kimi K2 0905 Preview" }] + } + } + } +} +``` + ### MiniMax MiniMax is configured via `models.providers` because it uses custom endpoints: diff --git a/docs/gateway/configuration.md b/docs/gateway/configuration.md index c59a591c0..d1bb09595 100644 --- a/docs/gateway/configuration.md +++ b/docs/gateway/configuration.md @@ -1764,6 +1764,48 @@ Notes: override (see the custom providers section above). - Use a fake placeholder in docs/configs; never commit real API keys. +### Moonshot AI (Kimi) + +Use Moonshot's OpenAI-compatible endpoint: + +```json5 +{ + env: { MOONSHOT_API_KEY: "sk-..." }, + agents: { + defaults: { + model: { primary: "moonshot/kimi-k2-0905-preview" }, + models: { "moonshot/kimi-k2-0905-preview": { alias: "Kimi K2" } } + } + }, + models: { + mode: "merge", + providers: { + moonshot: { + baseUrl: "https://api.moonshot.ai/v1", + apiKey: "${MOONSHOT_API_KEY}", + api: "openai-completions", + models: [ + { + id: "kimi-k2-0905-preview", + name: "Kimi K2 0905 Preview", + reasoning: false, + input: ["text"], + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, + contextWindow: 256000, + maxTokens: 8192 + } + ] + } + } + } +} +``` + +Notes: +- Set `MOONSHOT_API_KEY` in the environment or use `clawdbot onboard --auth-choice moonshot-api-key`. +- Model ref: `moonshot/kimi-k2-0905-preview`. +- Use `https://api.moonshot.cn/v1` if you need the China endpoint. + ### Local models (LM Studio) — recommended setup Best current local setup (what we’re running): **MiniMax M2.1** on a powerful local machine diff --git a/docs/providers/models.md b/docs/providers/models.md index a1f0d1143..4810969e3 100644 --- a/docs/providers/models.md +++ b/docs/providers/models.md @@ -25,6 +25,7 @@ model as `provider/model`. - [OpenAI (API + Codex)](/providers/openai) - [Anthropic (API + Claude CLI)](/providers/anthropic) - [OpenRouter](/providers/openrouter) +- [Moonshot AI (Kimi)](/providers/moonshot) - [OpenCode Zen](/providers/opencode) - [Z.AI](/providers/zai) - [GLM models](/providers/glm) diff --git a/docs/providers/moonshot.md b/docs/providers/moonshot.md new file mode 100644 index 000000000..3bbed23d1 --- /dev/null +++ b/docs/providers/moonshot.md @@ -0,0 +1,59 @@ +--- +summary: "Use Moonshot AI (Kimi K2) with Clawdbot" +read_when: + - You want to use Moonshot/Kimi models in Clawdbot + - You need the Moonshot auth + config example +--- +# Moonshot AI (Kimi) + +Moonshot provides the Kimi API with OpenAI-compatible endpoints. Configure the +provider and set the default model to `moonshot/kimi-k2-0905-preview`. + +## CLI setup + +```bash +clawdbot onboard --auth-choice moonshot-api-key +``` + +## Config snippet + +```json5 +{ + env: { MOONSHOT_API_KEY: "sk-..." }, + agents: { + defaults: { + model: { primary: "moonshot/kimi-k2-0905-preview" }, + models: { + "moonshot/kimi-k2-0905-preview": { alias: "Kimi K2" } + } + } + }, + models: { + mode: "merge", + providers: { + moonshot: { + baseUrl: "https://api.moonshot.ai/v1", + apiKey: "${MOONSHOT_API_KEY}", + api: "openai-completions", + models: [ + { + id: "kimi-k2-0905-preview", + name: "Kimi K2 0905 Preview", + reasoning: false, + input: ["text"], + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, + contextWindow: 256000, + maxTokens: 8192 + } + ] + } + } + } +} +``` + +## Notes + +- Model refs use `moonshot/`. +- Override pricing and context metadata in `models.providers` if needed. +- Use `https://api.moonshot.cn/v1` if you need the China endpoint. diff --git a/docs/start/wizard.md b/docs/start/wizard.md index 89f86e0d9..26ce724dd 100644 --- a/docs/start/wizard.md +++ b/docs/start/wizard.md @@ -41,7 +41,7 @@ The wizard starts with **QuickStart** (defaults) vs **Advanced** (full control). ## What the wizard does **Local mode (default)** walks you through: -- Model/auth (OpenAI Code (Codex) subscription OAuth, Anthropic API key (recommended) or `claude setup-token`, plus MiniMax/GLM options) +- Model/auth (OpenAI Code (Codex) subscription OAuth, Anthropic API key (recommended) or `claude setup-token`, plus MiniMax/GLM/Moonshot options) - Workspace location + bootstrap files - Gateway settings (port/bind/auth/tailscale) - Providers (Telegram, WhatsApp, Discord, Signal) @@ -80,8 +80,10 @@ Tip: `--json` does **not** imply non-interactive mode. Use `--non-interactive` ( - **OpenAI API key**: uses `OPENAI_API_KEY` if present or prompts for a key, then saves it to `~/.clawdbot/.env` so launchd can read it. - **OpenCode Zen (multi-model proxy)**: prompts for `OPENCODE_API_KEY` (or `OPENCODE_ZEN_API_KEY`, get it at https://opencode.ai/auth). - **API key**: stores the key for you. - - **MiniMax M2.1**: config is auto‑written. + - **MiniMax M2.1**: config is auto-written. - More detail: [MiniMax](/providers/minimax) + - **Moonshot (Kimi K2)**: config is auto-written. + - More detail: [Moonshot AI](/providers/moonshot) - **Skip**: no auth configured yet. - Pick a default model from detected options (or enter provider/model manually). - Wizard runs a model check and warns if the configured model is unknown or missing auth. @@ -199,6 +201,17 @@ clawdbot onboard --non-interactive \ --gateway-bind loopback ``` +Moonshot example: + +```bash +clawdbot onboard --non-interactive \ + --mode local \ + --auth-choice moonshot-api-key \ + --moonshot-api-key "$MOONSHOT_API_KEY" \ + --gateway-port 18789 \ + --gateway-bind loopback +``` + OpenCode Zen example: ```bash