Skip to main content
POST
/
v1
/
chat
/
completions
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
  }
}
The TTAPI proxy for the OpenAI Chat Completion API uses the TTAPI platform key in the request header, while all other request and response parameters remain consistent with the official API. For details, refer to the OpenAI official documentation.

Authorizations

Authorization
string
header
required

You can obtain your API key from the TTAPI Dashboard.

Body

application/json
messages
object[]
required
Example:
[{ "role": "user", "content": "Hello!" }]
model
string
required

Model to use, see Supported Models

stream
boolean
default:false

Whether to use server-sent events for progressive response transmission

Response

Successful response

id
string
Example:

"chatcmpl-9ugiTupGJUmeRNqyqUvYO34GOUzyv"

object
string
Example:

"chat.completion"

created
integer
Example:

1723297597

model
string
Example:

"gpt-3.5-turbo-0125"

choices
object[]
usage
object
Last modified on March 16, 2026