接口文档 finishreason取值说明 返回码 说明 stop 正常结束(命中停止序列) length 达到token上限 contentfilter 内容被安全策略拦截 toolcalls 模型发起工具调用 请求示例 请求体示例 plaintext { "model": "TeleChat3438BA24B", "messages": [ { "role": "system", "content": "你是乐于助人的助手。" }, { "role": "user", "content": "你好,一句话介绍一下你自己" } ], "stream": true, "streamoptions": { "includeusage": true }, "temperature": 0.7, "maxcompletiontokens": 1024, "topp": 0.9, "frequencypenalty": 0, "presencepenalty": 0, "seed": 42, "responseformat": { "type": "text" } } 非流式返回示例 plaintext { "id": "chatcmplxxxxxxxx", "object": "chat.completion", "created": 1731691468, "model": "TeleChat3438BA24B", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "你好!我是TeleChat大模型,由中电信人工智能科技研发。", "refusal": null }, "finishreason": "stop", "logprobs": null } ], "usage": { "prompttokens": 15, "completiontokens": 20, "totaltokens": 35, "prompttokensdetails": { "cachedtokens": 0 }, "completiontokensdetails": { "reasoningtokens": 0 } }, "servicetier": "default", "systemfingerprint": "fpxxxxxxxx" } 流式返回示例(SSE) plaintext data: {"id":"chatcmplxxx","object":"chat.completion.chunk","created":1731691468,"model":"TeleChat3438BA24B","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finishreason":null}]} data: {"id":"chatcmplxxx","object":"chat.completion.chunk","created":1731691468,"model":"TeleChat3438BA24B","choices":[{"index":0,"delta":{"content":"你"},"finishreason":null}]} data: {"id":"chatcmplxxx","object":"chat.completion.chunk","created":1731691468,"model":"TeleChat3438BA24B","choices":[{"index":0,"delta":{},"finishreason":"stop"}]} data: {"id":"chatcmplxxx","object":"chat.completion.chunk","created":1731691468,"model":"TeleChat3438BA24B","choices":[],"usage":{"prompttokens":15,"completiontokens":20,"totaltokens":35}} data: [DONE]