From fd809e285a9762de20b1917b4726b6429954dff1 Mon Sep 17 00:00:00 2001 From: Adityagrover1 <148478623+Adityagrover1@users.noreply.github.com> Date: Thu, 6 Aug 2026 19:43:56 +0530 Subject: [PATCH 1/2] docs(config): document Moonshot/Kimi region-specific API base Moonshot/Kimi issues separate keys per platform (.ai vs .cn), and LiteLLM's moonshot/ provider always defaults to the international .ai endpoint. A .cn key against that default fails with a generic AuthenticationError that looks like a bad key. Document the MOONSHOT_API_BASE override, matching the existing Bedrock callout in this file. Fixes #196 --- examples/configuration/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/examples/configuration/README.md b/examples/configuration/README.md index 25e5b3a8..1dfd1664 100644 --- a/examples/configuration/README.md +++ b/examples/configuration/README.md @@ -216,6 +216,27 @@ LLM_API_KEY=your-key-here # Write it as bare `null` — not `None` or "null". ``` +- **Moonshot / Kimi** (`model: moonshot/...`) runs two separate platforms, each + issuing its own keys — a key from one will not authenticate against the + other's endpoint: + + | Platform | Console | API base | + | --- | --- | --- | + | International | `platform.moonshot.ai` | `https://api.moonshot.ai/v1` (default) | + | China | `platform.moonshot.cn` | `https://api.moonshot.cn/v1` | + + LiteLLM's `moonshot/` provider always uses the international endpoint unless + told otherwise. If your key is from `platform.moonshot.cn`, point LiteLLM at + the China base explicitly in `/.env`: + + ```bash + MOONSHOT_API_BASE=https://api.moonshot.cn/v1 + ``` + + A `litellm.AuthenticationError: ... MoonshotException - Invalid + Authentication` from a Moonshot/Kimi key you know is valid usually means + this region mismatch, not a bad key (#196). + **Where keys are read from** (first match wins, existing env always respected): 1. your shell environment From 43316ed8a60dd387b76ba3b280eb5b2e535cfacd Mon Sep 17 00:00:00 2001 From: Adityagrover1 <148478623+Adityagrover1@users.noreply.github.com> Date: Thu, 6 Aug 2026 22:13:36 +0530 Subject: [PATCH 2/2] docs(config): keep Moonshot error code span on one line Copilot review on #215 flagged the backticked AuthenticationError text spanning a hard line break, which breaks Markdown code-span rendering. --- examples/configuration/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/configuration/README.md b/examples/configuration/README.md index 1dfd1664..da02c5ab 100644 --- a/examples/configuration/README.md +++ b/examples/configuration/README.md @@ -233,9 +233,9 @@ LLM_API_KEY=your-key-here MOONSHOT_API_BASE=https://api.moonshot.cn/v1 ``` - A `litellm.AuthenticationError: ... MoonshotException - Invalid - Authentication` from a Moonshot/Kimi key you know is valid usually means - this region mismatch, not a bad key (#196). + Seeing `litellm.AuthenticationError: ... MoonshotException - Invalid Authentication` + from a Moonshot/Kimi key you know is valid usually means this region + mismatch, not a bad key (#196). **Where keys are read from** (first match wins, existing env always respected):