Claude Code

Use Claude Code, Anthropic's coding agent, with your Pendra models. Set four environment variables, then run it as normal.

Set it up

bash
# Send Claude Code's requests to Pendra
export ANTHROPIC_BASE_URL=https://api.pendra.ai
export ANTHROPIC_API_KEY=pdr_sk_...

# Use Pendra models, as Claude Code asks for Claude models by default
export ANTHROPIC_MODEL=qwen3.6:27b
export ANTHROPIC_DEFAULT_HAIKU_MODEL=qwen3.6:27b

claude

Run claude in your project folder. To check it's using Pendra, look for the request on the Usage page in the console.

VariableWhat it does
ANTHROPIC_BASE_URLWhere to send requests. Use the host only, as Claude Code adds the rest.
ANTHROPIC_API_KEYYour Pendra API key.
ANTHROPIC_MODELThe main model.
ANTHROPIC_DEFAULT_HAIKU_MODELThe model for quick background tasks. It can be the same as the main one.

To keep these settings, add the export lines to ~/.zshrc or ~/.bashrc.

Choosing a model

Use any chat model your workers serve, from the models list. Larger models that reason, such as qwen3.6:27b, are best for coding. To let Claude Code read screenshots, choose a model with vision. Other models get [image omitted] in place of the image.

Troubleshooting

  • 401 means the key is wrong or not set. Check it starts with pdr_sk_ and is exported in the terminal that runs claude.
  • 404 naming a Claude model means Claude Code asked for one of Anthropic's models. Set ANTHROPIC_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL. If it names a Sonnet or Opus model, set ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_OPUS_MODEL as well.
  • A slow first reply usually means the worker is loading the model, which can take up to 30 seconds. Later replies are quicker.
Claude Code uses Pendra's Anthropic Messages API.