Skip to main content
POST
Chat Completion

Authorizations

Authorization
string
header
required

Authentication via Bearer token. Create an API Key in the AnyFast console and pass it as Bearer YOUR_API_KEY in the Authorization header.

Body

application/json
model
enum<string>
required

Model ID

Available options:
deepseek-v4-pro
Example:

"deepseek-v4-pro"

messages
object[]
required

A list of messages comprising the conversation so far.

Minimum array length: 1
Example:
thinking
object | null

Enable or disable thinking mode.

max_tokens
integer

The maximum number of tokens to generate.

Required range: x >= 1
response_format
object

Set to {"type": "json_object"} to enable JSON mode.

stop

Sequences where the model will stop generating further tokens. Up to 16 strings.

stream
boolean
default:false

If true, stream partial message deltas using SSE.

stream_options
object

Options for streaming. Only valid when stream is true.

temperature
number
default:1

Sampling temperature. Higher values make output more random.

Required range: 0 <= x <= 2
Example:

1

top_p
number
default:1

Nucleus sampling threshold.

Required range: 0 <= x <= 1
tools
object[]

A list of tools the model may call. Currently only functions are supported.

tool_choice

Controls which tool is called. none, auto, required, or a specific function.

Available options:
none,
auto,
required
frequency_penalty
number
default:0

Deprecated by DeepSeek. Passed through but has no effect.

Required range: -2 <= x <= 2
presence_penalty
number
default:0

Deprecated by DeepSeek. Passed through but has no effect.

Required range: -2 <= x <= 2
user_id
string

Custom user ID for content safety and KVCache isolation.

Maximum string length: 512
Pattern: ^[a-zA-Z0-9\-_]+$

Response

Completion generated successfully

id
string
Example:

"chatcmpl-abc123"

object
string
Example:

"chat.completion"

created
integer

Unix timestamp

model
string
Example:

"deepseek-v4-pro"

choices
object[]
usage
object
system_fingerprint
string | null

Backend configuration fingerprint.