Claude Code setup
Install and prepare
Section titled “Install and prepare”Install from the official Claude Code setup guide. Prepare a key with access to a Messages-compatible Claude model. WuDi API credit is billed separately from a Claude subscription.
Configure the connection
Section titled “Configure the connection”Set variables in the terminal that launches Claude Code. Replace the example model if necessary with one available to your key and confirmed to support Messages:
export ANTHROPIC_BASE_URL='https://wudiapi.com'export ANTHROPIC_AUTH_TOKEN="$WUDI_API_KEY"export ANTHROPIC_MODEL='claude-haiku-5-5'claudeWindows PowerShell:
$env:WUDI_API_KEY = 'YOUR_WUDI_API_KEY'$env:ANTHROPIC_BASE_URL = 'https://wudiapi.com'$env:ANTHROPIC_AUTH_TOKEN = $env:WUDI_API_KEY$env:ANTHROPIC_MODEL = 'claude-haiku-5-5'claudeDo not append /v1/messages to ANTHROPIC_BASE_URL. Check previously configured ANTHROPIC_API_KEY or other gateway variables for conflicts, and use one explicit authentication method.
Main and auxiliary models
Section titled “Main and auxiliary models”The client may choose separate models for the main conversation, fast tasks and subagents. If only some tasks fail, inspect the actual ID in the error and use the client’s supported model settings to select an available model. Do not use a friendly label or an unconfigured alias as an API model ID.
Verify
Section titled “Verify”Open a new session, send a short question, and confirm the model and group in usage logs. Follow normal client permission prompts; disabling permission checks does not fix API connectivity.
| Symptom | Next check |
|---|---|
| 401 | Does the launching process read the current key? |
| 404 or HTML | Root address and duplicated version paths |
| No available channel | Model, group and Messages support |
| Text works but tools fail | Tool, thinking and beta-parameter compatibility |
Restore previous settings
Section titled “Restore previous settings”Exit the client and remove only the variables or provider settings added for WuDi. Restart it afterward and retain unrelated configuration.
Reference: official gateway configuration.
