Integrations
Claude Code
Claude Code is
Anthropic's coding agent. Because Pendra exposes an Anthropic-compatible
/v1/messages endpoint, Claude Code works against Pendra with
no source-code changes — just two environment variables.
Setup
# Point Claude Code at Pendra. It appends /v1/messages, so point at the bare host.
export ANTHROPIC_BASE_URL=https://api.pendra.ai
export ANTHROPIC_API_KEY=pdr_sk_...
# Optional: pick which Pendra-served models Claude Code uses
export ANTHROPIC_MODEL=qwen3.6:27b
export ANTHROPIC_SMALL_FAST_MODEL=qwen3.6:27b
claude That's it. Run claude in your project directory and it talks to Pendra.
What each variable does
| Variable | Purpose |
|---|---|
ANTHROPIC_BASE_URL | Tells Claude Code where to send requests. Use the bare host — Claude Code appends /v1/messages. |
ANTHROPIC_API_KEY | Your Pendra API key. Yes, the name says "Anthropic"; Claude Code sends it as x-api-key, which Pendra accepts. |
ANTHROPIC_MODEL | (Optional) The primary model Claude Code uses. Defaults to Claude Sonnet, which isn't a Pendra model — pin a real Pendra model here. |
ANTHROPIC_SMALL_FAST_MODEL | (Optional) The cheaper/faster model Claude Code uses for background tasks like file summarisation. |
Choosing a model
Browse models with /models:
curl https://api.pendra.ai/api/v1/models -H "Authorization: Bearer pdr_sk_..."
Coding agents do well on reasoning-strong open models such as
qwen3.6:27b, gpt-oss:120b, or one of the
larger Llama derivatives — pick what's available on your worker pool.
Persisting the config
Drop the two exports into your shell rc so every terminal session picks them up:
# Put this in ~/.zshrc or ~/.bashrc so every shell picks it up
export ANTHROPIC_BASE_URL=https://api.pendra.ai
export ANTHROPIC_API_KEY=$(pendra-keychain get prod) # or whichever secret store you use Verifying the connection
Run claude and ask it something small ("write a haiku about
Snowdonia"). If the response comes back, you're connected to Pendra.
Confirm by checking Usage in the
console — you'll see the request immediately.
Troubleshooting
- 401 Unauthorized: double-check the key starts with
pdr_sk_and is exported in the same shell that runsclaude. - "Model not found": set
ANTHROPIC_MODELto a model that actually exists in your worker pool (see Models). - Slow first response: cold workers can take 10–30s to load a model. Subsequent requests are fast.
Related
- Anthropic Messages API — the underlying endpoint.
- Authentication — full key reference.