Skip to Content
ModelsClaudeOverview

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.

Common model IDs (copy them exactly)
Claude Opus 5.5anthropic/claude-opus-5.5
Claude Sonnet 5.5anthropic/claude-sonnet-5.5
Claude Haiku 5.5anthropic/claude-haiku-5.5
Claude Fable 5.1anthropic/claude-fable-5.1

You can omit the anthropic/ prefix or use Anthropic’s official format. All of the following refer to the same model:

FormatExample
OfoxAI standardanthropic/claude-sonnet-4.6
Prefix omittedclaude-sonnet-4.6
Official (hyphens)claude-sonnet-4-6
Official with dateclaude-sonnet-4-6-20260217

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

Key pointUse the Anthropic-native API for extended thinking, prompt caching, or tools such as Claude Code.
Anthropic-native API (recommended)OpenAI-compatible API
EndpointPOST https://api.ofox.io/anthropic/v1/messagesPOST https://api.ofox.io/v1/chat/completions
SDK base_urlhttps://api.ofox.io/anthropichttps://api.ofox.io/v1
Authenticationx-api-key: <Key>; Authorization: Bearer <Key> is also acceptedAuthorization: Bearer <Key>
Extended thinkingthinking parameter; returns thinking blocksreasoning parameter; returns reasoning_details
Prompt cachingcache_control; usage reports both cache writes and readsAdd cache_control to message content blocks; usage reports reads only
PDFdocument content blockfile content block
Web searchSupported (requires the Anthropic provider)Not supported

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:

ProviderModelsEndpointsNotes
Amazon Bedrock (aws_bedrock)All modelsBothDefault provider
Anthropic (anthropic)Fable 5, Opus 4.8, Opus 4.7, Sonnet 5Anthropic-native API onlySupports web search; must be selected explicitly

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

claude_basic.py
import os import anthropic client = anthropic.Anthropic( base_url="https://api.ofox.io/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.io/anthropic. For setup steps, see Claude Code setup.

Claude Code settings
ANTHROPIC_BASE_URLhttps://api.ofox.io/anthropic
ANTHROPIC_AUTH_TOKENPaste your OfoxAI API key

Common errors

Key pointParameter errors return 400 with a reason. A truncated response is not an error; check stop_reason.
HTTP · typeError messageCauseFix
400 ValidationExceptionprompt is too long: 280527 tokens > 200000 maximumInput exceeds the model’s context windowShorten the input, or switch to a model with 1M context (any model other than Haiku 4.5)
404 model_not_foundModel 'anthropic/claude-sonnet-9' not foundModel ID misspelled, or the model has been retiredCopy the model ID from this page
401 invalid_api_keyInvalid or expired API keyKey is wrong, deleted or expiredCheck the key in the console; on the native API, check the x-api-key header
400No available channel for platform 'anthropic' on model ...The selected provider doesn’t serve this modelRemove the provider selection, or use a provider listed in the error message — see Providers
200, stop_reason: "max_tokens"—Output reached the max_tokens limit and the response was truncatedIncrease max_tokens; with thinking enabled, thinking also counts against this limit

For other general errors, see Error Handling.

Official docs

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.io/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.

Last updated on