kimi-cli icon indicating copy to clipboard operation
kimi-cli copied to clipboard

401 Authentication Error when TUN Mode Enabled

Open ayokaa opened this issue 7 months ago • 0 comments

What version of Kimi Code CLI is running?

kimi, version 1.37.0

Which open platform/subscription were you using?

/login

Which model were you using?

kimi-K2.6

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

Error Message

Authorization failed. Your session may have expired.
Type /login to re-authenticate.
Server: Error code: 401 - {'error': {'message': 'The API Key appears to be invalid or may have expired. Please verify your credentials and try again.', 'type': 'invalid_authentication_error'}}

Problem Description

Authentication fails intermittently with a 401 error when the proxy client is set to TUN Mode.

  • TUN Mode Enabled: Authentication fails repeatedly after initial login.
  • TUN Mode Disabled: Authentication succeeds and remains stable.
  • Environment: WSL (Mirror Mode) with rule-based proxy.

What steps can reproduce the bug?

Steps to Reproduce:

  1. Enable TUN mode in the system proxy client.
  2. Launch kimi-cli within the WSL environment and authenticate successfully via /login.
  3. Maintain a continuous conversation or send periodic API requests for approximately 5 minutes.
  4. Observe that authentication fails intermittently after this duration, despite valid credentials.
  5. Disable TUN mode and repeat; the session remains stable.

What is the expected behavior?

No response

Additional information

I have searched existing issues.

ayokaa avatar Apr 21 '26 09:04 ayokaa