One-click import (recommended)
The fastest method is CC Switch:- Install CC Switch and sign in.
- On the API Keys page in the DimiLinks console, click “Import to CC Switch” for a key restricted to Claude models.
- CC Switch automatically adds a provider named
Claudewith the base URL set tohttps://api-direct.dimilinks.com/. - Before starting Claude Code, run
cc-switch use <provider>to switch to DimiLinks.
Configure environment variables manually
If you do not use CC Switch, set the environment variables directly:~/.zshrc or ~/.bashrc) to persist them. To maintain multiple configurations for different keys, use a tool such as direnv or mise to inject them by directory.
The recommended DimiLinks request URL is
https://api-direct.dimilinks.com/v1, but Claude Code appends /v1/messages automatically. Set ANTHROPIC_BASE_URL to https://api-direct.dimilinks.com/; otherwise it will request the invalid /v1/v1/messages path.Recommended models
Use the
/model command after startup to switch models. Model IDs match the List models response.
Troubleshooting
401 Invalid token: The environment variable is not active or the key is incorrect. Runecho $ANTHROPIC_AUTH_TOKENto check it.403 model_not_allowed: The key’s model restrictions do not allow the Claude model you selected. Update the key in the console.- Requests keep timing out: Start with the minimal
curlexample under Authentication. Ifcurlsucceeds but Claude Code does not, a local proxy or corporate VPN is probably blocking the request. - Keep an official Anthropic account available as well: Maintain multiple providers in CC Switch and run
cc-switch use anthropicbefore startup to switch back.