Kimi: keep the default upstream and select the API shape via base URL

The provider keeps https://api.moonshot.ai; Claude Code and Kimi CLI
append /anthropic to the endpoint base URL and the prefix rides through
to Moonshot. Updates the connect steps, both agent sections, and the
affected screenshots.
This commit is contained in:
mlsmaycon
2026-07-23 03:40:53 +00:00
parent 755a222852
commit 1bb0b41113
4 changed files with 18 additions and 21 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 167 KiB

+18 -21
View File
@@ -16,33 +16,29 @@ Moonshot serves **two API shapes with the same API key**:
- the **OpenAI Chat Completions API** under `https://api.moonshot.ai/v1` - the **OpenAI Chat Completions API** under `https://api.moonshot.ai/v1`
- the **Anthropic Messages API** under `https://api.moonshot.ai/anthropic` - the **Anthropic Messages API** under `https://api.moonshot.ai/anthropic`
The upstream URL you set on the NetBird provider decides which shape your agents speak Your agents pick the shape with the path they call on your NetBird endpoint — `/v1/...`
through the endpoint, so pick it based on the tools you plan to connect (see below). for the OpenAI shape, `/anthropic/v1/...` for the Anthropic shape — and the path rides
through to Moonshot. One Kimi provider serves both.
## Connect the Provider ## Connect the Provider
1. Go to **Agent Network → Providers** and click **Connect Provider**. 1. Go to **Agent Network → Providers** and click **Connect Provider**.
2. Select **Kimi**. NetBird pre-fills the upstream URL `https://api.moonshot.ai` and the 2. Select **Kimi**. NetBird pre-fills the upstream URL `https://api.moonshot.ai` and the
bearer auth header. bearer auth header. Keep the upstream URL as-is — the API shape is chosen per agent
3. Set the **Upstream URL** for the API shape your agents use: via its base URL (see below), not on the provider.
- Change it to `https://api.moonshot.ai/anthropic` for **Anthropic-shaped** agents — 3. Paste your Moonshot **API key**. The same key works for both API shapes; it is stored
Claude Code, or Kimi CLI's `anthropic` provider type. This is the common case.
- Keep `https://api.moonshot.ai` for **OpenAI-shaped** callers — the OpenAI SDK, or
anything else that calls `/v1/chat/completions`.
4. Paste your Moonshot **API key**. The same key works for both API shapes; it is stored
encrypted server-side and never sent to callers. encrypted server-side and never sent to callers.
5. Save the provider. 4. Save the provider.
<p> <p>
<img src="/docs-static/img/agent-network/integrations/agent-network-connect-kimi.png" alt="connect Kimi (Moonshot AI) provider in NetBird Agent Network" className="imagewrapper" /> <img src="/docs-static/img/agent-network/integrations/agent-network-connect-kimi.png" alt="connect Kimi (Moonshot AI) provider in NetBird Agent Network" className="imagewrapper" />
</p> </p>
<Note> <Note>
A provider forwards to a single upstream URL, and NetBird routes requests to providers Connect a single Kimi provider. NetBird routes requests to providers by model name, and
by model name. Because Moonshot currently serves a single model (`kimi-k3`), two Kimi Moonshot currently serves a single model (`kimi-k3`) — a second Kimi provider would
providers would claim the same model and route ambiguously — so connect one Kimi claim the same model and route ambiguously, and it isn't needed: the agent's base URL
provider and pick the upstream URL for the API shape your agents use. Anthropic-shaped path selects the API shape through the one provider.
agents (Claude Code, Kimi CLI) are the most common case.
</Note> </Note>
<Note> <Note>
@@ -81,8 +77,9 @@ your tool and copy the pre-filled configuration. The sections below walk through
## Use with Claude Code ## Use with Claude Code
Claude Code speaks the Anthropic Messages API, so it needs the Kimi provider whose upstream Claude Code speaks the Anthropic Messages API, so its base URL is your endpoint with the
URL is `https://api.moonshot.ai/anthropic`. `/anthropic` suffix — the prefix rides through NetBird to Moonshot, which serves the
Anthropic API under that path.
Add the following to `~/.claude/settings.json`. The `apiKeyHelper` returns a dummy value so Add the following to `~/.claude/settings.json`. The `apiKeyHelper` returns a dummy value so
Claude Code doesn't prompt for a key — NetBird supplies the real one. Claude Code doesn't prompt for a key — NetBird supplies the real one.
@@ -91,7 +88,7 @@ Claude Code doesn't prompt for a key — NetBird supplies the real one.
{ {
"apiKeyHelper": "echo '-'", "apiKeyHelper": "echo '-'",
"env": { "env": {
"ANTHROPIC_BASE_URL": "https://<your-endpoint>", "ANTHROPIC_BASE_URL": "https://<your-endpoint>/anthropic",
"ANTHROPIC_MODEL": "kimi-k3", "ANTHROPIC_MODEL": "kimi-k3",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "kimi-k3", "ANTHROPIC_DEFAULT_OPUS_MODEL": "kimi-k3",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "kimi-k3", "ANTHROPIC_DEFAULT_SONNET_MODEL": "kimi-k3",
@@ -124,8 +121,8 @@ Kimi K3's 1M-token context — optional, but worth adding for long sessions.
## Use with Kimi CLI ## Use with Kimi CLI
[Kimi CLI](https://github.com/MoonshotAI/kimi-cli) is Moonshot's own coding agent. Configure [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) is Moonshot's own coding agent. Configure
it with a custom provider of type `anthropic`, which means it needs the Kimi provider whose it with a custom provider of type `anthropic`, which speaks the Anthropic Messages API —
upstream URL is `https://api.moonshot.ai/anthropic`. so, like Claude Code, its base URL is your endpoint with the `/anthropic` suffix.
Add the following to `~/.kimi/config.toml`. The dummy `api_key` keeps the CLI from prompting Add the following to `~/.kimi/config.toml`. The dummy `api_key` keeps the CLI from prompting
for one — NetBird injects the real key server-side. for one — NetBird injects the real key server-side.
@@ -135,7 +132,7 @@ default_model = "kimi-k3"
[providers.netbird] [providers.netbird]
type = "anthropic" type = "anthropic"
base_url = "https://<your-endpoint>" base_url = "https://<your-endpoint>/anthropic"
api_key = "-" api_key = "-"
[models.kimi-k3] [models.kimi-k3]