-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
Moonshot wizard sets .cn baseUrl — silent 401 for international API keys #6222
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
The onboarding wizard auto-populates https://api.moonshot.cn/v1 as the baseUrl when configuring the Moonshot/Kimi provider. For users with API keys created on the international platform (platform.moonshot.ai), this endpoint returns 401 Invalid Authentication — but Clawdbot surfaces zero error output. The model silently fails to respond.
Steps to Reproduce
- Run
clawdbot onboardand configure Moonshot Kimi as a provider - Enter a valid API key from
platform.moonshot.ai - Wizard saves
baseUrlashttps://api.moonshot.cn/v1inclawdbot.json - Attempt to use the Moonshot model (e.g. as a fallback)
- Model silently fails — no error in console, no logs, nothing
Expected Behavior
- Wizard should default to
https://api.moonshot.ai/v1(the international endpoint) - If the endpoint returns 401, Clawdbot should log the error visibly and notify the user
- Ideally: wizard validates the endpoint with a
/v1/modelscall before saving config
Actual Behavior
api.moonshot.cn/v1returns401 Invalid Authentication- Clawdbot shows no error — complete silence
- User has no way to diagnose the issue without manually curl-testing endpoints
Verification
# .cn endpoint — FAILS (401)
curl -s https://api.moonshot.cn/v1/models -H "Authorization: Bearer $KEY"
# {"error":{"message":"Invalid Authentication","type":"invalid_authentication_error"}}
# .ai endpoint — WORKS (200)
curl -s https://api.moonshot.ai/v1/models -H "Authorization: Bearer $KEY"
# Returns model list successfullyImpact
- 2+ hours of debugging time lost
- User topped up $100 in credits thinking it was a billing/tier issue
- Silent failure makes this nearly impossible to self-diagnose
Suggested Fix
- Default Moonshot
baseUrltohttps://api.moonshot.ai/v1 - Surface HTTP error responses (especially 401) in console/logs
- Validate provider URL at config time with a lightweight API call
Environment
- Clawdbot: 2026.1.24-3
- OS: macOS
- Node: v24.13.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.