claude-code - 💡(How to fix) Fix [BUG] can't use openai api compatible moonshot ai api for kimi-k2.6 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52254Fetched 2026-04-24 06:12:04
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Timeline (top)
labeled ×4

Error Message

Error Messages/Logs

Code Example

There's an issue with the selected model (kimi-k2.6). It may not exist or you may not have access to it. Run --model to pick a different model.
 ⚠Auth conflict: Both a token (ANTHROPIC_AUTH_TOKEN) and an API key (/login managed key) are set. This may lead to unexpected behavior.
    · Trying to use ANTHROPIC_AUTH_TOKEN? claude /logout
    · Trying to use /login managed key? Unset the ANTHROPIC_AUTH_TOKEN environment variable.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Claude Code v2.1.118 i am using moonshot ai { "env": { "ANTHROPIC_BASE_URL": "https://api.moonshot.ai/v1", "ANTHROPIC_AUTH_TOKEN": "sk-....9c", "ANTHROPIC_CUSTOM_MODEL_OPTION": "kimi-k2.6" } }

What Should Happen?

it should have worked normally

Error Messages/Logs

There's an issue with the selected model (kimi-k2.6). It may not exist or you may not have access to it. Run --model to pick a different model.
 ⚠Auth conflict: Both a token (ANTHROPIC_AUTH_TOKEN) and an API key (/login managed key) are set. This may lead to unexpected behavior.
    · Trying to use ANTHROPIC_AUTH_TOKEN? claude /logout
    · Trying to use /login managed key? Unset the ANTHROPIC_AUTH_TOKEN environment variable.

Steps to Reproduce

1.create moonshot api key 2.create .claude/settings.json 3. paste

  "env": {
    "ANTHROPIC_BASE_URL": "https://api.moonshot.ai/v1",
    "ANTHROPIC_AUTH_TOKEN": "sk-....9c",
    "ANTHROPIC_CUSTOM_MODEL_OPTION": "kimi-k2.6"
  }
} ```
4. insert your api key in anthropic auth token

### Claude Model

Other

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

2.1.118

### Platform

Other

### Operating System

Windows

### Terminal/Shell

VS Code integrated terminal

### Additional Information

_No response_

extent analysis

TL;DR

The issue can likely be resolved by addressing the auth conflict between the ANTHROPIC_AUTH_TOKEN environment variable and the /login managed key.

Guidance

  • Verify that the ANTHROPIC_AUTH_TOKEN is correctly set and valid for the selected model (kimi-k2.6) by checking the Moonshot AI documentation.
  • Try unsetting the ANTHROPIC_AUTH_TOKEN environment variable to use the /login managed key instead, as suggested in the error message.
  • Run the claude /logout command to ensure a clean authentication state before retrying.
  • Check the availability and accessibility of the kimi-k2.6 model in the Moonshot AI API.

Example

No code snippet is provided as it is not necessary for this issue.

Notes

The issue may be related to authentication configuration or model availability, but more information from the Moonshot AI API or Claude Code documentation would be needed for a definitive solution.

Recommendation

Apply workaround: Unset the ANTHROPIC_AUTH_TOKEN environment variable to resolve the auth conflict, as it may lead to unexpected behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING