cURL
curl --request POST \ --url https://api.ttapi.io/v1/chat/completions \ --header 'Authorization: <api-key>' \ --header 'Content-Type: application/json' \ --data ' { "messages": [ { "role": "user", "content": "Hello!" } ], "model": "<string>", "stream": "false" } '
{ "id": "chatcmpl-9ugiTupGJUmeRNqyqUvYO34GOUzyv", "object": "chat.completion", "created": 1723297597, "model": "gpt-3.5-turbo-0125", "choices": [ { "index": 0, "message": { "content": "你好!有什么可以帮助你的吗?", "role": "assistant", "refusal": null }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 11, "completion_tokens": 17, "total_tokens": 28 } }
Documentation IndexFetch the complete documentation index at: https://docs.ttapi.io/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: https://docs.ttapi.io/llms.txt
Use this file to discover all available pages before exploring further.
请前往 TTAPI 控制台 获取 API 密钥。
Show child attributes
[{ "role": "user", "content": "Hello!" }]
使用模型,详见支持模型
是否使用服务器发送的事件逐步传输响应
成功响应
"chatcmpl-9ugiTupGJUmeRNqyqUvYO34GOUzyv"
"chat.completion"
1723297597
"gpt-3.5-turbo-0125"