Pricing: The Claude Code endpoint is billed at 20% of the official Anthropic API pricing.
| Model | Input | Cache Write | Cache Read | Output |
|---|---|---|---|---|
| claude-fable-5 | $2.00 | $2.50 | $0.20 | $10.00 |
| claude-opus-4-6 claude-opus-4-7 claude-opus-4-8 | $1.00 | $1.25 | $0.10 | $5.00 |
| claude-sonnet-4-6 | $0.60 | $0.75 | $0.06 | $3.00 |
| claude-haiku-4-5 | $0.20 | $0.25 | $0.02 | $1.00 |
Access: This endpoint is available to subscribed users only. Free-tier users cannot access the Claude Code reverse proxy. Please upgrade your plan to use this feature.
| Variable | Value |
|---|---|
ANTHROPIC_BASE_URL | https://api.piapi.ai/v1/claude-code |
ANTHROPIC_API_KEY | Your user API key |
settings.json (recommended for project-level config).claude/settings.json file in your project directory:your-api-key with your actual API key.apiKeyHelper instead of ANTHROPIC_API_KEY?apiKeyHelper (shell command output) ← highestANTHROPIC_API_KEY environment variableclaude login) ← lowestclaude login, an OAuth token is stored in ~/.claude/.credentials.json. This token silently overrides ANTHROPIC_API_KEY, causing requests to be sent with the wrong credentials. Using apiKeyHelper avoids this problem entirely.claude inside the project directory — no shell rc changes needed..env file (recommended for long-term use)export (temporary / per-session)/model command to switch between Claude models:/model403 "This endpoint is reserved for Claude Code CLI only"claude CLI. Custom curl scripts or third-party SDKs are not allowed to call this endpoint directly.~/.claude/.env and re-source your shell rc file.