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

# Resume Stream

> Replay an in-progress Agent session stream. Authenticate with `X-Api-Key`.

The `Last-Event-ID` header takes priority over the `lastEventId` query parameter. Both values are the SSE event ID bound to the current run. A completed session can be replayed only while the stream is still retained. An aborted session or an expired stream returns HTTP 204. The response is SSE and is not wrapped in `{ code, data }`.



## OpenAPI

````yaml /openapi/en/aitoearn.openapi.json get /api/agent/sessions/{sessionId}/resume
openapi: 3.0.1
info:
  title: AiToEarn Open Platform API
  description: >-
    AiToEarn Open Platform API. You can switch between the China and
    international sites for testing. Business success is determined by whether
    the response body has code === 0.
  version: 1.0.0
  contact: {}
servers:
  - url: https://aitoearn.cn
    description: China site
  - url: https://aitoearn.ai
    description: International site
security: []
tags:
  - name: AI Services
  - name: AI Services/Video Generation
  - name: AI Services/Image Generation
  - name: Channel Management
  - name: Channel Management/Accounts
  - name: Channel Management/Publishing
  - name: Channel Management/Platforms
  - name: Channel Management/Works
  - name: Channel Management/Account Groups
  - name: Channel Management/Authorization
  - name: Asset Management
  - name: AI Services/Large Language Models
  - name: AI Services/Real-person Assets
  - name: AI Services/Agent
paths:
  /api/agent/sessions/{sessionId}/resume:
    get:
      tags:
        - AI Services/Agent
      summary: Resume Stream
      description: >-
        Replay an in-progress Agent session stream. Authenticate with
        `X-Api-Key`.


        The `Last-Event-ID` header takes priority over the `lastEventId` query
        parameter. Both values are the SSE event ID bound to the current run. A
        completed session can be replayed only while the stream is still
        retained. An aborted session or an expired stream returns HTTP 204. The
        response is SSE and is not wrapped in `{ code, data }`.
      operationId: AgentController_resume
      parameters:
        - name: sessionId
          in: path
          required: true
          description: Session ID.
          schema:
            type: string
            description: Session ID.
        - name: lastEventId
          in: query
          required: false
          description: >-
            Resume cursor. The Last-Event-ID header takes priority over this
            parameter.
          schema:
            type: string
            description: >-
              Resume cursor. The Last-Event-ID header takes priority over this
              parameter.
        - name: Last-Event-ID
          in: header
          required: false
          description: >-
            SSE resume cursor. It takes priority over the lastEventId query
            parameter.
          schema:
            type: string
            description: >-
              SSE resume cursor. It takes priority over the lastEventId query
              parameter.
      responses:
        '200':
          description: >-
            Native third-party protocol response or SSE data, not wrapped in the
            AiToEarn common response envelope.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                description: >-
                  Native third-party protocol response, not wrapped in the
                  AiToEarn common response envelope.
              examples:
                success:
                  summary: Native third-party success response
                  value:
                    id: AgentController_resume_example
                    object: response
            text/event-stream:
              schema:
                type: string
                description: SSE streaming response.
      security:
        - apikey-header-X-Api-Key: []
components:
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Need to get API Key from AiToEarn. Click to go to ["API Key Obtaining
        Tutorial"](/en/use/api-key).

````