curl --request POST \
--url https://ai.liara.ir/api/{workspaceID}/v1/chat/completions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-5",
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_calls": [
{}
],
"tool_call_id": "<string>",
"refusal": "<string>"
}
],
"stream": false,
"stream_options": {
"include_usage": true
},
"max_tokens": 123,
"max_completion_tokens": 123,
"temperature": 123,
"top_p": 123,
"top_k": 123,
"frequency_penalty": 123,
"presence_penalty": 123,
"repetition_penalty": 123,
"seed": 123,
"n": 2,
"stop": "<string>",
"logit_bias": {},
"logprobs": true,
"top_logprobs": 123,
"min_p": 123,
"top_a": 123,
"reasoning": {},
"reasoning_effort": "<string>",
"modalities": [],
"functions": [
{}
],
"tools": [
{}
],
"parallel_tool_calls": true,
"response_format": {},
"prediction": {},
"metadata": "<unknown>",
"store": true,
"service_tier": "<string>",
"user": "<string>"
}
'import requests
url = "https://ai.liara.ir/api/{workspaceID}/v1/chat/completions"
payload = {
"model": "openai/gpt-5",
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_calls": [{}],
"tool_call_id": "<string>",
"refusal": "<string>"
}
],
"stream": False,
"stream_options": { "include_usage": True },
"max_tokens": 123,
"max_completion_tokens": 123,
"temperature": 123,
"top_p": 123,
"top_k": 123,
"frequency_penalty": 123,
"presence_penalty": 123,
"repetition_penalty": 123,
"seed": 123,
"n": 2,
"stop": "<string>",
"logit_bias": {},
"logprobs": True,
"top_logprobs": 123,
"min_p": 123,
"top_a": 123,
"reasoning": {},
"reasoning_effort": "<string>",
"modalities": [],
"functions": [{}],
"tools": [{}],
"parallel_tool_calls": True,
"response_format": {},
"prediction": {},
"metadata": "<unknown>",
"store": True,
"service_tier": "<string>",
"user": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'openai/gpt-5',
messages: [
{
content: '<string>',
name: '<string>',
tool_calls: [{}],
tool_call_id: '<string>',
refusal: '<string>'
}
],
stream: false,
stream_options: {include_usage: true},
max_tokens: 123,
max_completion_tokens: 123,
temperature: 123,
top_p: 123,
top_k: 123,
frequency_penalty: 123,
presence_penalty: 123,
repetition_penalty: 123,
seed: 123,
n: 2,
stop: '<string>',
logit_bias: {},
logprobs: true,
top_logprobs: 123,
min_p: 123,
top_a: 123,
reasoning: {},
reasoning_effort: '<string>',
modalities: [],
functions: [{}],
tools: [{}],
parallel_tool_calls: true,
response_format: {},
prediction: {},
metadata: '<unknown>',
store: true,
service_tier: '<string>',
user: '<string>'
})
};
fetch('https://ai.liara.ir/api/{workspaceID}/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://ai.liara.ir/api/{workspaceID}/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' => 'openai/gpt-5',
'messages' => [
[
'content' => '<string>',
'name' => '<string>',
'tool_calls' => [
[
]
],
'tool_call_id' => '<string>',
'refusal' => '<string>'
]
],
'stream' => false,
'stream_options' => [
'include_usage' => true
],
'max_tokens' => 123,
'max_completion_tokens' => 123,
'temperature' => 123,
'top_p' => 123,
'top_k' => 123,
'frequency_penalty' => 123,
'presence_penalty' => 123,
'repetition_penalty' => 123,
'seed' => 123,
'n' => 2,
'stop' => '<string>',
'logit_bias' => [
],
'logprobs' => true,
'top_logprobs' => 123,
'min_p' => 123,
'top_a' => 123,
'reasoning' => [
],
'reasoning_effort' => '<string>',
'modalities' => [
],
'functions' => [
[
]
],
'tools' => [
[
]
],
'parallel_tool_calls' => true,
'response_format' => [
],
'prediction' => [
],
'metadata' => '<unknown>',
'store' => true,
'service_tier' => '<string>',
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://ai.liara.ir/api/{workspaceID}/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"openai/gpt-5\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"refusal\": \"<string>\"\n }\n ],\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"max_tokens\": 123,\n \"max_completion_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"repetition_penalty\": 123,\n \"seed\": 123,\n \"n\": 2,\n \"stop\": \"<string>\",\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"min_p\": 123,\n \"top_a\": 123,\n \"reasoning\": {},\n \"reasoning_effort\": \"<string>\",\n \"modalities\": [],\n \"functions\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"parallel_tool_calls\": true,\n \"response_format\": {},\n \"prediction\": {},\n \"metadata\": \"<unknown>\",\n \"store\": true,\n \"service_tier\": \"<string>\",\n \"user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://ai.liara.ir/api/{workspaceID}/v1/chat/completions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"openai/gpt-5\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"refusal\": \"<string>\"\n }\n ],\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"max_tokens\": 123,\n \"max_completion_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"repetition_penalty\": 123,\n \"seed\": 123,\n \"n\": 2,\n \"stop\": \"<string>\",\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"min_p\": 123,\n \"top_a\": 123,\n \"reasoning\": {},\n \"reasoning_effort\": \"<string>\",\n \"modalities\": [],\n \"functions\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"parallel_tool_calls\": true,\n \"response_format\": {},\n \"prediction\": {},\n \"metadata\": \"<unknown>\",\n \"store\": true,\n \"service_tier\": \"<string>\",\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.liara.ir/api/{workspaceID}/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"openai/gpt-5\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"refusal\": \"<string>\"\n }\n ],\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"max_tokens\": 123,\n \"max_completion_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"repetition_penalty\": 123,\n \"seed\": 123,\n \"n\": 2,\n \"stop\": \"<string>\",\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"min_p\": 123,\n \"top_a\": 123,\n \"reasoning\": {},\n \"reasoning_effort\": \"<string>\",\n \"modalities\": [],\n \"functions\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"parallel_tool_calls\": true,\n \"response_format\": {},\n \"prediction\": {},\n \"metadata\": \"<unknown>\",\n \"store\": true,\n \"service_tier\": \"<string>\",\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"object": "chat.completion",
"created": 123,
"choices": [
{
"index": 123,
"message": {
"content": "<string>",
"name": "<string>",
"tool_calls": [
{}
],
"tool_call_id": "<string>",
"refusal": "<string>"
},
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"total_cost_toman": 123,
"total_cost": 123
}
}This response has no body data.This response has no body data.This response has no body data.This response has no body data.This response has no body data.Create a chat completion
Creates a model response for the given conversation. Supports streaming via SSE, tool calling, and multi-modal input (text, images, files).
curl --request POST \
--url https://ai.liara.ir/api/{workspaceID}/v1/chat/completions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-5",
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_calls": [
{}
],
"tool_call_id": "<string>",
"refusal": "<string>"
}
],
"stream": false,
"stream_options": {
"include_usage": true
},
"max_tokens": 123,
"max_completion_tokens": 123,
"temperature": 123,
"top_p": 123,
"top_k": 123,
"frequency_penalty": 123,
"presence_penalty": 123,
"repetition_penalty": 123,
"seed": 123,
"n": 2,
"stop": "<string>",
"logit_bias": {},
"logprobs": true,
"top_logprobs": 123,
"min_p": 123,
"top_a": 123,
"reasoning": {},
"reasoning_effort": "<string>",
"modalities": [],
"functions": [
{}
],
"tools": [
{}
],
"parallel_tool_calls": true,
"response_format": {},
"prediction": {},
"metadata": "<unknown>",
"store": true,
"service_tier": "<string>",
"user": "<string>"
}
'import requests
url = "https://ai.liara.ir/api/{workspaceID}/v1/chat/completions"
payload = {
"model": "openai/gpt-5",
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_calls": [{}],
"tool_call_id": "<string>",
"refusal": "<string>"
}
],
"stream": False,
"stream_options": { "include_usage": True },
"max_tokens": 123,
"max_completion_tokens": 123,
"temperature": 123,
"top_p": 123,
"top_k": 123,
"frequency_penalty": 123,
"presence_penalty": 123,
"repetition_penalty": 123,
"seed": 123,
"n": 2,
"stop": "<string>",
"logit_bias": {},
"logprobs": True,
"top_logprobs": 123,
"min_p": 123,
"top_a": 123,
"reasoning": {},
"reasoning_effort": "<string>",
"modalities": [],
"functions": [{}],
"tools": [{}],
"parallel_tool_calls": True,
"response_format": {},
"prediction": {},
"metadata": "<unknown>",
"store": True,
"service_tier": "<string>",
"user": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'openai/gpt-5',
messages: [
{
content: '<string>',
name: '<string>',
tool_calls: [{}],
tool_call_id: '<string>',
refusal: '<string>'
}
],
stream: false,
stream_options: {include_usage: true},
max_tokens: 123,
max_completion_tokens: 123,
temperature: 123,
top_p: 123,
top_k: 123,
frequency_penalty: 123,
presence_penalty: 123,
repetition_penalty: 123,
seed: 123,
n: 2,
stop: '<string>',
logit_bias: {},
logprobs: true,
top_logprobs: 123,
min_p: 123,
top_a: 123,
reasoning: {},
reasoning_effort: '<string>',
modalities: [],
functions: [{}],
tools: [{}],
parallel_tool_calls: true,
response_format: {},
prediction: {},
metadata: '<unknown>',
store: true,
service_tier: '<string>',
user: '<string>'
})
};
fetch('https://ai.liara.ir/api/{workspaceID}/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://ai.liara.ir/api/{workspaceID}/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' => 'openai/gpt-5',
'messages' => [
[
'content' => '<string>',
'name' => '<string>',
'tool_calls' => [
[
]
],
'tool_call_id' => '<string>',
'refusal' => '<string>'
]
],
'stream' => false,
'stream_options' => [
'include_usage' => true
],
'max_tokens' => 123,
'max_completion_tokens' => 123,
'temperature' => 123,
'top_p' => 123,
'top_k' => 123,
'frequency_penalty' => 123,
'presence_penalty' => 123,
'repetition_penalty' => 123,
'seed' => 123,
'n' => 2,
'stop' => '<string>',
'logit_bias' => [
],
'logprobs' => true,
'top_logprobs' => 123,
'min_p' => 123,
'top_a' => 123,
'reasoning' => [
],
'reasoning_effort' => '<string>',
'modalities' => [
],
'functions' => [
[
]
],
'tools' => [
[
]
],
'parallel_tool_calls' => true,
'response_format' => [
],
'prediction' => [
],
'metadata' => '<unknown>',
'store' => true,
'service_tier' => '<string>',
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://ai.liara.ir/api/{workspaceID}/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"openai/gpt-5\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"refusal\": \"<string>\"\n }\n ],\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"max_tokens\": 123,\n \"max_completion_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"repetition_penalty\": 123,\n \"seed\": 123,\n \"n\": 2,\n \"stop\": \"<string>\",\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"min_p\": 123,\n \"top_a\": 123,\n \"reasoning\": {},\n \"reasoning_effort\": \"<string>\",\n \"modalities\": [],\n \"functions\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"parallel_tool_calls\": true,\n \"response_format\": {},\n \"prediction\": {},\n \"metadata\": \"<unknown>\",\n \"store\": true,\n \"service_tier\": \"<string>\",\n \"user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://ai.liara.ir/api/{workspaceID}/v1/chat/completions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"openai/gpt-5\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"refusal\": \"<string>\"\n }\n ],\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"max_tokens\": 123,\n \"max_completion_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"repetition_penalty\": 123,\n \"seed\": 123,\n \"n\": 2,\n \"stop\": \"<string>\",\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"min_p\": 123,\n \"top_a\": 123,\n \"reasoning\": {},\n \"reasoning_effort\": \"<string>\",\n \"modalities\": [],\n \"functions\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"parallel_tool_calls\": true,\n \"response_format\": {},\n \"prediction\": {},\n \"metadata\": \"<unknown>\",\n \"store\": true,\n \"service_tier\": \"<string>\",\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.liara.ir/api/{workspaceID}/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"openai/gpt-5\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"refusal\": \"<string>\"\n }\n ],\n \"stream\": false,\n \"stream_options\": {\n \"include_usage\": true\n },\n \"max_tokens\": 123,\n \"max_completion_tokens\": 123,\n \"temperature\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"repetition_penalty\": 123,\n \"seed\": 123,\n \"n\": 2,\n \"stop\": \"<string>\",\n \"logit_bias\": {},\n \"logprobs\": true,\n \"top_logprobs\": 123,\n \"min_p\": 123,\n \"top_a\": 123,\n \"reasoning\": {},\n \"reasoning_effort\": \"<string>\",\n \"modalities\": [],\n \"functions\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"parallel_tool_calls\": true,\n \"response_format\": {},\n \"prediction\": {},\n \"metadata\": \"<unknown>\",\n \"store\": true,\n \"service_tier\": \"<string>\",\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"object": "chat.completion",
"created": 123,
"choices": [
{
"index": 123,
"message": {
"content": "<string>",
"name": "<string>",
"tool_calls": [
{}
],
"tool_call_id": "<string>",
"refusal": "<string>"
},
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"total_cost_toman": 123,
"total_cost": 123
}
}This response has no body data.This response has no body data.This response has no body data.This response has no body data.This response has no body data.Authorizations
Enter the API key with the Bearer: prefix, e.g. "Bearer "
Path Parameters
The workspace ID
^[a-f0-9]{24}$Body
Model ID
"openai/gpt-5"
Array of conversation messages
Show child attributes
Show child attributes
Enable SSE streaming
Show child attributes
Show child attributes
Maximum tokens to generate
Maximum completion tokens (OpenAI-style)
Sampling temperature (0-2)
Nucleus sampling parameter
Top-K sampling parameter
Frequency penalty (-2 to 2)
Presence penalty (-2 to 2)
Repetition penalty
Random seed for deterministic output
Number of completions to generate
x >= 1Stop sequences
Token ID to bias mapping
Show child attributes
Show child attributes
Return log probabilities
Number of top log probabilities to return
Minimum probability parameter
Top-A sampling parameter
Reasoning configuration
Reasoning effort level
Output modalities
image, text Legacy function definitions
Tool definitions for function calling
none, auto, required Allow parallel tool calls
Response format specification
Predicted output for latency optimization
Additional metadata
Store the completion
Service tier
End-user identifier
