---
title: "List chat completions."
method: GET
path: "/v1/chat/completions"
tags: ["Inference"]
---

# List chat completions.

`GET /v1/chat/completions`

List chat completions.

## Query parameters

- `after` string, nullable — The ID of the last chat completion to return.
- `limit` integer, nullable — The maximum number of chat completions to return.
- `model` string, nullable — The model to filter by.
- `order` 'asc' | 'desc' — Sort order for paginated responses.

## Response `200`

A ListOpenAIChatCompletionResponse.

- ListOpenAIChatCompletionResponse — Response from listing OpenAI-compatible chat completions.
  - `data` OpenAICompletionWithInputMessages[], required — List of chat completion objects with their input messages.
    - `id` string, required — The ID of the chat completion.
    - `choices` OpenAIChoice[], required — List of choices.
      - `message` OpenAIChatCompletionResponseMessage, required — An assistant message returned in a chat completion response.
        - `role` 'assistant' — The role of the message author, always 'assistant' in responses.
        - `content` string, nullable — The content of the message.
        - `tool_calls` union[] — The tool calls generated by the model.
          - union
            - ChatCompletionMessageToolCall — Tool call specification for OpenAI-compatible chat completion responses.
              - …
            - ChatCompletionMessageCustomToolCall — A call to a custom tool created by the model.
              - …
        - `refusal` string, nullable — The refusal message generated by the model.
        - `function_call` object — Deprecated: the name and arguments of a function that should be called.
          - `name` string, required — Name of the function to call.
          - `arguments` string, required — Arguments to pass to the function as a JSON string.
        - `annotations` object[] — Annotations for the message, when applicable.
        - `audio` object, nullable — Audio response data when using audio output modality.
      - `finish_reason` 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call', required — The reason the model stopped generating.
      - `index` integer, required — The index of the choice.
      - `logprobs` object, nullable — The log probabilities for the tokens in the message.
        - `content` OpenAITokenLogProb[], nullable — The log probabilities for the tokens in the message.
          - `token` string, required — The token.
          - `bytes` integer[], nullable — The bytes for the token.
          - `logprob` number, required — The log probability of the token.
          - `top_logprobs` OpenAITopLogProb[], nullable — The top log probabilities for the token.
            - `token` string, required — The token.
            - `bytes` integer[], nullable — The bytes for the token.
            - `logprob` number, required — The log probability of the token.
        - `refusal` OpenAITokenLogProb[], nullable — The log probabilities for the refusal tokens.
          - `token` string, required — The token.
          - `bytes` integer[], nullable — The bytes for the token.
          - `logprob` number, required — The log probability of the token.
          - `top_logprobs` OpenAITopLogProb[], nullable — The top log probabilities for the token.
            - `token` string, required — The token.
            - `bytes` integer[], nullable — The bytes for the token.
            - `logprob` number, required — The log probability of the token.
    - `object` 'chat.completion' — The object type.
    - `created` integer, required — The Unix timestamp in seconds when the chat completion was created.
    - `model` string, required — The model that was used to generate the chat completion.
    - `service_tier` string, nullable — The service tier that was used for this response.
    - `system_fingerprint` string — System fingerprint for this completion.
    - `usage` OpenAIChatCompletionUsage — Usage information for OpenAI chat completion.
      - `prompt_tokens` integer — Number of tokens in the prompt.
      - `completion_tokens` integer — Number of tokens in the completion.
      - `total_tokens` integer — Total tokens used (prompt + completion).
      - `prompt_tokens_details` OpenAIChatCompletionUsagePromptTokensDetails — Token details for prompt tokens in OpenAI chat completion usage.
        - `cached_tokens` integer — Number of tokens retrieved from cache.
      - `completion_tokens_details` OpenAIChatCompletionUsageCompletionTokensDetails — Token details for output tokens in OpenAI chat completion usage.
        - `reasoning_tokens` integer — Number of tokens used for reasoning (o1/o3 models).
    - `input_messages` union[], required — The input messages used to generate this completion.
      - union
        - OpenAIUserMessageParamOutput — A message from the user in an OpenAI-compatible chat completion request.
          - `role` 'user' — Must be 'user' to identify this as a user message.
          - `content` union, required — The content of the message, which can include text and other media.
            - string
            - union[]
              - …
          - `name` string, nullable — The name of the user message participant.
        - OpenAISystemMessageParam — A system message providing instructions or context to the model.
          - `role` 'system' — Must be 'system' to identify this as a system message.
          - `content` union, required — The content of the 'system prompt'. If multiple system messages are provided, they are concatenated.
            - string
            - OpenAIChatCompletionContentPartTextParam[]
              - …
          - `name` string, nullable — The name of the system message participant.
        - OpenAIAssistantMessageParamOutput — A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.
          - `role` 'assistant' — Must be 'assistant' to identify this as the model's response.
          - `content` union — The content of the model's response.
            - string
            - OpenAIChatCompletionContentPartTextParam[]
              - …
          - `name` string, nullable — The name of the assistant message participant.
          - `tool_calls` ChatCompletionMessageToolCall[], nullable — List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
            - `id` string, required — Unique identifier for the tool call.
            - `type` 'function', required — Must be 'function' to identify this as a function call.
            - `function` object, required — Function call details.
              - …
        - OpenAIToolMessageParam — A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.
          - `role` 'tool' — Must be 'tool' to identify this as a tool response.
          - `tool_call_id` string, required — Unique identifier for the tool call this response is for.
          - `content` union, required — The response content from the tool.
            - string
            - OpenAIChatCompletionContentPartTextParam[]
              - …
        - OpenAIDeveloperMessageParam — A message from the developer in an OpenAI-compatible chat completion request.
          - `role` 'developer' — Must be 'developer' to identify this as a developer message.
          - `content` union, required — The content of the developer message.
            - string
            - OpenAIChatCompletionContentPartTextParam[]
              - …
          - `name` string, nullable — The name of the developer message participant.
  - `has_more` boolean, required — Whether there are more completions available beyond this list.
  - `first_id` string, required — ID of the first completion in this list.
  - `last_id` string, required — ID of the last completion in this list.
  - `object` 'list' — Must be 'list' to identify this as a list response.

## Other responses

- `400` — The request was invalid or malformed
- `429` — The client has sent too many requests in a given amount of time
- `500` — The server encountered an unexpected error
- `default` — An error occurred

---

[API](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis.md) · [All operations](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ogx-ai/ogx-specification-stable-experimental-apis/versions/f3f783962256/schema)
