Anthropic
Native Anthropic API support with prompt caching, streaming, and OAuth passthrough.
Configuration
Set your Anthropic API key:
1export ANTHROPIC_API_KEY=sk-ant-api03-...Endpoints
RelayPlane supports both the native Anthropic API and OpenAI-compatible format:
POST /v1/messages— Native Anthropic Messages API (used by Claude Code)POST /v1/chat/completions— OpenAI-compatible format (auto-converts to/from Anthropic)POST /v1/messages/count_tokens— Token counting passthrough
Supported Models
| Alias | Resolves To |
|---|---|
opus | claude-opus-4-6 |
sonnet | claude-sonnet-4-6 |
haiku | claude-haiku-4-5 |
claude-3-5-sonnet | claude-3-5-sonnet-latest |
claude-3-5-haiku | claude-haiku-4-5 |
You can also use any full model ID like claude-sonnet-4-20250514 directly.
Prompt Caching
Anthropic prompt caching is fully supported. RelayPlane:
- Passes through
anthropic-betaheaders for cache control - Tracks
cache_creation_input_tokensandcache_read_input_tokensin telemetry - Accounts for cache pricing in cost estimates (1.25× for creation, 0.1× for reads)
Authentication Modes
Authentication priority (highest to lowest):
- Incoming
Authorizationheader (Bearer token from Claude Code OAuth) - Incoming
x-api-keyheader ANTHROPIC_API_KEYenvironment variable
Hybrid Auth
If you have a MAX subscription token for Opus models and a regular API key for others, configure hybrid auth:
1{2 "auth": {3 "anthropicMaxToken": "sk-ant-oat-...",4 "useMaxForModels": ["opus", "claude-opus"]5 }6}MAX tokens (sk-ant-oat*) use the Authorization: Bearer header, while regular API keys use x-api-key.
Tool Calling
When using the OpenAI-compatible endpoint, RelayPlane automatically converts between formats:
- OpenAI
tools→ Anthropictools(name, description, input_schema) - OpenAI
tool_choice→ Anthropictool_choice - Anthropic
tool_useresponses → OpenAItool_callsformat
Base URL: The Anthropic API endpoint is
https://api.anthropic.com/v1. This is hardcoded and not configurable.