> ## Documentation Index
> Fetch the complete documentation index at: https://abstract-pbc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a chat completion

> Returns an LLM completion your account created. A completion from a retired model reads back from its kept answer.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/chat/completions/{completion_id}
openapi: 3.1.0
info:
  title: Abstract API
  version: 1.0.0
  summary: Robot action models and LLMs behind one API key.
  description: >
    `POST /v1/chat/completions` serves the LLM models. `GET
    /v1/chat/completions/{completion_id}`

    reads an LLM completion your account created. `POST /v1/get_action` and
    `POST /v1/end_session`

    serve the robot action models in Dream Labs' request shape. `GET /v1/models`
    lists the LLM model ids.
  contact:
    name: Abstract
    url: https://abstract.inc
servers:
  - url: https://api.abstract.inc
security:
  - bearerAuth: []
tags:
  - name: Chat completions
  - name: Robot actions
    description: End-effector and model-specific native joint action contracts.
  - name: Catalog
  - name: CLI credentials
paths:
  /v1/chat/completions/{completion_id}:
    get:
      tags:
        - Chat completions
      summary: Retrieve a chat completion
      description: >-
        Returns an LLM completion your account created. A completion from a
        retired model reads back from its kept answer.
      operationId: retrieveChatCompletion
      parameters:
        - $ref: '#/components/parameters/AbstractVersion'
        - name: completion_id
          in: path
          required: true
          description: The `id` from the POST answer.
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{1,200}$
      responses:
        '200':
          description: The finished chat completion.
          headers:
            Request-Id:
              $ref: '#/components/headers/RequestId'
            Abstract-Version:
              $ref: '#/components/headers/AbstractVersion'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
              example:
                id: resp_abc123
                object: chat.completion
                created: 1790000000
                model: glm-5.3
                choices:
                  - index: 0
                    message:
                      role: assistant
                      content: >-
                        RFC 8628 defines the OAuth 2.0 device authorization
                        grant.
                    finish_reason: stop
                usage:
                  prompt_tokens: 14
                  prompt_tokens_details:
                    cached_tokens: 0
                  completion_tokens: 96
                  total_tokens: 110
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            `not_found`: no completion with this id belongs to your account, or
            a retired model's answer was never kept.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: '`invalid_id`: the id breaks its format.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: >-
            `upstream_failed` (the model did not complete the request) or
            `invalid_upstream_response`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  parameters:
    AbstractVersion:
      name: Abstract-Version
      in: header
      required: false
      description: >-
        The API version your client was written for. `2026-10-27` is the only
        version. Without this header the request is answered under the newest
        version; a version the API does not answer is refused with `400
        unsupported_api_version` before anything runs.
      schema:
        type: string
        enum:
          - '2026-10-27'
  headers:
    RequestId:
      description: >-
        `req_` and 32 hex characters, new for each HTTP attempt, a retry
        included. An error repeats it as `error.request_id`. Quote it when you
        report a problem.
      schema:
        type: string
        pattern: ^req_[0-9a-f]{32}$
    AbstractVersion:
      description: >-
        The API version this answer was made under: the `Abstract-Version` the
        request sent, or the newest version when it sent none.
      schema:
        type: string
  schemas:
    ChatCompletion:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
        - usage
      properties:
        id:
          type: string
        object:
          type: string
          const: chat.completion
        created:
          type: integer
          description: Unix seconds.
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                type: object
                properties:
                  role:
                    type: string
                    const: assistant
                  content:
                    type:
                      - string
                      - 'null'
                    description: The LLM answer.
                  reasoning_content:
                    type: string
                    description: LLM models. The model's reasoning, when it reports it.
                  refusal:
                    type: string
                    description: LLM models. The model's refusal, when it refuses.
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                  - content_filter
                  - error
        usage:
          $ref: '#/components/schemas/ChunkUsage'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
            - code
            - retryable
            - retry_after_s
            - request_id
          properties:
            message:
              type: string
              description: For people. It can change.
            type:
              type: string
            param:
              type:
                - string
                - 'null'
              description: The request field at fault, when one is.
            code:
              type: string
              description: Branch on this. See [Errors and limits](/errors).
            retryable:
              type: boolean
              description: >-
                Whether this same request may be sent again. When the route
                gives no answer of its own, `true` for 408, 429 and 503.
            retry_after_s:
              type:
                - number
                - 'null'
              description: The `Retry-After` header in seconds, or `null`.
            request_id:
              type: string
              pattern: ^req_[0-9a-f]{32}$
              description: >-
                This answer's `Request-Id` header. Quote it when you report a
                problem.
    ChunkUsage:
      type: object
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      properties:
        prompt_tokens:
          type: integer
          description: >-
            Prompt tokens, cached ones included. For a robot model, the model's
            prompt tokens for the chunk.
        prompt_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: >-
                The part of `prompt_tokens` served from cache. For a robot
                model, reused from earlier chunks of the episode.
        completion_tokens:
          type: integer
          description: >-
            Output tokens. For a robot model, the action rows the model
            computed, before any `action_horizon` cut.
        total_tokens:
          type: integer
  responses:
    Unauthorized:
      description: '`missing_api_key` or `invalid_api_key`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              message: Invalid API key.
              type: invalid_request_error
              code: invalid_api_key
    Unavailable:
      description: >-
        A dependency is down, for example `auth_unavailable`,
        `billing_unavailable`, `metering_unavailable` or `engine_unavailable`.
        Retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Abstract API key. Get it with `abstract login`, pass it as
        `$(abstract token)`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.