Skip to main content
POST
Create a chat completion (OpenAI Chat Completions); `stream: true` answers with server-sent events

Authorizations

Authorization
string
header
required

ak_… project API key (or x-api-key)

Body

application/json

Rejected with 400 unsupported_parameter: n ≠ 1, audio, modalities other than ["text"], prediction, web_search_options, functions, function_call, prompt_logprobs, cache_salt, and any field not listed here.

model
string
required

Public model ID, e.g. a1 (A-05)

Minimum string length: 1
Example:

"a1"

messages
object[]
required
Required array length: 1 - 10000 elements
max_tokens
integer | null

1…the model's max_output_tokens

Required range: x >= 1
max_completion_tokens
integer | null

1…the model's max_output_tokens

Required range: x >= 1
temperature
number | null
Required range: 0 <= x <= 2
top_p
number | null
Required range: 0 <= x <= 1
frequency_penalty
number | null
Required range: -2 <= x <= 2
presence_penalty
number | null
Required range: -2 <= x <= 2
stop
seed
integer | null
logit_bias
object | null
tools
object[] | null
Maximum array length: 128
tool_choice
Available options:
none,
auto,
required
parallel_tool_calls
boolean | null
response_format
object
reasoning_effort
enum<string> | null

Must be one of the model's reasoning_efforts

Available options:
none,
minimal,
low,
medium,
high,
xhigh,
max,
null
prompt_cache_key
string | null
Maximum string length: 512
logprobs
boolean | null
top_logprobs
integer | null
Required range: 0 <= x <= 20
n
integer | null

Only 1

modalities
string[] | null

Only ["text"]

stream
boolean | null

Default false

stream_options
object | null

Usage is always metered; the final usage chunk is sent only when include_usage is true

reasoning
object | null

OpenRouter-style; mapped to reasoning_effort

thinking

Mapped to reasoning_effort

include_reasoning
boolean | null

false strips reasoning_content from the output

policy_ids
string[] | null

Antara extension: published policies to add for this request

Maximum array length: 20
Required string length: 1 - 120
user
string | null
Maximum string length: 512
safety_identifier
string | null
Maximum string length: 64
store
boolean | null
metadata
object | null
service_tier
string | null
structuredOutputs
boolean | null
prompt_cache_retention
string | null

Response

application/json when stream is false; otherwise text/event-stream: data: <ChatCompletionChunk> events, then data: [DONE]

id
string
required
Pattern: ^chatcmpl_[0-9a-f]{32}$
Example:

"chatcmpl_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f"

object
enum<string>
required
Available options:
chat.completion
created
integer
required

Unix seconds

Example:

1793750400

model
string
required
Example:

"a1"

choices
object[]
required
usage
object
required
system_fingerprint
null
required