> ## 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 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:
        '200':
          description: ''

````