Chat Completions API
curl --request POST \
--url https://api.unifically.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"messages": [
{}
],
"stream": true,
"temperature": 123,
"max_tokens": 123,
"top_p": 123,
"stop": {},
"tools": [
{}
],
"tool_choice": {},
"response_format": {}
}
'import requests
url = "https://api.unifically.com/v1/chat/completions"
payload = {
"model": "<string>",
"messages": [{}],
"stream": True,
"temperature": 123,
"max_tokens": 123,
"top_p": 123,
"stop": {},
"tools": [{}],
"tool_choice": {},
"response_format": {}
}
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>',
messages: [{}],
stream: true,
temperature: 123,
max_tokens: 123,
top_p: 123,
stop: {},
tools: [{}],
tool_choice: {},
response_format: {}
})
};
fetch('https://api.unifically.com/v1/chat/completions', 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/chat/completions",
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>',
'messages' => [
[
]
],
'stream' => true,
'temperature' => 123,
'max_tokens' => 123,
'top_p' => 123,
'stop' => [
],
'tools' => [
[
]
],
'tool_choice' => [
],
'response_format' => [
]
]),
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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"stop\": {},\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"response_format\": {}\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/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"stop\": {},\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"response_format\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unifically.com/v1/chat/completions")
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 \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"stop\": {},\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"response_format\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1710000000,
"model": "openai/gpt-5.4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing uses quantum bits..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"completion_tokens": 64,
"total_tokens": 92
}
}
Getting Started
Chat Completions API
OpenAI-compatible chat completions for all supported LLM models
POST
/
v1
/
chat
/
completions
Chat Completions API
curl --request POST \
--url https://api.unifically.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"messages": [
{}
],
"stream": true,
"temperature": 123,
"max_tokens": 123,
"top_p": 123,
"stop": {},
"tools": [
{}
],
"tool_choice": {},
"response_format": {}
}
'import requests
url = "https://api.unifically.com/v1/chat/completions"
payload = {
"model": "<string>",
"messages": [{}],
"stream": True,
"temperature": 123,
"max_tokens": 123,
"top_p": 123,
"stop": {},
"tools": [{}],
"tool_choice": {},
"response_format": {}
}
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>',
messages: [{}],
stream: true,
temperature: 123,
max_tokens: 123,
top_p: 123,
stop: {},
tools: [{}],
tool_choice: {},
response_format: {}
})
};
fetch('https://api.unifically.com/v1/chat/completions', 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/chat/completions",
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>',
'messages' => [
[
]
],
'stream' => true,
'temperature' => 123,
'max_tokens' => 123,
'top_p' => 123,
'stop' => [
],
'tools' => [
[
]
],
'tool_choice' => [
],
'response_format' => [
]
]),
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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"stop\": {},\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"response_format\": {}\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/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"stop\": {},\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"response_format\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unifically.com/v1/chat/completions")
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 \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"stop\": {},\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"response_format\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1710000000,
"model": "openai/gpt-5.4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing uses quantum bits..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"completion_tokens": 64,
"total_tokens": 92
}
}
The
Each chunk is a
See individual model pages under LLM Models for details.
/v1/chat/completions endpoint provides an OpenAI-compatible interface for text generation. Use the same request format as the OpenAI Chat Completions 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 Chat Completion
POST/v1/chat/completions
Request
curl -X POST https://api.unifically.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "openai/gpt-5.4",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in one paragraph."}
]
}'
Request Parameters
string
required
Model identifier in
provider/model-name format. See Available LLM Models.array
required
Array of message objects with
role (system, user, or assistant) and content (string or content parts array).boolean
If
true, the response is streamed using server-sent events. Default: false.number
Sampling temperature between
0 and 2. Higher values produce more random output.integer
Maximum number of tokens to generate in the completion.
number
Nucleus sampling parameter. Alternative to temperature.
string | array
Up to four sequences where the model stops generating further tokens.
array
List of tools the model may call. Each tool requires a
type and function definition.string | object
Controls which (if any) tool is called. Options:
none, auto, required, or a specific tool.object
Set
{ "type": "json_object" } to enable JSON mode when supported by the model.Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1710000000,
"model": "openai/gpt-5.4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing uses quantum bits..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"completion_tokens": 64,
"total_tokens": 92
}
}
Streaming Response
Whenstream: true, the API returns text/event-stream chunks in OpenAI format:
curl -X POST https://api.unifically.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "anthropic/claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'
data: line containing a partial completion object, ending with data: [DONE].
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 any OpenAI SDK at Unifically by changing the base URL:from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.unifically.com/v1"
)
response = client.chat.completions.create(
model="openai/gpt-5.4",
messages=[{"role": "user", "content": "Hello!"}]
)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.UNIFICALLY_API_KEY,
baseURL: "https://api.unifically.com/v1",
});
const response = await client.chat.completions.create({
model: "anthropic/claude-sonnet-4-6",
messages: [{ role: "user", content: "Hello!" }],
});
⌘I
