Skip to content

Claude Code

Claude Code is Anthropic's terminal coding agent. Before connecting it to DDTokens, confirm that your DDTokens account supports Claude models or an Anthropic Messages-compatible route.

Prerequisites

  • Claude Code is installed.
  • You have created a DDTokens API key.
  • Your account can call Claude models.

Configure Environment Variables

Run the following on macOS, Linux, or WSL:

bash
export ANTHROPIC_BASE_URL="https://apiddt.com"
export ANTHROPIC_API_KEY="$DDDT_API_KEY"
export ANTHROPIC_MODEL="claude-3-5-sonnet"

If your model list uses full model IDs, set ANTHROPIC_MODEL to the model name shown in the dashboard.

Verify

Run:

bash
claude --version
claude "Say hello in one sentence."

For an authentication error, first check whether ANTHROPIC_API_KEY equals your DDTokens API key. For a model-unavailable error, check the model name and account permissions.

Common Issues

Invalid API Key

Check whether the current terminal can read the environment variables:

bash
echo "$ANTHROPIC_BASE_URL"
echo "$ANTHROPIC_API_KEY"

Never post a complete key in a public channel.

Requests Keep Timing Out

Reduce the output length or switch to a faster model. Configure client-side timeout and retry policies for long-running tasks.

Incompatible Parameters

New Claude Code versions may send new experimental parameters. If the gateway does not yet support those fields, update Claude Code first or disable experimental beta settings according to the official Claude Code guidance.

© 2026 DDTokens