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.
| Variable | What it does |
|---|---|
ANTHROPIC_BASE_URL | Where to send requests. Use the host only, as Claude Code adds the rest. |
ANTHROPIC_API_KEY | Your Pendra API key. |
ANTHROPIC_MODEL | The main model. |
ANTHROPIC_DEFAULT_HAIKU_MODEL | The 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
-
401means the key is wrong or not set. Check it starts withpdr_sk_and is exported in the terminal that runsclaude. -
404naming a Claude model means Claude Code asked for one of Anthropic's models. SetANTHROPIC_MODELandANTHROPIC_DEFAULT_HAIKU_MODEL. If it names a Sonnet or Opus model, setANTHROPIC_DEFAULT_SONNET_MODELandANTHROPIC_DEFAULT_OPUS_MODELas 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.