Chat completions
Generate a response from a conversation, optionally as a stream.
/v1/chat/completionsRequest 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.