---
title: "List chat completion messages."
method: GET
path: "/v1/chat/completions/{completion_id}/messages"
tags: ["Inference"]
---

# List chat completion messages.

`GET /v1/chat/completions/{completion_id}/messages`

Get the messages in a stored chat completion.

## Path parameters

- `completion_id` string, required — The ID of the chat completion to retrieve messages from.

## Query parameters

- `after` string, nullable — Identifier for the last message from the previous pagination request.
- `limit` integer, nullable — Number of messages to retrieve.
- `order` 'asc' | 'desc' — Sort order for paginated responses.

## Response `200`

A ChatCompletionMessageList.

- ChatCompletionMessageList — Paginated list of messages from a stored chat completion.
  - `data` ChatCompletionMessage[], required — List of messages.
    - `id` string, required — The identifier of the chat message.
    - `role` 'developer' | 'system' | 'user' | 'assistant' | 'tool', required — The role of the message author.
    - `content` string, nullable — The text content of the message.
    - `content_parts` union[], nullable — Multipart content parts when the original message used content parts. Only text and image_url parts.
      - union
        - OpenAIChatCompletionContentPartTextParam — Text content part for OpenAI-compatible chat completion messages.
          - `type` 'text' — Must be 'text' to identify this as text content.
          - `text` string, required — The text content of the message.
        - OpenAIChatCompletionContentPartImageParam — Image content part for OpenAI-compatible chat completion messages.
          - `type` 'image_url' — Must be 'image_url' to identify this as image content.
          - `image_url` OpenAIImageURL, required — Image URL specification for OpenAI-compatible chat completion messages.
            - `url` string, required — URL of the image to include in the message.
            - `detail` 'low' | 'high' | 'auto', nullable — Level of detail for image processing. Can be 'low', 'high', or 'auto'.
    - `name` string, nullable — The name of the message participant.
    - `tool_calls` union[] — The tool calls generated by the message, when applicable.
      - union
        - ChatCompletionMessageToolCall — Tool call specification for OpenAI-compatible chat completion responses.
          - `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.
            - `name` string, required — Name of the function to call.
            - `arguments` string, required — Arguments to pass to the function as a JSON string.
        - ChatCompletionMessageCustomToolCall — A call to a custom tool created by the model.
          - `id` string, required — The ID of the tool call.
          - `type` 'custom', required — The type of the tool. Always 'custom'.
          - `custom` object, required — The custom tool that the model called.
            - `name` string, required — The name of the custom tool to call.
            - `input` string, required — The input for the custom tool call generated by the model.
    - `tool_call_id` string, nullable — For tool messages, the identifier of the tool call this message responds to.
    - `refusal` string, nullable — The refusal message generated by the model, when applicable.
    - `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[], nullable — Annotations for the message, when applicable.
    - `audio` object, nullable — Audio response data when using audio output modality.
  - `has_more` boolean, required — Whether more messages are available.
  - `first_id` string, required — ID of the first message in this page.
  - `last_id` string, required — ID of the last message in this page.
  - `object` 'list' — The object type.

## 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/revisions/f3f783962256/schema)
