Messages API
curl --request POST \
--url https://api.unifically.com/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"max_tokens": 123,
"messages": [
{}
],
"system": {},
"stream": true,
"temperature": 123,
"top_p": 123,
"stop_sequences": [
{}
],
"tools": [
{}
],
"tool_choice": {}
}
'import requests
url = "https://api.unifically.com/v1/messages"
payload = {
"model": "<string>",
"max_tokens": 123,
"messages": [{}],
"system": {},
"stream": True,
"temperature": 123,
"top_p": 123,
"stop_sequences": [{}],
"tools": [{}],
"tool_choice": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
max_tokens: 123,
messages: [{}],
system: {},
stream: true,
temperature: 123,
top_p: 123,
stop_sequences: [{}],
tools: [{}],
tool_choice: {}
})
};
fetch('https://api.unifically.com/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.unifically.com/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'max_tokens' => 123,
'messages' => [
[
]
],
'system' => [
],
'stream' => true,
'temperature' => 123,
'top_p' => 123,
'stop_sequences' => [
[
]
],
'tools' => [
[
]
],
'tool_choice' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.unifically.com/v1/messages"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"system\": {},\n \"stream\": true,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.unifically.com/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"system\": {},\n \"stream\": true,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unifically.com/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"system\": {},\n \"stream\": true,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_abc123",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-sonnet-4-6",
"content": [
{
"type": "text",
"text": "Quantum computing harnesses quantum mechanical phenomena..."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 18,
"output_tokens": 72
}
}
Getting Started
Messages API
Anthropic Messages-compatible API for all supported LLM models
POST
/
v1
/
messages
Messages API
curl --request POST \
--url https://api.unifically.com/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"max_tokens": 123,
"messages": [
{}
],
"system": {},
"stream": true,
"temperature": 123,
"top_p": 123,
"stop_sequences": [
{}
],
"tools": [
{}
],
"tool_choice": {}
}
'import requests
url = "https://api.unifically.com/v1/messages"
payload = {
"model": "<string>",
"max_tokens": 123,
"messages": [{}],
"system": {},
"stream": True,
"temperature": 123,
"top_p": 123,
"stop_sequences": [{}],
"tools": [{}],
"tool_choice": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
max_tokens: 123,
messages: [{}],
system: {},
stream: true,
temperature: 123,
top_p: 123,
stop_sequences: [{}],
tools: [{}],
tool_choice: {}
})
};
fetch('https://api.unifically.com/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.unifically.com/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'max_tokens' => 123,
'messages' => [
[
]
],
'system' => [
],
'stream' => true,
'temperature' => 123,
'top_p' => 123,
'stop_sequences' => [
[
]
],
'tools' => [
[
]
],
'tool_choice' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.unifically.com/v1/messages"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"system\": {},\n \"stream\": true,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.unifically.com/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"system\": {},\n \"stream\": true,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unifically.com/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"system\": {},\n \"stream\": true,\n \"temperature\": 123,\n \"top_p\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_abc123",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-sonnet-4-6",
"content": [
{
"type": "text",
"text": "Quantum computing harnesses quantum mechanical phenomena..."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 18,
"output_tokens": 72
}
}
The
See individual model pages under LLM Models for details.
/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.
All LLM models support this endpoint, including Cursor, OpenAI, and Anthropic models.
Create Message
POST/v1/messages
Request
curl -X POST https://api.unifically.com/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "anthropic/claude-sonnet-4-6",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Explain quantum computing in one paragraph."}
]
}'
Request Parameters
Model identifier in
provider/model-name format. See Available LLM Models.Maximum number of tokens to generate before stopping.
Array of message objects with
role (user or assistant) and content (string or content blocks array).System prompt providing context and instructions to the model.
If
true, the response is streamed using server-sent events. Default: false.Sampling temperature between
0 and 1.Nucleus sampling parameter. Use either
temperature or top_p, not both.Custom sequences that cause the model to stop generating.
Definitions of tools the model may use. Each tool includes
name, description, and input_schema.Controls tool usage. Default:
{ "type": "auto" }.System Prompt Example
curl -X POST https://api.unifically.com/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "openai/gpt-5.4",
"max_tokens": 512,
"system": "You are a helpful coding assistant. Be concise.",
"messages": [
{"role": "user", "content": "What is a closure in JavaScript?"}
]
}'
Response
{
"id": "msg_abc123",
"type": "message",
"role": "assistant",
"model": "anthropic/claude-sonnet-4-6",
"content": [
{
"type": "text",
"text": "Quantum computing harnesses quantum mechanical phenomena..."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 18,
"output_tokens": 72
}
}
Streaming Response
Whenstream: true, the API returns text/event-stream with Anthropic-compatible event types (message_start, content_block_delta, message_stop, etc.):
curl -X POST https://api.unifically.com/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "cursor/composer-2.5-fast",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'
Supported Models
| Model | Provider |
|---|---|
cursor/composer-2.5 | Cursor |
cursor/composer-2.5-fast | Cursor |
openai/gpt-5.4-mini | OpenAI |
openai/gpt-5.4-nano | OpenAI |
openai/gpt-5.4 | OpenAI |
openai/gpt-5.5 | OpenAI |
anthropic/claude-sonnet-4-6 | Anthropic |
anthropic/claude-opus-4-6 | Anthropic |
anthropic/claude-opus-4-7 | Anthropic |
anthropic/claude-opus-4-8 | Anthropic |
SDK Compatibility
Point the Anthropic SDK at Unifically by changing the base URL:import anthropic
client = anthropic.Anthropic(
api_key="YOUR_API_KEY",
base_url="https://api.unifically.com"
)
message = client.messages.create(
model="anthropic/claude-opus-4-7",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}]
)
print(message.content[0].text)
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.UNIFICALLY_API_KEY,
baseURL: "https://api.unifically.com",
});
const message = await client.messages.create({
model: "anthropic/claude-sonnet-4-6",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello!" }],
});
⌘I
