跳转到主要内容
POST
Chat completions (OpenAI-compatible)

授权

Authorization
string
header
必填

OAuth2 access token issued via POST /oauth/token

请求体

application/json
model
string
必填

Model identifier

示例:

"deepseek-chat"

messages
object[]
必填
Minimum array length: 1
stream
boolean
默认值:false
temperature
number
必填范围: 0 <= x <= 2
max_tokens
integer
top_p
number
frequency_penalty
number
presence_penalty
number
stop
tools
object[]

Tool definitions (OpenAI function calling format)

tool_choice
any

Controls tool use behavior

响应

Chat completion response (JSON or SSE stream depending on stream parameter)

id
string
object
string
示例:

"chat.completion"

model
string
choices
object[]
usage
object
balance_remaining
number

Remaining credit balance after this request