fix(provider): correct moonshot-cn domestic provider for China-based Kimi/Moonshot users#8856
Closed
bugmaker2 wants to merge 1 commit into
Closed
fix(provider): correct moonshot-cn domestic provider for China-based Kimi/Moonshot users#8856bugmaker2 wants to merge 1 commit into
bugmaker2 wants to merge 1 commit into
Conversation
… users Add a dedicated domestic direct API provider (moonshot-cn) for Kimi/Moonshot users in mainland China who register at platform.moonshot.cn. The existing kimi-coding provider continues to serve global users at api.moonshot.ai. This resolves issue NousResearch#8096 where China-based users were getting 401 errors out-of-the-box because the default endpoint (api.moonshot.ai) only accepts keys from platform.moonshot.ai. Changes: - Add moonshot-cn ProviderConfig (https://api.moonshot.cn/v1, MOONSHOT_CN_API_KEY) - Add moonshot-cn to provider registry, models, aliases, and setup flows - Add moonshot-cn to health checks (doctor), status, and config examples - Add moonshot-cn to provider overlays and model metadata Closes NousResearch#8096 Made-with: Cursor
This was referenced Apr 13, 2026
Contributor
|
Merged via PR #9172 which adds |
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.
What does this PR do?
Add a dedicated
moonshot-cndomestic direct API provider for Kimi/Moonshot users in mainland China who register atplatform.moonshot.cn. The existingkimi-codingprovider continues to serve global users atapi.moonshot.ai.This resolves the issue where China-based users were getting 401 authentication errors out-of-the-box because the default endpoint (
api.moonshot.ai) only accepts keys fromplatform.moonshot.ai.Related Issue
Fixes #8096
Type of Change
Changes Made
hermes_cli/auth.py: Addmoonshot-cnProviderConfig with domestic endpointhttps://api.moonshot.cn/v1andMOONSHOT_CN_API_KEYenvironment variable; addmoonshot-china→moonshot-cnaliashermes_cli/config.py: AddMOONSHOT_CN_API_KEYandMOONSHOT_CN_BASE_URLenvironment variable definitions; update fallback model docshermes_cli/models.py: Addmoonshot-cnmodel list, display label, and alias; add to provider order listhermes_cli/setup.py: Addmoonshot-cnprovider and model list to interactive setuphermes_cli/providers.py: AddHermesOverlayformoonshot-cnwithopenai_chattransporthermes_cli/doctor.py: Addmoonshot-cnhealth check entryhermes_cli/status.py: Addmoonshot-cnto API key provider status displayhermes_cli/main.py: Addmoonshot-cnto provider labels and--providerchoicesagent/auxiliary_client.py: Addmoonshot-cnauxiliary model mappingagent/model_metadata.py: Addmoonshot-cnto provider prefixesagent/models_dev.py: Addmoonshot-cnmodels.dev registry mappinghermes_cli/model_normalize.py: Addmoonshot-cnto prefix-strip providerscli-config.yaml.exampleand.env.example: Document the new providerHow to Test
hermes setupand select Kimi / Moonshot (China) as the providerkimi-k2.5) and verify the chat works — no 401 errorshermes doctorand confirm the Kimi / Moonshot (China) status shows as configuredhermes statusshows the domestic endpoint (api.moonshot.cn/v1)Checklist
Code
Documentation & Housekeeping
.env.exampleandcli-config.yaml.examplewith the new providerScreenshots / Logs
Contributor: @bugmaker2