Create a chat completion
OpenAI-compatible chat completions; set stream=true to stream the output. Credits are reserved from max_tokens when the request starts and settled against actual usage, with any excess returned. API Keys only.
Authentication
Credentials in the examples are placeholders. Replace them and run the examples on your server.
Code examples
curl -X POST 'https://shixux.com/api/v1/chat/completions' \ -H 'X-API-Key: yb_xxx_yyy' \ -H 'Content-Type: application/json' \ -d '{"model":"deepseek-v4.1-flash","messages":[{"role":"system","content":"你是一个简洁的助手。"},{"role":"user","content":"用一句话介绍时序科技。"}],"max_tokens":512,"stream":false}'{ "id": "job_xxx", "object": "chat.completion", "created": 1, "model": "example", "choices": [ { "index": 1, "message": { "role": "example", "content": "example", "reasoning_content": "example" }, "finish_reason": "example" } ]}application/json- body
OpenAI chat completion request. Unknown fields are ignored. n greater than 1, tool calls and non-text content are not supported.
model*stringModel ID, such as deepseek-v4.1-flash. Available models are listed in the text model overview and returned by GET /v1/models.
messages*array<>1 <= itemsstream?booleanstream_options?max_tokens?integer1 <= valuemax_completion_tokens?integer1 <= valuetemperature?numbertop_p?numberpresence_penalty?numberfrequency_penalty?numberseed?integerOptional deterministic seed from 0 to 2147483647. Omit it when the selected model does not support seeds.
stop?string|array<string>response_format?reasoning_effort?string"low""medium""high"user?stringRequest succeeded
- response
id*stringobject*stringcreated*integermodel*stringModel ID. For image and video models, use the corresponding settings endpoint for current availability, resolutions and rates. Speech synthesis and audio composition accept indextts-2 (default) or indextts-2.5.
choices*array<>usage?