跳转到内容
DarkSeek API 开发者预览。 查看支持的功能与上线状态

对话补全

View Markdown ↗

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

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 configured at 384,000 tokens. For thinking use reasoning_effort: none, low, high or max; max_effort is not a field. none disables thinking; max requests the 100/100 encoder reasoning setting. Output includes reasoning and final text.

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.