Skip to content
DarkSeek API developer preview. View supported features and launch status

Chat completions

View Markdown ↗

Generate a response from a conversation, optionally as a stream.

此链接保留对应的中文文档路径。目前技术参考内容为英文;功能可用性以 DarkSeek 的实际部署和验证状态为准。

POST/v1/chat/completions

Request fields#

model is required. messages is the conversation array. Use max_tokens (or max_completion_tokens, not both) to bound the reply. stream selects SSE; n must be 1. The gateway caps output at its configured deployment ceiling, currently planned at 16,384 tokens.

Text conversation#

Supply role and content for each message. Keep secrets and sensitive data out of unreviewed deployments. Multimodal input, file references and tool execution must not be assumed available.

{
  "model": "darkseek-v4.1",
  "messages": [
    {"role":"system","content":"You are a helpful assistant."},
    {"role":"user","content":"Explain a binary search."}
  ],
  "max_tokens": 512,
  "stream": true
}

Response#

Non-streaming replies use choices[].message.content. Streaming replies use choices[].delta.content, with reasoning_content when supplied by the configured parser. Usage contains prompt_tokens and completion_tokens when the backend supplies them.