Skip to content
RU

Create chat completion

POST
/chat/completions
curl --request POST \
--url https://api.mixen.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "messages": [ { "content": "Hello!", "role": "user" } ], "model": "gpt-5.5", "stream": false }'

OpenAI-compatible chat completion. Set stream=true for SSE token streaming; otherwise returns a single chat.completion object. Charged per-token from balance. Supports vision (image_url data: parts on vision models) and Perplexity Sonar (category=search models) — web results return as message.annotations (url_citation).

Media typeapplication/json
ChatCompletionRequest
object
model
required
Model

Model id from GET /models, or a common OpenAI/Claude/Gemini alias.

string
messages
required
Messages

Conversation so far; the last user message is the prompt.

Array<object>
_Msg
object
role
required
Role
string
content
Content
tool_calls
Any of:
Array<object>
object
key
additional properties
any
tool_call_id
Any of:
string
stream
Stream

If true, stream tokens as SSE (text/event-stream).

boolean
stream_options
Any of:
object
key
additional properties
any
temperature
Any of:
number
max_tokens
Any of:
integer
max_completion_tokens
Any of:
integer
reasoning_effort
Any of:
string
Allowed values: off low medium high xhigh max
tools
Any of:
Array<object>
object
key
additional properties
any
tool_choice
Any of:
Tool Choice
response_format
Any of:
object
key
additional properties
any
web_search
Any of:
boolean
provider
Any of:
object
key
additional properties
any
service_tier
Any of:
string
Allowed values: flex priority
stop
Any of:
Array<string>
<= 4 items
seed
Any of:
integer
top_p
Any of:
number
<= 1
top_k
Any of:
integer
min_p
Any of:
number
<= 1
frequency_penalty
Any of:
number
>= -2 <= 2
presence_penalty
Any of:
number
>= -2 <= 2
repetition_penalty
Any of:
number
<= 2
logprobs
Any of:
boolean
top_logprobs
Any of:
integer
<= 20
plugins
Any of:
Array<object>
object
key
additional properties
any
Example
{
"messages": [
{
"content": "Hello!",
"role": "user"
}
],
"model": "gpt-5.5",
"stream": false
}

Successful Response

Media typeapplication/json
Examplegenerated
example

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}