> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream Agent Checkout Messages

> Server-sent events for one checkout: `message.upsert` carries a message, `run.updated` a run update, and each event's `id` is the cursor to resume from. Resume with `last-event-id` or `after`; omit both to stream from the start.

The checkout is read before the stream opens, so an unknown or inaccessible one is reported as a normal error status rather than an empty stream.

A resume cursor that is stale, or that belongs to another checkout, is the one failure that cannot be: only the stream request validates it, and the event stream has already begun by the time Universal Checkout rejects it, so the stream closes instead. Treat an unexpected close as a resynchronisation signal — re-read the message history and reconnect from the cursor it reports, not from the rejected one.



## OpenAPI

````yaml api-reference/_open-api/Agents.json GET /unstable/agent-checkouts/{id}/messages/stream
openapi: 3.0.0
info:
  contact:
    email: support@crossmint.com
    name: Crossmint Support
    url: https://www.crossmint.com
  description: Crossmint Agents API
  title: Crossmint Agents API
  version: 1.0.0
servers:
  - description: Staging environment (testnets)
    url: https://staging.crossmint.com/api
  - description: Production environment (mainnets)
    url: https://www.crossmint.com/api
security: []
tags: []
paths:
  /unstable/agent-checkouts/{id}/messages/stream:
    get:
      tags:
        - Agent Checkouts
      summary: Stream Agent Checkout Messages
      description: >-
        Server-sent events for one checkout: `message.upsert` carries a message,
        `run.updated` a run update, and each event's `id` is the cursor to
        resume from. Resume with `last-event-id` or `after`; omit both to stream
        from the start.


        The checkout is read before the stream opens, so an unknown or
        inaccessible one is reported as a normal error status rather than an
        empty stream.


        A resume cursor that is stale, or that belongs to another checkout, is
        the one failure that cannot be: only the stream request validates it,
        and the event stream has already begun by the time Universal Checkout
        rejects it, so the stream closes instead. Treat an unexpected close as a
        resynchronisation signal — re-read the message history and reconnect
        from the cursor it reports, not from the rejected one.
      operationId: AgentCheckoutsController-streamMessages-2
      parameters:
        - description: >-
            Server-side subject to act on behalf of. Ignored for client-side
            user auth.
          in: header
          name: x-crossmint-user-id
          required: false
          schema:
            type: string
        - description: Bearer token for client-side user auth.
          in: header
          name: Authorization
          required: false
          schema:
            type: string
        - description: Crossmint project API key.
          in: header
          name: X-API-KEY
          required: true
          schema:
            type: string
        - in: path
          name: id
          required: true
          schema:
            minLength: 1
            type: string
        - in: query
          name: after
          required: false
          schema:
            minLength: 1
            type: string
        - description: >-
            Resume cursor from the last delivered event. Takes precedence over
            `after`.
          in: header
          name: last-event-id
          required: false
          schema:
            type: string
      responses:
        '400':
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
          description: >-
            Invalid arguments. Make sure you are following the API
            specification.
        '401':
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
          description: Missing or invalid API key.
        '403':
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
          description: >-
            Forbidden. Ensure the credentials are correct and the authentication
            source is allowed.
        '404':
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
          description: Not found.
        '502':
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
          description: The upstream service returned an incompatible response.
        '503':
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
          description: Upstream service unavailable. Try again in a few minutes.
components:
  schemas:
    ApiErrorDto:
      properties:
        code:
          description: Machine-readable error code for programmatic handling
          type: string
        error:
          example: true
          type: boolean
        message:
          description: Human-readable error message describing what went wrong
          type: string
      required:
        - error
        - message
      type: object

````