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": "Hello! How can I help you?", "role": "assistant", "refusal": null }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 11, "completion_tokens": 17, "total_tokens": 28 } }
You can obtain your API key from the TTAPI Dashboard.
Show child attributes
[{ "role": "user", "content": "Hello!" }]
Model to use, see Supported Models
Whether to use server-sent events for progressive response transmission
Successful response
"chatcmpl-9ugiTupGJUmeRNqyqUvYO34GOUzyv"
"chat.completion"
1723297597
"gpt-3.5-turbo-0125"