Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

在claude code中配置了kimi-for-coding 对应信息提示401 #277

Closed

Description

@izanezx

What version of Kimi CLI is running?

kimi-for-coding

Which open platform/subscription were you using?

kimi-for-coding

Which model were you using?

No response

What platform is your computer?

No response

What issue are you seeing?

`> /model
⎿  Set model to kimi-for-coding

hai
⎿  401 {"error":{"type":"authentication_error","message":"unauthenticated"},"type":"error"}
Retrying in 13 seconds… (attempt 10/10)

✢ Nucleating… (esc to interrupt · 2m 51s · ↑ 0 tokens)
⎿  Tip: Use git worktrees to run multiple Claude sessions in parallel.`

> hai ⎿ API Error: 401 {"error":{"type":"authentication_error","message":"unauthenticated"},"type":"error"} · Please run /login

What steps can reproduce the bug?

配置切换到 kimi-for-coding 查看 /status后的状态

Settings:  Status   Config   Usage   (tab to cycle)

 Version: 2.0.37
 Session ID: 141eea29-5b1f-4597-9585-e74214e4c83c
 cwd: C:\Users\zhenx
 Auth token: ANTHROPIC_AUTH_TOKEN
 API key: ANTHROPIC_API_KEY
 Anthropic base URL: https://api.kimi.com/coding/

 Model: kimi-for-coding
 MCP servers: context7 ✔,exa ✔,github ✔
 Memory:
 Setting sources: User settings, Shared project settings, Local, Command line arguments, Enterprise managed policies

 System Diagnostics
  ⚠ Installation config mismatch: running unknown but config says global
 Settings:  Status   Config   Usage   (tab to cycle)

 Configure Claude Code preferences

 ❯ Auto-compact                              true
   Show tips                                 true
   Rewind code (checkpoints)                 true
   Verbose output                            false
   Respect .gitignore in file picker         true
   Theme                                     Dark mode
   Notifications                             Auto
   Output style                              default
   Editor mode                               normal
   Model                                     kimi-for-coding
   Auto-connect to IDE (external terminal)   false
   Use custom API key: yMRLLEWrWzA5Ef7HbASO  true

What is the expected behavior?

安装文档进行配置的

$env:ANTHROPIC_BASE_URL="https://api.kimi.com/coding/";
$env:ANTHROPIC_AUTH_TOKEN="<你的 API Key>"  # 这里填在会员页面生成的 API Key
$env:ANTHROPIC_MODEL="kimi-for-coding"
$env:ANTHROPIC_SMALL_FAST_MODEL="kimi-for-coding"

claude

还是报错啊

Additional information

No response

Activity

  1. added
    bug
    on Nov 13, 2025
  2. izanezx commented on Nov 13, 2025

    @izanezx
    Author

    401 {"error":{"type":"authentication_error","message":"unauthenticated"},"type":"error"}

    使用Kimi For Coding 是 Kimi 会员权益中的一项服务, 获得了key 在Claude code 总是报错
    怎么解决啊?

  3. izanezx commented on Nov 13, 2025

    @izanezx
    Author

    使用开放平台的API _

    kimi-k2-0905 和 kimi-k2-turbo

    _ 就没问题


    Use open platform APIs _

    kimi-k2-0905 and kimi-k2-turbo

    _ That’s no problem

  4. CellenLee commented on Nov 13, 2025

    @CellenLee

    确定 key 是从 https://www.kimi.com/membership/pricing 获得的,而且是 sk-kimi- 开头的 key 吗?

    ANTHROPIC_API_KEY='' ANTHROPIC_BASE_URL=https://api.kimi.com/coding/ ANTHROPIC_AUTH_TOKEN=sk-kimi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  claude

    这样能用吗?


    Are you sure the key is obtained from https://www.kimi.com/membership/pricing and is it a key starting with sk-kimi-?

    ANTHROPIC_API_KEY='' ANTHROPIC_BASE_URL=https://api.kimi.com/coding/ ANTHROPIC_AUTH_TOKEN=sk-kimi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx claude

    Can this be used?

  5. LionelCopilot001 commented on Nov 13, 2025

    @LionelCopilot001

    已解决 !

    C:\Users\userName\ .claude.json

    1、把claude code配置文件的删除一下,重新启动即可。大概率是配置的MCP导致的
    2、还不行就重新获取一下Token Key

    附图
    Image

  6. LionelCopilot001 commented on Nov 13, 2025

    @LionelCopilot001

    使用开放平台的API _

    kimi-k2-0905 和 kimi-k2-turbo

    _ 就没问题

    Use open platform APIs _

    kimi-k2-0905 and kimi-k2-turbo

    _ That’s no problem

    解决方法 #277 (comment)

  7. LionelCopilot001 commented on Nov 13, 2025

    @LionelCopilot001

    确定 key 是从 https://www.kimi.com/membership/pricing 获得的,而且是 sk-kimi- 开头的 key 吗?

    ANTHROPIC_API_KEY='' ANTHROPIC_BASE_URL=https://api.kimi.com/coding/ ANTHROPIC_AUTH_TOKEN=sk-kimi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx claude
    这样能用吗?

    Are you sure the key is obtained from https://www.kimi.com/membership/pricing and is it a key starting with sk-kimi-?

    ANTHROPIC_API_KEY='' ANTHROPIC_BASE_URL=https://api.kimi.com/coding/ ANTHROPIC_AUTH_TOKEN=sk-kimi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx claude
    Can this be used?

    解决方法 #277 (comment)

  8. gjuoun commented on Nov 14, 2025

    @gjuoun

    没用,macos下仍然提示401


    It doesn’t work. It still prompts 401 under macos.

  9. gjuoun commented on Nov 14, 2025

    @gjuoun

    最近kimi的 api 总是改来改去的,让人摸不着头脑,最好就是把两个api key 都配置了比较靠谱

    ANTHROPIC_API_KEY=<YourKey> ANTHROPIC_AUTH_TOKEN =<YourKey> ANTHROPIC_BASE_URL=https://api.kimi.com/coding/ claude
    

    Recently, Kimi's API has been constantly changing, which makes people confused. It is best to configure both API keys to be more reliable.

    ANTHROPIC_API_KEY=<YourKey> ANTHROPIC_AUTH_TOKEN =<YourKey> ANTHROPIC_BASE_URL=https://api.kimi.com/coding/ claude
    
  10. izanezx commented on Nov 14, 2025

    @izanezx
    Author

    ANTHROPIC_AUTH_TOKEN=sk-kimi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    Image

    还是不可可以

  11. x5iu commented on Nov 17, 2025

    @x5iu
    Contributor

    使用 ANTHROPIC_API_KEY 环境变量试试。


    Try using the ANTHROPIC_API_KEY environment variable.

  12. locked and limited conversation to collaborators on Nov 18, 2025
  13. converted this issue into a discussion #314 on Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions