Create a chat completion. Supports both streaming (SSE) and non-streaming modes.
Non-streaming: set stream: false (default), returns the full response
Streaming: set stream: true, returns ChatCompletionChunk via SSE
Request
Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Header Params
Body Params application/jsonRequired
Example
{"model":"deepseek-v3","messages":[{"role":"system","content":"You are a helpful assistant"},{"role":"user","content":"Hello"}],"stream":false,"temperature":0.7}
{"id":"chatcmpl-abc123","object":"chat.completion","created":1713833628,"model":"deepseek-v3","choices":[{"index":0,"message":{"role":"assistant","content":"Hello! How can I help you?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":15,"completion_tokens":8,"total_tokens":23}}