Skip to main content
GET
/
v1
/
chat
/
completions
List Chat Completions
curl --request GET \
  --url https://api.example.com/v1/chat/completions
{
  "data": [
    {
      "choices": [
        {
          "finish_reason": "<string>",
          "index": 1,
          "message": {
            "role": "<string>",
            "annotations": "<unknown>",
            "audio": "<unknown>",
            "content": "<string>",
            "refusal": "<string>",
            "tool_calls": [
              {
                "function": {
                  "arguments": "<string>",
                  "name": "<string>"
                },
                "id": "<string>",
                "type": "<string>"
              }
            ]
          },
          "logprobs": "<unknown>"
        }
      ],
      "created": 1,
      "id": "<string>",
      "model": "<string>",
      "object": "<string>",
      "usage": {
        "completion_tokens": 1,
        "prompt_tokens": 1,
        "total_tokens": 1,
        "completion_tokens_details": "<unknown>",
        "prompt_tokens_details": "<unknown>"
      },
      "service_tier": "<string>",
      "system_fingerprint": "<string>"
    }
  ],
  "first_id": "<string>",
  "has_more": true,
  "last_id": "<string>",
  "object": "<string>"
}

Query Parameters

after
string

Identifier for the last chat completion from the previous pagination request.

limit
integer<int32>

Number of Chat Completions to retrieve.

Required range: x >= 0
metadata
object

A list of metadata keys to filter the Chat Completions by. Example: metadata[key1]=value1&metadata[key2]=value2

model
string

The model used to generate the Chat Completions.

order
string

Sort order for Chat Completions by timestamp. Use asc for ascending order or desc for descending order. Defaults to asc.

Response

Chat completions listed successfully

Represents a list of chat completions.

data
object[]
required

A list of chat completion objects.

first_id
string
required

The ID of the first chat completion in the list.

has_more
boolean
required

Whether there are more chat completions to retrieve.

last_id
string
required

The ID of the last chat completion in the list.

object
string
required

The object type, which is always list.