docs(config): document Moonshot/Kimi region-specific API base - #215
Open
Adityagrover1 wants to merge 2 commits into
Open
docs(config): document Moonshot/Kimi region-specific API base#215Adityagrover1 wants to merge 2 commits into
Adityagrover1 wants to merge 2 commits into
Conversation
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 VectifyAI#196
There was a problem hiding this comment.
Pull request overview
Documents a common Moonshot/Kimi authentication failure mode caused by using a region-specific API key against LiteLLM’s default (international) endpoint, and explains how to override the base URL via MOONSHOT_API_BASE in the KB .env. This fits the configuration guide’s existing pattern of provider-specific callouts (e.g., Bedrock) to help users self-diagnose setup issues.
Changes:
- Add a Moonshot/Kimi provider note describing the two separate platforms/keys and their corresponding API bases.
- Document the
MOONSHOT_API_BASEenvironment variable override for China (platform.moonshot.cn) keys. - Add guidance tying the otherwise-opaque
litellm.AuthenticationErrorto a likely region mismatch (Issue #196).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+236
to
+238
| 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). |
Copilot review on VectifyAI#215 flagged the backticked AuthenticationError text spanning a hard line break, which breaks Markdown code-span rendering.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
examples/configuration/README.md:238
- The inline reference
(#196)is ambiguous in a README context (it’s unclear whether it refers to a GitHub issue, internal ticket, or something else). Consider turning it into an explicit link (e.g.,[#196](...)) or naming the tracker (GitHub issue #196) so readers can easily find the context.
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
platform.moonshot.aivsplatform.moonshot.cn), and LiteLLM'smoonshot/provider always defaults to the international.aiendpoint.cnkey against that default fails withlitellm.AuthenticationError: ... MoonshotException - Invalid Authentication, which reads like a bad key but is actually a region mismatchMOONSHOT_API_BASEoverride inexamples/configuration/README.md, matching the existing Bedrock callout in the same fileScope note: this is documentation only — it doesn't change any runtime behavior. A future user hitting this for the first time still gets the same opaque
AuthenticationErrorwith no in-product pointer to this doc. A follow-up could catchAuthenticationErrorformoonshot/models and print a hint at the source; this PR just answers the question #196 asked.Fixes #196
Test plan
MOONSHOT_API_BASEis read by LiteLLM's moonshot provider (litellm/llms/moonshot/chat/transformation.py,_get_openai_compatible_provider_info)