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

# [Beta] Subscribe to an axon event stream via SSE.

> [Beta] Subscribe to an axon event stream via server-sent events.



## OpenAPI

````yaml /openapi-specs/stainless-processed-openapi.json get /v1/axons/{id}/subscribe/sse
openapi: 3.1.0
info:
  title: RunLoop API
  version: '0.1'
  description: >-
    The RunLoop API spec that allows you to host lambda functions and Devboxes
    to enable scaled long running ai workflows.
  contact:
    name: Runloop AI Support
    url: https://runloop.ai
    email: support@runloop.ai
servers:
  - url: https://api.runloop.ai
    description: Runloop API
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: Benchmark
  - name: Blueprint
  - name: Blueprint-Lifecycle
  - name: Blueprint-ObservabilityTools
  - name: Devbox
  - name: Devbox-FileTools
  - name: Devbox-Lifecycle
  - name: Devbox-NetworkTools
  - name: Devbox-ObservabilityTools
  - name: Devbox-PersistenceTools
  - name: Devbox-ShellTools
  - name: Scenario
  - name: ScenarioScorer
  - name: accounts
  - name: agents
  - name: apikeys
  - name: axons
  - name: executions
  - name: gateway-configs
  - name: mcp-configs
  - name: network-policies
  - name: objects
  - name: restricted_keys
  - name: secrets
  - name: streaming
paths:
  /v1/axons/{id}/subscribe/sse:
    get:
      tags:
        - axons
      summary: '[Beta] Subscribe to an axon event stream via SSE.'
      description: '[Beta] Subscribe to an axon event stream via server-sent events.'
      operationId: subscribeToAxonSse
      parameters:
        - name: id
          in: path
          description: The axon identifier.
          required: true
          schema:
            type: string
        - name: after_sequence
          in: query
          description: >-
            Sequence number after which to start streaming. Events with sequence
            > this value are returned. If unset, replay from the beginning.
          allowEmptyValue: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AxonEventView'
          headers:
            Content-Type:
              description: text/event-stream
              schema:
                type: string
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Runloop from '@runloop/api-client';

            const client = new Runloop({
              bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
            });

            const axonEventView = await client.axons.subscribeSse('id');

            console.log(axonEventView.axon_id);
        - lang: Python
          source: |-
            import os
            from runloop_api_client import Runloop

            client = Runloop(
                bearer_token=os.environ.get("RUNLOOP_API_KEY"),  # This is the default and can be omitted
            )
            for axon in client.axons.subscribe_sse(
                id="id",
            ):
              print(axon)
components:
  schemas:
    AxonEventView:
      type: object
      properties:
        sequence:
          type: integer
          format: int64
          description: Monotonic sequence number.
        axon_id:
          type: string
          description: The axon identifier.
        timestamp_ms:
          type: integer
          format: int64
          description: Timestamp in milliseconds since epoch.
        origin:
          $ref: '#/components/schemas/AxonEventOrigin'
          description: Event origin.
        source:
          type: string
          description: Event source (e.g. github, slack).
        event_type:
          type: string
          description: Event type (e.g. push, pull_request).
        payload:
          type: string
          description: JSON-encoded event payload.
      required:
        - sequence
        - axon_id
        - timestamp_ms
        - origin
        - source
        - event_type
        - payload
    AxonEventOrigin:
      type: string
      enum:
        - EXTERNAL_EVENT
        - AGENT_EVENT
        - USER_EVENT
        - SYSTEM_EVENT
      description: Event origin classification.
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````