MoonshotAI / MoonshotAI/kimi-code
All authenticated API calls return 500 after successful OAuth login (inference, /me, and re-login all fail) — server-side, account-scoped
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
What version of Kimi Code is running?
0.39.1 (also reproduced on 0.19.2 before upgrading)
Which open platform/subscription were you using?
Kimi Code (kimi.com), region mainland-cn, OAuth device-code flow
What platform is your computer?
macOS (darwin/arm64)
What issue are you seeing?
OAuth login succeeds and a valid access token is issued, but every authenticated API call returns 500 The server had an error while processing your request. From the user's perspective the CLI is unusable: each prompt retries 10 times with exponential backoff and then gives up.
Timeline (from ~/.kimi-code/logs/kimi-code.log):
- First observed
2026-08-31T01:04:56Zon version 0.19.2 (provider.api_error: 500on startup prompt) - Continued after upgrading to 0.39.1
- Re-login at ~
2026-08-31T18:16Zsucceeded —credentials/kimi-code.jsoncontains a freshly issuedaccess_token/refresh_token(scopekimi-code,expires_in: 900) - All model calls with that valid token still return 500
- A fresh
kimi loginattempt afterwards now also fails immediately withLogin failed: The server had an error while processing your request(same symptom as #3363)
Cross-checks performed (client side ruled out)
- Two models: both
kimi-for-codingandk3return 500 → not a single-model outage - Two client versions: identical 500 on 0.19.2 and 0.39.1 → not a client bug
- Bypassing the CLI: calling
POST https://api.kimi.com/coding/v1/responsesdirectly with curl and the valid access token returnsHTTP 500 {"error":{"message":"The server had an error while processing your request","type":"server_error"}} - Gateway is alive: the same request with an invalid token correctly returns
HTTP 401 invalid_authentication_errorin ~0.17s - Auth server is alive:
POST https://auth.kimi.com/api/oauth/device_authorizationwith a malformed body correctly returnsHTTP 400 invalid_request - Account endpoints also fail:
GET https://api.kimi.com/coding/v1/mewith the valid token returns 500 as well kimi doctorreports all config files valid; no proxy env vars set; network connectivity to both hosts is fine
This points to a server-side problem scoped to authenticated paths for this account (membership/entitlement lookup?), not a client, network, or global edge outage. Possibly related: #3363, #2624.
What steps can reproduce the bug?
kimi login --region mainland-cn→ complete device-code OAuth in browser → login reports success, token issuedkimi -p "hi"→turn.step.retryingevents withAPIStatusError: 500 The server had an error while processing your request, 10 retries, then failure- Run
kimi loginagain → fails immediately with the same 500
What is the expected behavior?
Authenticated requests succeed, or a specific actionable error (e.g. membership expired / quota exhausted) is returned instead of a generic 500.
Additional information
Happy to provide request IDs, full logs, or the credential file metadata privately if helpful.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with kimi login, kimi -p "hi", and the authenticated /coding/v1/responses and /coding/v1/me requests described in the issue. Trace the CLI authentication and API request entry points to determine whether the client can expose a more specific server response; done means authenticated calls succeed or return an actionable error instead of a generic 500.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, authentication, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100