/v1/messages), enabling you to use the Anthropic Python SDK and compatible tooling with Infercom’s models. This is useful for applications and frameworks built around the Anthropic API, such as Claude Code, LangChain’s Anthropic provider, or custom agentic workflows.
The Anthropic SDK was designed for Claude models. When using it with Infercom, you’re accessing open-source models (like MiniMax, DeepSeek, Llama) through an Anthropic-compatible interface - not Claude itself.
Install the Anthropic SDK
Configure the client
Set thebase_url to Infercom’s API and provide your Infercom API key.
Don’t have an Infercom API key? Get yours from the API keys and URLs page.
Basic usage
Non-streaming example
Streaming example
System prompts
Use thesystem parameter to provide instructions to the model.
Multi-turn conversations
Tool use (function calling)
The Anthropic Messages API supports tool use for models that have function calling capabilities.Tool use works with
MiniMax-M2.7 and gpt-oss-120b. Other models may not reliably call tools. See Function calling for model-specific guidance.Defining tools
tool_use content block:
Providing tool results
After executing the tool, send the result back to continue the conversation:Async usage
Using curl
You can also call the Messages API directly with curl:Supported parameters
Unsupported features
The following Anthropic-specific features are not supported:- Extended thinking (
thinkingparameter) - Prompt caching (
cache_control) - Vision/image inputs
- PDF file inputs
- Citations
- Server-side tools (web search, code execution)
- Batch API
Differences from Anthropic’s API
When to use Anthropic vs OpenAI compatibility
Related documentation
- OpenAI compatibility - Using the OpenAI SDK
- Function calling - Detailed guide on tool use
- Responses API - Agentic workflows with structured outputs
- Supported models - Available models and capabilities