The Infercom API supports Anthropic’s Messages API format (Documentation Index
Fetch the complete documentation index at: https://docs.infercom.ai/llms.txt
Use this file to discover all available pages before exploring further.
/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, MiniMax-M2.5, 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
| Parameter | Type | Description |
|---|---|---|
model | string | Required. The model to use (e.g., MiniMax-M2.7) |
messages | array | Required. Array of message objects with role and content |
max_tokens | integer | Required. Maximum tokens to generate |
system | string | System prompt for the model |
temperature | number | Sampling temperature (0.0-1.0) |
top_p | number | Nucleus sampling parameter |
top_k | integer | Top-k sampling parameter |
stop_sequences | array | Custom stop sequences |
stream | boolean | Enable streaming responses |
tools | array | Tool definitions for function calling |
tool_choice | object | Control tool usage (auto, any, or specific tool) |
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
| Aspect | Anthropic | Infercom |
|---|---|---|
| Models | Claude (Opus, Sonnet, Haiku) | Open-source models (MiniMax, DeepSeek, Llama, Gemma) |
| Base URL | https://api.anthropic.com | https://api.infercom.ai |
| API key header | x-api-key | x-api-key (same) |
| Version header | Required: anthropic-version | Supported but optional |
When to use Anthropic vs OpenAI compatibility
| Use case | Recommended API |
|---|---|
| Existing Anthropic SDK code | Anthropic Messages API (/v1/messages) |
| Claude Code, LangChain Anthropic | Anthropic Messages API (/v1/messages) |
| OpenAI SDK code | OpenAI Chat Completions API (/v1/chat/completions) |
| Agentic workflows, coding tools | Responses API (/v1/responses) |
| New projects | Any - all three APIs work with the same models |
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