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 four environment variables.

Setup

bash
# 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_...

# Which Pendra-served models Claude Code uses. Both are required — Claude Code
# defaults to Anthropic's own model names, which Pendra doesn't serve.
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

VariablePurpose
ANTHROPIC_BASE_URLTells Claude Code where to send requests. Use the bare host — Claude Code appends /v1/messages.
ANTHROPIC_API_KEYYour Pendra API key. Yes, the name says "Anthropic"; Claude Code sends it as x-api-key, which Pendra accepts.
ANTHROPIC_MODELThe primary model Claude Code uses. Required: it otherwise defaults to Claude Sonnet, which isn't a Pendra model, and the request comes back 404.
ANTHROPIC_SMALL_FAST_MODELThe model Claude Code uses for background tasks like file summarisation. Required for the same reason — set it even if it's the same id as above.

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:

~/.zshrc
# 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
export ANTHROPIC_MODEL=qwen3.6:27b
export ANTHROPIC_SMALL_FAST_MODEL=qwen3.6:27b

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 runs claude.
  • 404 "Model 'claude-...' not found": Claude Code is still sending an Anthropic model name. Set ANTHROPIC_MODEL and ANTHROPIC_SMALL_FAST_MODEL to models that exist in your worker pool (see Models), in the same shell that runs claude. Pendra never quietly serves a different model in place of one it doesn't recognise.
  • Slow first response: cold workers can take 10–30s to load a model. Subsequent requests are fast.

Related