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.
Claude Code does not read the OpenAI-compatible endpoint. You must use
https://api-direct.dimilinks.com/, not dimilinks.com/v1.Recommended models
| Use case | Model ID |
|---|---|
| General coding / refactoring | claude-sonnet-5 |
| Deep reasoning / complex tasks | claude-opus-4-8 |
| Large-context long documents | claude-opus-4-8 |
| Low-cost batch calls | claude-haiku-4-5 |
/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.