Skip to content

docs(config): document Moonshot/Kimi region-specific API base - #215

Open
Adityagrover1 wants to merge 2 commits into
VectifyAI:mainfrom
Adityagrover1:docs/moonshot-api-base
Open

docs(config): document Moonshot/Kimi region-specific API base#215
Adityagrover1 wants to merge 2 commits into
VectifyAI:mainfrom
Adityagrover1:docs/moonshot-api-base

Conversation

@Adityagrover1

@Adityagrover1 Adityagrover1 commented Aug 6, 2026

Copy link
Copy Markdown

Summary

  • Moonshot/Kimi issues separate keys per platform (platform.moonshot.ai vs platform.moonshot.cn), and LiteLLM's moonshot/ provider always defaults to the international .ai endpoint
  • A .cn key against that default fails with litellm.AuthenticationError: ... MoonshotException - Invalid Authentication, which reads like a bad key but is actually a region mismatch
  • Documents the MOONSHOT_API_BASE override in examples/configuration/README.md, matching the existing Bedrock callout in the same file

Scope 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 AuthenticationError with no in-product pointer to this doc. A follow-up could catch AuthenticationError for moonshot/ models and print a hint at the source; this PR just answers the question #196 asked.

Fixes #196

Test plan

  • Docs-only change — no code touched
  • Verified MOONSHOT_API_BASE is read by LiteLLM's moonshot provider (litellm/llms/moonshot/chat/transformation.py, _get_openai_compatible_provider_info)
  • Checked the added Markdown table/formatting renders correctly

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
Copilot AI lite review requested due to automatic review settings August 6, 2026 14:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_BASE environment variable override for China (platform.moonshot.cn) keys.
  • Add guidance tying the otherwise-opaque litellm.AuthenticationError to a likely region mismatch (Issue #196).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/configuration/README.md Outdated
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.
Copilot AI review requested due to automatic review settings August 6, 2026 16:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ERROR] Query failed: litellm.AuthenticationError: AuthenticationError: MoonshotException - Invalid Authentication

2 participants