v1

latestOpenAPI 3.1.02026-07-2611077199.5 KB

post/gemini/chat/completions

Request body

modelstring required

Models supported by TTAPI, see Gemini Supported Models

streamboolean

Whether to use server-sent events for progressive response transmission

Example request

{
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ]
}

Response

Successful response (stream=false returns JSON, stream=true returns Gemini stream)

createdinteger

Response creation timestamp (seconds)

idstring

Unique request identifier

modelstring

Gemini model version used

objectstring

Response object type

Example response

{
  "choices": [
    {
      "finish_reason": "stop",
      "message": {
        "content": "Hello! Nice to chat with you.\n\nHow can I help you? Or what would you like to talk about? 😊",
        "role": "assistant"
      }
    }
  ],
  "created": 1757472417,
  "id": "oebAaMTvMfCUjMcP_prYwAs",
  "model": "gemini-2.5-pro",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 21,
    "prompt_tokens": 3,
    "total_tokens": 1466
  }
}