Skip to main content
POST
Messages API
The /v1/messages endpoint provides an Anthropic Messages API-compatible interface for text generation. Use the same request format as the Anthropic Messages API: swap the base URL to https://api.unifically.com and pass any supported model ID in the model field.
Support for this endpoint depends on the model. A model that cannot serve it returns an error. /v1/chat/completions works for every LLM model except Responses-only ones.

Create Message

POST /v1/messages

Request

Request Parameters

string
required
Model identifier in provider/model-name format. See Available LLM Models.
integer
required
Maximum number of tokens to generate before stopping.
array
required
Array of message objects with role (user or assistant) and content (string or content blocks array).
string | array
System prompt providing context and instructions to the model.
boolean
If true, the response is streamed using server-sent events. Default: false.
object
Turns on Claude’s extended thinking and returns the thinking text as thinking blocks. Claude 4.6 and newer: { "type": "adaptive" }. Claude 4.5 models: { "type": "enabled", "budget_tokens": N }, with max_tokens greater than N. See Extended Thinking.
number
Sampling temperature between 0 and 1.
number
Nucleus sampling parameter. Use either temperature or top_p, not both.
array
Custom sequences that cause the model to stop generating.
array
Definitions of tools the model may use. Each tool includes name, description, and input_schema.
object
Controls tool usage. Default: { "type": "auto" }.

System Prompt Example

Response

Response Fields

string
The model ID you sent in the request.
array
Content blocks. With thinking on, one or more thinking blocks come before the text block, and tool calls arrive as tool_use blocks. Read the block with type == "text" instead of assuming content[0] is text.
object
Token counts: input_tokens and output_tokens. May also include cache_read_input_tokens and cache_creation_input_tokens.

Streaming Response

When stream: true, the API returns text/event-stream with Anthropic-compatible event types (message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop). Text arrives as text_delta; with thinking on, you also get thinking_delta and signature_delta events.
If an error happens after the stream has started, the HTTP status stays 200 and the error arrives as an error event. See Error Handling.

Extended Thinking

To get Claude’s thinking text, send the thinking parameter on this endpoint. On /v1/chat/completions, Claude returns only the final answer. Claude 4.6 and newer models use adaptive thinking:
Claude 4.5 models (anthropic/claude-haiku-4-5, anthropic/claude-sonnet-4-5, anthropic/claude-opus-4-5) take a token budget instead. max_tokens must be greater than budget_tokens:
Claude Opus 5.5 rejects {"type": "enabled", "budget_tokens": ...} with a 400. Use {"type": "adaptive"}.
The response has thinking blocks before the text block:
In multi-turn tool use, send the thinking blocks back exactly as you received them, including signature. Do not edit or drop them.

Supported Models

See individual model pages under LLM Models for details.

SDK Compatibility

Point the Anthropic SDK at Unifically by changing the base URL. Pick the text block from content, since thinking blocks can come first: