Chat Completions

Core endpoint, compatible with OpenAI Chat Completions API format.

POST
https://www.ciyuano.com/v1/chat/completions

Request Parameters

ParameterTypeRequiredDescription
modelstringYesModel ID, e.g. deepseek-v4-flash, mimo-v2.5-pro, auto
messagesarrayYesMessage list containing conversation history
streambooleanNoEnable streaming output, default false
temperaturenumberNoSampling temperature, range 0-2, default 1
top_pnumberNoNucleus sampling probability, range 0-1
max_tokensintegerNoMaximum output tokens
frequency_penaltynumberNoFrequency penalty, range -2 to 2
presence_penaltynumberNoPresence penalty, range -2 to 2
stopstring / arrayNoStop sequences
toolsarrayNoTool list for Function Calling
tool_choicestring / objectNoTool selection strategy: auto / none / required / specific function

Message Object Format

FieldTypeDescription
rolestringsystem / user / assistant / tool
contentstring / arrayMessage content. String for text, array for multimodal (images)
tool_callsarrayTool calls returned by the model (assistant role)
tool_call_idstringTool call ID (required for tool role)

Request Example

JSON
{
  "model": "deepseek-v4-flash",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Hello!"
    }
  ],
  "stream": false,
  "temperature": 0.7,
  "max_tokens": 2048
}

Response Example

JSON
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1700000000,
  "model": "deepseek-v4-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 12,
    "total_tokens": 32
  }
}