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": "你好!有什么可以帮助你的吗?",
        "role": "assistant",
        "refusal": null
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 11,
    "completion_tokens": 17,
    "total_tokens": 28
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.ttapi.io/llms.txt

Use this file to discover all available pages before exploring further.

TTAPI中转 Grok Chat Completions 接口,请求 header 使用 TTAPI 平台密钥,其余所有请求参数及响应参数与官方一致, 具体参考Grok官方文档

Authorizations

Authorization
string
header
required

请前往 TTAPI 控制台 获取 API 密钥。

Body

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

使用模型,详见支持模型

stream
boolean
default:false

是否使用服务器发送的事件逐步传输响应

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 May 20, 2026