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.ai/anthropic/v1/messagesPOST https://api.ofox.ai/v1/chat/completions
SDK base_urlhttps://api.ofox.ai/anthropichttps://api.ofox.ai/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)—

For the full request parameters, see the Anthropic Messages API and the Chat Completions API.

Providers

Available providers and protocols vary by model. Check the model page before pinning a provider.

ProviderModelsEndpointsNotes
Amazon Bedrock (aws_bedrock)Varies by modelVaries by model—
Anthropic (anthropic)Sonnet 5.5 , Haiku 5.5 Anthropic Messages, Chat Completions and Responsesweb search with Sonnet 5.5

To select a provider, set the 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.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.

Claude Code settings
ANTHROPIC_BASE_URLhttps://api.ofox.ai/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 longInput exceeds the model’s context windowShorten the input or choose a model with a larger context window.
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.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?

Your input exceeds the model’s context window. Shorten it or use a model with a larger context window.

Does Claude Haiku 5.5 support 1M context?

Yes. Claude Haiku 5.5 supports 1M tokens on OfoxAI.

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?

Check the model page for available providers. Anthropic serves Sonnet 5.5 and Haiku 5.5. To pin it, set the X-OfoxAI-Provider-Type: anthropic header.

Can Claude search the web?

For web search with Sonnet 5.5, use the Anthropic-native Messages API and pin the Anthropic provider. Check the Web Search capability on other models’ pages.

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