Claude family
Anthropic’s Claude models, including the Opus, Sonnet, Haiku and Fable series. We recommend calling them through the Anthropic-native API, where extended thinking, prompt caching, PDF input and other features behave as in the official API. The OpenAI-compatible API also works and suits projects that already use the OpenAI SDK.
Common tasks
Models
All models accept text, image and PDF input and support tool calling. For the full model list and live prices, see the model page , or query the Models API.
anthropic/claude-opus-5.5anthropic/claude-sonnet-5.5anthropic/claude-haiku-5.5anthropic/claude-fable-5.1You can omit the anthropic/ prefix or use Anthropic’s official format. All of the following refer to the same model:
The aliases available for each model are listed in the aliases field returned by the Models API. The model field in responses always uses the standard format.
Choosing an endpoint
For the full request parameters, see the Anthropic Messages API and the Chat Completions API.
Providers
Claude models are served by two providers, and the same model supports different features on each:
On the Anthropic-native API, you can select the provider with a request header:
-H "X-OfoxAI-Provider-Type: anthropic"If the selected provider doesn’t serve the model, the request returns 400 and the error message lists the available providers, for example:
No available channel for platform 'anthropic' on model 'anthropic/claude-sonnet-4.6'. Available platforms for this model: aws_bedrock.For other ways to select a provider, see Provider routing.
Examples
Python (Anthropic SDK)
import os
import anthropic
client = anthropic.Anthropic(
base_url="https://api.ofox.ai/anthropic",
api_key=os.environ["OFOX_API_KEY"],
)
message = client.messages.create(
model="anthropic/claude-sonnet-4.6",
max_tokens=1024,
system="You are a senior backend engineer. Keep answers concise.",
messages=[{"role": "user", "content": "Explain idempotency in one sentence."}],
)
print(message.content[0].text)max_tokens is required on the Anthropic-native API and must not exceed the model’s maximum output.
Use in Claude Code
Claude Code calls the Anthropic-native API, with the base URL https://api.ofox.ai/anthropic. For setup steps, see Claude Code setup.
https://api.ofox.ai/anthropicCommon errors
For other general errors, see Error Handling.
Official docs
- Anthropic · Models overview
- Anthropic · Extended thinking
- Anthropic · Prompt caching
- Anthropic · PDF support
The official docs describe behavior when calling Anthropic directly. When calling through OfoxAI, model IDs and endpoints on this page take precedence.
FAQ
How do I write a Claude model ID?
The standard format is anthropic/claude-sonnet-4.6. You can also omit the anthropic/ prefix, or use the official formats claude-sonnet-4-6 and claude-sonnet-4-6-20260217; all refer to the same model.
Can I call Claude with the OpenAI SDK?
Yes. Set base_url to https://api.ofox.ai/v1 and use a model ID such as anthropic/claude-sonnet-4.6. If you need extended thinking or full cache usage details, we recommend the Anthropic-native API.
How do I enable thinking for Claude?
On the native API, pass thinking: {"type": "enabled", "budget_tokens": 2000}, where budget_tokens is at least 1024 and less than max_tokens; or pass {"type": "adaptive"} to let the model decide. On the OpenAI-compatible API, pass reasoning: {"max_tokens": 2000}. Do not set temperature when thinking is enabled.
What should I do if Claude prompt caching is not working?
Check in order: whether cache_control is set on the fixed content blocks (neither endpoint caches automatically); whether the content reaches the minimum cacheable length; whether the prefixes of the two requests are exactly identical; and whether more than 5 minutes passed between the two requests.
How do I fix the error prompt is too long?
The input exceeds the model context window. Haiku 4.5 has a 200K-token context; other Claude models have 1M tokens. Switch to another model or shorten the input.
Does Claude support 1M context? Do I need a beta header?
All models except Haiku 4.5 support 1M context. On OfoxAI no beta header is needed.
What should I do if Claude responses are truncated?
Check stop_reason in the response. If it is max_tokens, the output hit the limit; increase max_tokens. With thinking enabled, thinking content also counts against max_tokens.
Which provider serves Claude on OfoxAI?
All models are served by Amazon Bedrock, the default provider. Fable 5, Opus 4.8, Opus 4.7 and Sonnet 5 are also available from the Anthropic provider, on the Anthropic-native API only; select it with the X-OfoxAI-Provider-Type: anthropic header.
Can Claude search the web?
Yes, but it requires the Anthropic provider, is limited to Fable 5, Opus 4.8, Opus 4.7 and Sonnet 5, and works only on the Anthropic-native API. Add {"type": "web_search_20250305", "name": "web_search"} to tools.
Can Claude read PDFs?
Yes. On the native API, pass a base64-encoded PDF in a document content block; on the OpenAI-compatible API, use a file content block with file_data in the data:application/pdf;base64,... format.