1.
Discover models with GET https://api.kie.ai/anthropic/v1/models, not from memory or training data. This endpoint gives the list Claude Code can actually run. The general taskType=Chat catalog is a different, wider list that includes models this endpoint does not serve.
2.
Authenticate with Authorization: Bearer. Every KIE endpoint, including the model listing, carries the API key in this one header. A header literally named apikey is rejected with 401. Claude Code reads this header from ANTHROPIC_AUTH_TOKEN and adds the Bearer prefix itself, so put the raw key in the variable. ANTHROPIC_API_KEY is sent as X-Api-Key; KIE only accepts it when the value starts with Bearer (including the space).
3.
Set ANTHROPIC_BASE_URL to https://api.kie.ai/anthropic. Claude Code appends /v1/messages itself. Listing and requests share this prefix: GET /anthropic/v1/models and POST /anthropic/v1/messages.
1.
A bare ANTHROPIC_API_KEY, or a header named apikey. KIE returns 401. Prefer putting the raw key in ANTHROPIC_AUTH_TOKEN. If you use ANTHROPIC_API_KEY, the value must start with Bearer .
2.
The full request URL in ANTHROPIC_BASE_URL. Claude Code appends /v1/messages itself, so a value ending in /v1 or /v1/messages becomes /v1/v1/messages.
3.
model not found. Claude Code asked for an id this endpoint does not have. Run /model and pick one from the list.
4.
Credentials in the project-level .claude/settings.json. That file is committed. Use the user-level file or .claude/settings.local.json.
5.
Bearer inside ANTHROPIC_AUTH_TOKEN. Claude Code adds the prefix itself, and the header becomes Bearer Bearer ….
6.
setx does not affect the current window. It applies to windows opened afterwards. Set $env: as well to use it right away.
7.
PowerShell curl. It is an alias for Invoke-WebRequest and does not accept these arguments. Use curl.exe.
8.
An Anthropic account login appears. The variables are empty in this process. Close every terminal, including the ones inside your editor, and reopen from a shell where the variables are exported.