Use Kimi-K2.7-Code in Claude Code
Connect Kimi-K2.7-Code with your ChineseModels API key and keep other providers in place.
Copy the setup prompt
Paste into your coding assistant; enter your key only through a local secure prompt or secret store.
Configure Kimi-K2.7-Code from ChineseModels in Claude Code. Guide: https://chinesemodels.ai/documentation/claude-code/models/Kimi-K2.7-Code Exact model ID: Kimi-K2.7-Code Detect my OS and client version; check the current official configuration reference. Back up existing config and preserve logins, providers, permissions and unrelated settings. Use a secure local key prompt or secret store; never print or commit the key. This is experimental: Anthropic does not support non-Claude models in Claude Code. Confirm this model advertises the anthropic endpoint. Use ANTHROPIC_BASE_URL=https://chinesemodels.ai and ANTHROPIC_AUTH_TOKEN for Bearer authentication. Add the exact ID using ANTHROPIC_CUSTOM_MODEL_OPTION and launch claude --model with that ID. Keep these settings in a separate shell/launcher so normal Claude settings remain intact. Do not enable Claude-specific thinking features without testing. For multiple picker entries, inspect the installed modelPicker schema and use only filtered text models. Fetch https://chinesemodels.ai/v1/models with my bearer key. Confirm this exact ID exists; do not silently substitute another model. Exclude image/video generators when importing more models. Test text, streaming, a tool call and a tool-result round trip. Only configure verified thinking parameters. Report what was tested, how to select this model, refresh the list and restore the backup. Do not change messaging channels, send messages or publish anything.
Manual setup
- Use a dedicated terminal session. Load your key into CHINESEMODELS_API_KEY with a local secret manager.
- Apply the exports below. This gateway requires a Bearer credential, not x-api-key alone.
- Launch the exact model. Check /status for the gateway URL and test a reply and tool use.
- Use /model for the custom entry. For several entries, use a filtered modelPicker configuration matching your installed version; automatic discovery can include generators.
# Set CHINESEMODELS_API_KEY locally first.
if (-not $env:CHINESEMODELS_API_KEY) { throw 'Set your key first.' }
$env:ANTHROPIC_BASE_URL = 'https://chinesemodels.ai'
$env:ANTHROPIC_AUTH_TOKEN = $env:CHINESEMODELS_API_KEY
$env:ANTHROPIC_CUSTOM_MODEL_OPTION = 'Kimi-K2.7-Code'
claude --model 'Kimi-K2.7-Code'Settings-file environment values can override shell values. Check /status. Closing the dedicated shell discards its session-only exports.
Thinking and validation
Start with provider defaults. Only enable reasoning controls whose request fields match the chosen model. A visible effort menu does not establish that upstream thinking can be switched off.
Refresh from your authenticated /v1/models list and exclude image/video generators. Test a text reply, streaming and a tool-result round trip before using a model for agent work. Restore your configuration backup to undo the setup.
These additional client guides follow official configuration documentation. Complete end-to-end tests have not been performed for every client/model combination. Codex and Kimi guides document their own test results.
Official Claude Code configuration reference