Skip to main content
POST
/
api
/
{workspaceID}
/
v1
/
chat
/
completions
Create a chat completion
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>"
}
'
{
  "id": "<string>",
  "model": "<string>",
  "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
  }
}

Authorizations

Authorization
string
header
required

Enter the API key with the Bearer: prefix, e.g. "Bearer "

Path Parameters

workspaceID
string
required

The workspace ID

Pattern: ^[a-f0-9]{24}$

Body

application/json
model
string
required

Model ID

Example:

"openai/gpt-5"

messages
object[]
required

Array of conversation messages

stream
boolean
default:false

Enable SSE streaming

stream_options
object
max_tokens
integer

Maximum tokens to generate

max_completion_tokens
integer

Maximum completion tokens (OpenAI-style)

temperature
number

Sampling temperature (0-2)

top_p
number

Nucleus sampling parameter

top_k
number

Top-K sampling parameter

frequency_penalty
number

Frequency penalty (-2 to 2)

presence_penalty
number

Presence penalty (-2 to 2)

repetition_penalty
number

Repetition penalty

seed
integer

Random seed for deterministic output

n
integer

Number of completions to generate

Required range: x >= 1
stop

Stop sequences

logit_bias
object

Token ID to bias mapping

logprobs
boolean

Return log probabilities

top_logprobs
integer

Number of top log probabilities to return

min_p
number

Minimum probability parameter

top_a
number

Top-A sampling parameter

reasoning
object

Reasoning configuration

reasoning_effort
string

Reasoning effort level

modalities
enum<string>[]

Output modalities

Available options:
image,
text
functions
object[]

Legacy function definitions

tools
object[]

Tool definitions for function calling

tool_choice
Available options:
none,
auto,
required
parallel_tool_calls
boolean
default:true

Allow parallel tool calls

response_format
object

Response format specification

prediction
object

Predicted output for latency optimization

metadata
any

Additional metadata

store
boolean

Store the completion

service_tier
string

Service tier

user
string

End-user identifier

Response

Successful response (non-streaming)

id
string

Log ID

model
string

Model ID used

object
enum<string>
Available options:
chat.completion
created
integer<unix-timestamp>
choices
object[]
usage
object