Call Claude
Claude models answer on both the official Anthropic Messages API and the OpenAI-compatible Chat Completions API. Code that already uses the Anthropic SDK, the OpenAI SDK or Claude Code only needs the Decode address and key.
Create a Claude key
In API Keys, create a key and pick the Claude group. Claude models are only in that group: a key in a video or image group fails with no available channel. All keys of one account share one balance.
Anthropic API
POST /v1/messages takes the same requests and returns the same responses as the official Anthropic Messages API, including streaming (stream), prompt caching (cache_control), effort (output_config.effort) and tool use. Send the key in either the x-api-key or the Authorization: Bearer header.
curl https://decode8.com/v1/messages \
-H "x-api-key: $DECODE_CLAUDE_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-5-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Introduce yourself in one sentence."}]
}'
import anthropic
client = anthropic.Anthropic(base_url="https://decode8.com", api_key="sk-...")
message = client.messages.create(
model="claude-opus-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Introduce yourself in one sentence."}],
)
print(message.content[-1].text)
The Anthropic SDK's base_url has no /v1.
OpenAI-compatible API
POST /v1/chat/completions, with base_url set to https://decode8.com/v1:
from openai import OpenAI
client = OpenAI(base_url="https://decode8.com/v1", api_key="sk-...")
response = client.chat.completions.create(
model="claude-sonnet-5-5",
messages=[{"role": "user", "content": "Introduce yourself in one sentence."}],
)
print(response.choices[0].message.content)
Use with Claude Code
Set two environment variables, then start claude:
export ANTHROPIC_BASE_URL=https://decode8.com
export ANTHROPIC_AUTH_TOKEN=sk-...
claude
Claude billing
Billed on the tokens actually used, at 35% of the official Anthropic price; per-model prices are under Models.
| Item | Price |
|---|---|
| Input, output, cache read | See Models |
| Cache write (5 minutes) | 1.25 × the input price |
| Cache write (1 hour) | 2 × the input price |
claude-haiku-5-5 long input |
Above 100K input tokens: input $0.175, output $0.875, cache read $0.0175 |
| Fast mode | Every price × 2 when a claude-opus-5-5 or claude-fable-5-2 request sends "speed": "fast" |
Thinking tokens bill as output. Failed requests are not charged. Every charge is listed in the usage log.