You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report! This is almost always a region/endpoint mismatch, not a bad key.
Kimi/Moonshot runs two separate platforms, each with its own keys:
International — platform.moonshot.ai → API base https://api.moonshot.ai/v1 (also https://api.kimi.ai/v1)
China — platform.moonshot.cn → API base https://api.moonshot.cn/v1
LiteLLM's moonshot/ provider defaults to the .ai endpoint. If your key was issued on platform.moonshot.cn, it fails there with exactly this Invalid Authentication error.
Could you confirm which platform your key is from — .ai or .cn?
The fix depends on it:
.cn key — point OpenKB at the China endpoint via the OpenAI-compatible route:
in <kb>/.openkb/config.yaml: model: openai/kimi-k3 (or whatever Kimi model you use — kimi-k2.6, moonshot-v1-8k, …)
in your .env: OPENAI_API_BASE=https://api.moonshot.cn/v1
(Or keep model: moonshot/kimi-k3 and instead add MOONSHOT_API_BASE=https://api.moonshot.cn/v1 to .env.)
.ai key — model: moonshot/kimi-k3 should work with the default endpoint; please double-check the key is active and has quota.
Let us know your platform and we'll confirm the exact config.
Activity
KylinMountain commentedon Jul 21, 2026
@orangezfj would you help to pull request to fix this issue? Thank you
KylinMountain commentedon Jul 22, 2026
Thanks for the report! This is almost always a region/endpoint mismatch, not a bad key.
Kimi/Moonshot runs two separate platforms, each with its own keys:
platform.moonshot.ai→ API basehttps://api.moonshot.ai/v1(alsohttps://api.kimi.ai/v1)platform.moonshot.cn→ API basehttps://api.moonshot.cn/v1LiteLLM's
moonshot/provider defaults to the.aiendpoint. If your key was issued onplatform.moonshot.cn, it fails there with exactly thisInvalid Authenticationerror.Could you confirm which platform your key is from —
.aior.cn?The fix depends on it:
.cnkey — point OpenKB at the China endpoint via the OpenAI-compatible route:<kb>/.openkb/config.yaml:model: openai/kimi-k3(or whatever Kimi model you use —kimi-k2.6,moonshot-v1-8k, …).env:OPENAI_API_BASE=https://api.moonshot.cn/v1(Or keep
model: moonshot/kimi-k3and instead addMOONSHOT_API_BASE=https://api.moonshot.cn/v1to.env.).aikey —model: moonshot/kimi-k3should work with the default endpoint; please double-check the key is active and has quota.Let us know your platform and we'll confirm the exact config.