Text generation
POST/api/v5/chat/completions
Request
Header Parameters
Authorization stringrequired
User Personal Token
- application/json
Body
temperatureTemperature (number)
Default 0.7
top_ktop_k (integer)
Default 50
top_ptop_p (number)
Default 0.7
frequency_penaltynumber
Default 1.0
messagesstring[]required
modelModel (string)required
maxTokensMaximum Token Count (integer)
Responses
- 200
Response Headers
- application/json
- Schema
- Example (auto)
- Example
Schema
trace_idString (string)required
Unique identifier of the request
choicesstring[]required
extstringrequired
Extended field, usually null
usage objectrequired
prompt_tokens1 (integer)required
Token count for the prompt
completion_tokens1 (integer)required
Token count required to complete the content
total_tokens1 (integer)required
Total token count
think_tokens1 (integer)
The number of token consumed in the thinking process
{
"trace_id": "string",
"choices": [
"string"
],
"ext": "string",
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"think_tokens": 0
}
}
{
"trace_id": "045560649c7c483e80eb196e2bc95d38",
"choices": [
{
"index": 0,
"finish_reason": null,
"delta": {
"content": "This is a fragment of streaming content."
}
}
],
"ext": null,
"usage": {
"prompt_tokens": 11,
"completion_tokens": 146,
"total_tokens": 157,
"think_tokens": null
}
}