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

# Get chat completion.

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

Describe a chat completion by its ID.

## Path parameters

- `completion_id` string, required — ID of the chat completion.

## Response `200`

A OpenAICompletionWithInputMessages.

- OpenAICompletionWithInputMessages — Chat completion response extended with the original 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.
            - `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.
              - …
          - 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.
              - …
      - `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[]
            - 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[]
            - `type` 'text' — Must be 'text' to identify this as text content.
            - `text` string, required — The text content of the message.
        - `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[]
            - `type` 'text' — Must be 'text' to identify this as text content.
            - `text` string, required — The text content of the message.
        - `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.
            - `name` string, required — Name of the function to call.
            - `arguments` string, required — Arguments to pass to the function as a JSON string.
      - 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[]
            - `type` 'text' — Must be 'text' to identify this as text content.
            - `text` string, required — The text content of the message.
      - 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[]
            - `type` 'text' — Must be 'text' to identify this as text content.
            - `text` string, required — The text content of the message.
        - `name` string, nullable — The name of the developer message participant.

## 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)
