POST
Create chat completion

Authorizations

Authorization
string
header
required

Provide your API key in the Authorization header using Bearer auth

Body

application/json

Chat completion request (OpenAI Chat Completions format)

model
string
required

Model ID (author/model). See GET /v1/models

Minimum string length: 1
Example:

"deepseek/deepseek-v4.1-flash"

messages
object[]
required

Conversation messages

Minimum array length: 1
temperature
number<double>

Sampling temperature, 0-2

Example:

0.7

top_p
number<double>

Nucleus sampling probability

max_tokens
integer<int32>

Maximum tokens to generate (legacy, same as max_completion_tokens)

max_completion_tokens
integer<int32>

Maximum tokens to generate, including reasoning tokens

stop
string[]

Stop sequences: a string or an array of strings

Stop sequences: a string or an array of strings

n
integer<int32>

Number of choices to generate

presence_penalty
number<double>

Presence penalty, -2 to 2

frequency_penalty
number<double>

Frequency penalty, -2 to 2

seed
integer<int64>

Random seed

tools
object[]

Tools the model may call

tool_choice

Tool choice: none / auto / required, or a specific tool

parallel_tool_calls
boolean

Whether to allow parallel tool calls

response_format
object

Response format

logprobs
boolean

Whether to return token log probabilities

top_logprobs
integer<int32>

Number of most likely tokens to return at each position

logit_bias
object

Token bias: token ID → -100 to 100

user
string

End-user identifier for abuse detection

reasoning_effort
string

Reasoning effort: low / medium / high

modalities
string[]

Output modalities, e.g. ["text"]

Output modalities, e.g. ["text"]

prediction
object

Predicted output

service_tier
string

Service tier

stream
boolean

Whether to stream the response (SSE)

stream_options
object

Streaming options

metadata
object

Caller-defined data (up to 16 keys). Shown in billing and webhooks; never sent to the model

store
boolean

Whether to store this conversation (currently ignored)

audio
object

Audio output options

function_call

Legacy function call choice (deprecated, use tool_choice)

functions
object[]

Legacy functions (deprecated, use tools)

moderation
object

Moderation configuration

prompt_cache_key
string

Prompt cache key to improve cache hit rates (replaces user)

prompt_cache_options
object

Prompt cache options

prompt_cache_retention
string

Prompt cache retention: in_memory / 24h (deprecated, use prompt_cache_options.ttl)

safety_identifier
string

Stable end-user identifier for abuse detection (replaces user)

verbosity
string

Response verbosity: low / medium / high

web_search_options
object

Web search options

Response

Chat completion. application/json when stream is false; text/event-stream (data: chunk … data: [DONE]) when stream is true

Chat completion response (OpenAI format)

id
string

Public ID (chatcmpl- prefix), also the billing ID

Example:

"chatcmpl-0192f1c3a7b87c3e9a4f5b6c7d8e9f01"

object
string

Object type

Example:

"chat.completion"

created
integer<int64>

Creation time (Unix seconds)

model
string

Canonical model ID

Example:

"deepseek/deepseek-v4.1-flash"

choices
object[]

Choices

usage
object

Usage and cost

service_tier
string

Service tier actually used

system_fingerprint
string

Backend configuration fingerprint