Claude API Gateway: Native /v1/messages & SDK Setup
Use official Anthropic SDKs and Claude Code against https://deepclub.net (native /v1/messages) with Zero Data Retention and prompt cache discounts.
Calling Claude via Native Anthropic Messages
For Claude 5.x models, prefer POST /v1/messages so native content blocks, tool calling, adaptive thinking, and prompt caching work as intended.
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ["DEEPCLUB_API_KEY"],
base_url="https://deepclub.net",
)
msg = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Summarize two benefits of exponential backoff."}],
)
print(msg.content[0].text)
Key Rules for Claude 5.x on /v1/messages
- Omit non-default sampling parameters:
claude-opus-5-5,claude-sonnet-5-5, andclaude-fable-5-2reject customtemperature,top_p, ortop_kon native/v1/messageswith HTTP 400. - Mind the
/v1suffix: Official Anthropic SDK and Claude Code takehttps://deepclub.net(without/v1), while@ai-sdk/anthropictakeshttps://deepclub.net/v1. - Check live token & cache rates: See Live LLM API Pricing and Prompt Caching Guide.
Frequently Asked Questions
- Why does Anthropic Python SDK use https://deepclub.net without /v1?
- The official Anthropic SDK automatically appends /v1/messages to base_url. Adding /v1 produces /v1/v1/messages and causes a 404 error.
- Can I still call Claude through OpenAI Chat Completions clients?
- Yes, listed Claude models also expose /v1/chat/completions for clients limited to OpenAI-compatible mode, though native /v1/messages is recommended for new integrations.
Updated