Text modelsAPI referenceCreate a chat completion

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

API Key: X-API-Key: <API Key> or Authorization: Bearer <API Key>.

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"    }  ]}

Request Body

application/json
  1. body

OpenAI chat completion request. Unknown fields are ignored. n greater than 1, tool calls and non-text content are not supported.

model*string

Model ID, such as deepseek-v4.1-flash. Available models are listed in the text model overview and returned by GET /v1/models.

messages*array<>
Items1 <= items
stream?boolean
stream_options?
max_tokens?integer
Range1 <= value
max_completion_tokens?integer
Range1 <= value
temperature?number
top_p?number
presence_penalty?number
frequency_penalty?number
seed?integer

Optional 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
Value in"low""medium""high"
user?string

Response Body

Request succeeded

  1. response
id*string
object*string
created*integer
model*string

Model 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?

On this page