| Method and path | POST /v1/messages, relative to https://api.inferbase.ai |
| Purpose | The same router in Anthropic's dialect. An Anthropic SDK, or Claude Code, routes through Inferbase unchanged. |
| Authentication | API key as a bearer token. The SDK's default x-api-key header is not read; set the SDK's auth token. |
| Limits | As chat completions. |
Setup
Point ANTHROPIC_BASE_URL at https://api.inferbase.ai, and pass the Inferbase key as the auth token.
from anthropic import Anthropic
client = Anthropic(auth_token="inf_your_api_key", base_url="https://api.inferbase.ai")Request
model takes the same values as the OpenAI surface, auto included, so an Anthropic client can route. Tool loops work in both directions: tool_use and tool_result blocks, streamed tool calls as input_json_delta events, and cumulative usage with the cache split on message_delta. Images are accepted.
Not translated yet, and refused with a 400 naming the field rather than dropped: thinking, document blocks, and images inside a tool result.
A session is named with the X-Inferbase-Session header, since the Messages shape has no routing field.
The answer is text unless the request names an image with the X-Inferbase-Intent: image header. The image model's answer then arrives as an image content block, with a url source or a base64 one, whichever the provider returned. An image answer is non-streamed only. The speech and video intents have no shape in this dialect and are refused with a 400: send those to chat completions with the same header, or to the audio and video endpoints. Without the header no media intent is inferred, so a Messages request always receives the shape it can read.
Example
curl https://api.inferbase.ai/v1/messages \
-H "Authorization: Bearer inf_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello!"}]
}'Response
The Anthropic Messages shape. model names the model that served the request.
Errors
Errors use Anthropic's envelope on this path: {"type": "error", "error": {...}, "request_id": "..."}, with 400 for a malformed request as Anthropic answers it. The conditions are the same as on chat completions. See Errors.
Last updated October 1, 2026.