GET
/
chat
/
completions
curl --request GET \
  --url https://api.openai.com/v1/chat/completions \
  --header 'Authorization: Bearer <token>'
{
  "object": "list",
  "data": [
    {
      "id": "<string>",
      "choices": [
        {
          "finish_reason": "stop",
          "index": 123,
          "message": {
            "content": "<string>",
            "refusal": "<string>",
            "tool_calls": [
              {
                "id": "<string>",
                "type": "function",
                "function": {
                  "name": "<string>",
                  "arguments": "<string>"
                }
              }
            ],
            "annotations": [
              {
                "type": "url_citation",
                "url_citation": {
                  "end_index": 123,
                  "start_index": 123,
                  "url": "<string>",
                  "title": "<string>"
                }
              }
            ],
            "role": "assistant",
            "function_call": {
              "arguments": "<string>",
              "name": "<string>"
            },
            "audio": {
              "id": "<string>",
              "expires_at": 123,
              "data": "<string>",
              "transcript": "<string>"
            }
          },
          "logprobs": {
            "content": [
              {
                "token": "<string>",
                "logprob": 123,
                "bytes": [
                  123
                ],
                "top_logprobs": [
                  {
                    "token": "<string>",
                    "logprob": 123,
                    "bytes": [
                      123
                    ]
                  }
                ]
              }
            ],
            "refusal": [
              {
                "token": "<string>",
                "logprob": 123,
                "bytes": [
                  123
                ],
                "top_logprobs": [
                  {
                    "token": "<string>",
                    "logprob": 123,
                    "bytes": [
                      123
                    ]
                  }
                ]
              }
            ]
          }
        }
      ],
      "created": 123,
      "model": "<string>",
      "service_tier": "auto",
      "system_fingerprint": "<string>",
      "object": "chat.completion",
      "usage": {
        "completion_tokens": 0,
        "prompt_tokens": 0,
        "total_tokens": 0,
        "completion_tokens_details": {
          "accepted_prediction_tokens": 0,
          "audio_tokens": 0,
          "reasoning_tokens": 0,
          "rejected_prediction_tokens": 0
        },
        "prompt_tokens_details": {
          "audio_tokens": 0,
          "cached_tokens": 0
        }
      }
    }
  ],
  "first_id": "<string>",
  "last_id": "<string>",
  "has_more": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

model
string

The model used to generate the Chat Completions.

metadata
object | null

A list of metadata keys to filter the Chat Completions by. Example:

metadata[key1]=value1&metadata[key2]=value2

after
string

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

limit
integer
default:20

Number of Chat Completions to retrieve.

order
enum<string>
default:asc

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

Available options:
asc,
desc

Response

200 - application/json

A list of Chat Completions

An object representing a list of Chat Completions.