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

# List a run's events

> Returns what the agent did, in order: each prompt, then its messages, reasoning, tool calls and subagents, then a `stop` once the agent stopped. Events read alike whatever the harness, and are read from the run's output: `frame_seqs` points at the lines each one comes from. To get the next page, pass the `seq` of the last event received as `after`.



## OpenAPI

````yaml https://tracks.alpic.ai/api/openapi.json get /runs/{id}/events
openapi: 3.1.0
info:
  title: Tracks API
  version: 0.0.1
  description: >-
    Run coding agents such as Claude Code in isolated sandboxes with an API key
    of your organization. Create a run with a prompt, then follow its output and
    what it costs, or launch an experiment to compare agents on your scenarios.
servers:
  - url: https://tracks.alpic.ai/api
security: []
tags:
  - name: Runs
    description: Start coding agents and follow their work.
  - name: Files
    description: Upload files to place in a run's sandbox.
  - name: Connections
    description: >-
      Let agents use MCP servers as one of their users, without their
      credentials entering the sandbox.
  - name: Experiments
    description: >-
      Define scenarios to give several agents in several variants, judged on
      what they did.
  - name: Executions
    description: Launch experiments and read their results.
  - name: Library
    description: What your experiments can give their agents.
  - name: System
paths:
  /runs/{id}/events:
    get:
      tags:
        - Runs
      summary: List a run's events
      description: >-
        Returns what the agent did, in order: each prompt, then its messages,
        reasoning, tool calls and subagents, then a `stop` once the agent
        stopped. Events read alike whatever the harness, and are read from the
        run's output: `frame_seqs` points at the lines each one comes from. To
        get the next page, pass the `seq` of the last event received as `after`.
      operationId: runs.listEvents
      parameters:
        - name: id
          in: path
          schema:
            $ref: '#/components/schemas/RunId'
          required: true
        - name: after
          in: query
          schema:
            type: string
            pattern: ^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[Ee][+-]?\d+)?$
            allOf:
              - description: Return only items after this position.
          required: false
        - name: limit
          in: query
          schema:
            type: string
            pattern: ^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[Ee][+-]?\d+)?$
            allOf:
              - description: >-
                  Maximum number of items to return, from 1 to 1000. Defaults to
                  100.
          required: false
        - name: prompt
          in: query
          schema:
            type: string
            pattern: ^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[Ee][+-]?\d+)?$
            allOf:
              - description: Return only this prompt's events.
          required: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      anyOf:
                        - $ref: '#/components/schemas/PromptEvent'
                        - $ref: '#/components/schemas/MessageEvent'
                        - $ref: '#/components/schemas/ReasoningEvent'
                        - $ref: '#/components/schemas/ToolStartedEvent'
                        - $ref: '#/components/schemas/ToolEndedEvent'
                        - $ref: '#/components/schemas/SubagentStartedEvent'
                        - $ref: '#/components/schemas/SubagentEndedEvent'
                        - $ref: '#/components/schemas/PageVisitedEvent'
                        - $ref: '#/components/schemas/StopEvent'
                      description: >-
                        One thing the agent did, read from its output so that
                        runs of every harness read alike.
                  has_more:
                    type: boolean
                    description: Whether more items are available after this page.
                required:
                  - data
                  - has_more
                additionalProperties: false
        '400':
          description: >-
            The request is invalid: a value is missing, has the wrong type or is
            out of range. Fix it before sending the request again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestEncoded'
        '401':
          description: >-
            The API key is missing, malformed or revoked, or its organization is
            closed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyRefusedEncoded'
        '404':
          description: No run with this id exists in your organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunNotFoundEncoded'
      security:
        - bearer: []
components:
  schemas:
    RunId:
      type: string
      description: Unique identifier of the run.
    PromptEvent:
      type: object
      properties:
        run_id:
          $ref: '#/components/schemas/RunId'
        seq:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Position of the event in the run, starting at 1. Always increasing,
            but some numbers may be skipped.
        prompt:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Index of the prompt the event belongs to.
        captured_at:
          type: string
        subagent_id:
          type: string
          description: >-
            The subagent that did it: the `tool_call_id` of the `tool_started`
            event that launched it. Absent when the run's agent did it.
        frame_seqs:
          type: array
          items:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
          description: >-
            The `seq` of each output line the event was read from. Empty for
            events we record ourselves.
        type:
          type: string
          enum:
            - prompt
        text:
          type: string
          description: What you asked the agent to do.
      required:
        - run_id
        - seq
        - prompt
        - captured_at
        - frame_seqs
        - type
        - text
      additionalProperties: false
      description: A prompt given to the agent; the first event of its prompt.
    MessageEvent:
      type: object
      properties:
        run_id:
          $ref: '#/components/schemas/RunId'
        seq:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Position of the event in the run, starting at 1. Always increasing,
            but some numbers may be skipped.
        prompt:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Index of the prompt the event belongs to.
        captured_at:
          type: string
        subagent_id:
          type: string
          description: >-
            The subagent that did it: the `tool_call_id` of the `tool_started`
            event that launched it. Absent when the run's agent did it.
        frame_seqs:
          type: array
          items:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
          description: >-
            The `seq` of each output line the event was read from. Empty for
            events we record ourselves.
        type:
          type: string
          enum:
            - message
        text:
          type: string
          description: What the agent wrote.
      required:
        - run_id
        - seq
        - prompt
        - captured_at
        - frame_seqs
        - type
        - text
      additionalProperties: false
      description: Text the agent wrote, apart from reasoning and tool calls.
    ReasoningEvent:
      type: object
      properties:
        run_id:
          $ref: '#/components/schemas/RunId'
        seq:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Position of the event in the run, starting at 1. Always increasing,
            but some numbers may be skipped.
        prompt:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Index of the prompt the event belongs to.
        captured_at:
          type: string
        subagent_id:
          type: string
          description: >-
            The subagent that did it: the `tool_call_id` of the `tool_started`
            event that launched it. Absent when the run's agent did it.
        frame_seqs:
          type: array
          items:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
          description: >-
            The `seq` of each output line the event was read from. Empty for
            events we record ourselves.
        type:
          type: string
          enum:
            - reasoning
        text:
          type: string
          description: The reasoning, or a summary of it. Absent when the harness hides it.
      required:
        - run_id
        - seq
        - prompt
        - captured_at
        - frame_seqs
        - type
      additionalProperties: false
      description: The agent reasoning before it acts.
    ToolStartedEvent:
      type: object
      properties:
        run_id:
          $ref: '#/components/schemas/RunId'
        seq:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Position of the event in the run, starting at 1. Always increasing,
            but some numbers may be skipped.
        prompt:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Index of the prompt the event belongs to.
        captured_at:
          type: string
        subagent_id:
          type: string
          description: >-
            The subagent that did it: the `tool_call_id` of the `tool_started`
            event that launched it. Absent when the run's agent did it.
        frame_seqs:
          type: array
          items:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
          description: >-
            The `seq` of each output line the event was read from. Empty for
            events we record ourselves.
        type:
          type: string
          enum:
            - tool_started
        tool_call_id:
          type: string
          description: Identifier of the tool call, unique in its run.
        tool_name:
          type: string
          description: Name of the tool, as the harness calls it.
        input:
          description: What the agent passed to the tool.
      required:
        - run_id
        - seq
        - prompt
        - captured_at
        - frame_seqs
        - type
        - tool_call_id
        - tool_name
        - input
      additionalProperties: false
      description: The agent called a tool.
    ToolEndedEvent:
      type: object
      properties:
        run_id:
          $ref: '#/components/schemas/RunId'
        seq:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Position of the event in the run, starting at 1. Always increasing,
            but some numbers may be skipped.
        prompt:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Index of the prompt the event belongs to.
        captured_at:
          type: string
        subagent_id:
          type: string
          description: >-
            The subagent that did it: the `tool_call_id` of the `tool_started`
            event that launched it. Absent when the run's agent did it.
        frame_seqs:
          type: array
          items:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
          description: >-
            The `seq` of each output line the event was read from. Empty for
            events we record ourselves.
        type:
          type: string
          enum:
            - tool_ended
        tool_call_id:
          type: string
          description: Identifier of the tool call, unique in its run.
        outcome:
          $ref: '#/components/schemas/Outcome'
        output:
          type: string
          description: What the tool returned, possibly truncated.
        structured:
          description: >-
            The structured content an MCP tool returned beside its text,
            unchanged. Absent when the tool returned none or it was too large.
        screenshot:
          $ref: '#/components/schemas/Screenshot'
      required:
        - run_id
        - seq
        - prompt
        - captured_at
        - frame_seqs
        - type
        - tool_call_id
        - outcome
        - output
      additionalProperties: false
      description: >-
        A tool call ended; its `tool_call_id` is the one of the `tool_started`
        event.
    SubagentStartedEvent:
      type: object
      properties:
        run_id:
          $ref: '#/components/schemas/RunId'
        seq:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Position of the event in the run, starting at 1. Always increasing,
            but some numbers may be skipped.
        prompt:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Index of the prompt the event belongs to.
        captured_at:
          type: string
        subagent_id:
          type: string
          description: >-
            The subagent that did it: the `tool_call_id` of the `tool_started`
            event that launched it. Absent when the run's agent did it.
        frame_seqs:
          type: array
          items:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
          description: >-
            The `seq` of each output line the event was read from. Empty for
            events we record ourselves.
        type:
          type: string
          enum:
            - subagent_started
        description:
          type: string
          description: What the agent asked the subagent to do, in short.
      required:
        - run_id
        - seq
        - prompt
        - captured_at
        - frame_seqs
        - type
      additionalProperties: false
      description: >-
        A subagent started; its `subagent_id` is the `tool_call_id` of the
        `tool_started` event that launched it. That tool call may end before the
        subagent does: the subagent is done at its `subagent_ended`.
    SubagentEndedEvent:
      type: object
      properties:
        run_id:
          $ref: '#/components/schemas/RunId'
        seq:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Position of the event in the run, starting at 1. Always increasing,
            but some numbers may be skipped.
        prompt:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Index of the prompt the event belongs to.
        captured_at:
          type: string
        subagent_id:
          type: string
          description: >-
            The subagent that did it: the `tool_call_id` of the `tool_started`
            event that launched it. Absent when the run's agent did it.
        frame_seqs:
          type: array
          items:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
          description: >-
            The `seq` of each output line the event was read from. Empty for
            events we record ourselves.
        type:
          type: string
          enum:
            - subagent_ended
        outcome:
          $ref: '#/components/schemas/Outcome'
      required:
        - run_id
        - seq
        - prompt
        - captured_at
        - frame_seqs
        - type
        - outcome
      additionalProperties: false
      description: A subagent ended.
    PageVisitedEvent:
      type: object
      properties:
        run_id:
          $ref: '#/components/schemas/RunId'
        seq:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Position of the event in the run, starting at 1. Always increasing,
            but some numbers may be skipped.
        prompt:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Index of the prompt the event belongs to.
        captured_at:
          type: string
        subagent_id:
          type: string
          description: >-
            The subagent that did it: the `tool_call_id` of the `tool_started`
            event that launched it. Absent when the run's agent did it.
        frame_seqs:
          type: array
          items:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
          description: >-
            The `seq` of each output line the event was read from. Empty for
            events we record ourselves.
        type:
          type: string
          enum:
            - page_visited
        tool_call_id:
          type: string
          description: >-
            The browser tool call that led to the page, when the agent had made
            one.
        page_id:
          type: string
          description: >-
            Identifier of the page in the run: a later visit to the same page
            keeps it.
        version:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            How many times the page was seen changed, this one included,
            starting at 1.
        url:
          type: string
          description: URL of the page.
        title:
          type: string
          description: Title of the page, empty when it has none.
        reason:
          type: string
          enum:
            - arrival
            - settled
            - after_submit
            - error
            - after_action
            - prompt_end
          description: >-
            Why it was captured: on arrival, once settled, after a form was
            submitted, on an error, after a browser action, or when the prompt
            ended.
        screenshot:
          $ref: '#/components/schemas/Screenshot_1'
      required:
        - run_id
        - seq
        - prompt
        - captured_at
        - frame_seqs
        - type
        - page_id
        - version
        - url
        - title
        - reason
      additionalProperties: false
      description: The agent's browser showed a page, new or changed.
    StopEvent:
      type: object
      properties:
        run_id:
          $ref: '#/components/schemas/RunId'
        seq:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Position of the event in the run, starting at 1. Always increasing,
            but some numbers may be skipped.
        prompt:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Index of the prompt the event belongs to.
        captured_at:
          type: string
        subagent_id:
          type: string
          description: >-
            The subagent that did it: the `tool_call_id` of the `tool_started`
            event that launched it. Absent when the run's agent did it.
        frame_seqs:
          type: array
          items:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
          description: >-
            The `seq` of each output line the event was read from. Empty for
            events we record ourselves.
        type:
          type: string
          enum:
            - stop
        stop_reason:
          type: string
          enum:
            - completed
            - failed
            - canceled
          description: >-
            Why the agent stopped. When `failed`, `error` may explain what went
            wrong.
        error:
          type: string
          description: What went wrong.
      required:
        - run_id
        - seq
        - prompt
        - captured_at
        - frame_seqs
        - type
        - stop_reason
      additionalProperties: false
      description: >-
        The agent stopped working on the prompt; the last event of its prompt.
        It ends everything still open in the prompt: any tool call or subagent
        without its own end event ended with it.
    InvalidRequestEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - InvalidRequest
        message:
          type: string
          description: Every problem found, in one sentence.
        location:
          type: string
          enum:
            - path
            - query
            - header
            - body
          description: The part of the request that is wrong.
        issues:
          type: array
          items:
            $ref: '#/components/schemas/RequestIssue'
          description: Each problem found, with where it is.
      required:
        - _tag
        - message
        - location
        - issues
      additionalProperties: false
    ApiKeyRefusedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - ApiKeyRefused
        message:
          type: string
      required:
        - _tag
        - message
      additionalProperties: false
    RunNotFoundEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - RunNotFound
        message:
          type: string
      required:
        - _tag
        - message
      additionalProperties: false
    Outcome:
      type: string
      enum:
        - succeeded
        - failed
      description: Whether the tool call or subagent succeeded.
    Screenshot:
      type: object
      properties:
        page_url:
          type: string
          description: Address of the page shown.
      required:
        - page_url
      additionalProperties: false
      description: >-
        The page a browser tool call left its browser on, as the harness
        captured it. Absent when it captured none.
    Screenshot_1:
      type: object
      properties:
        page_url:
          type: string
          description: Address of the page shown.
      required:
        - page_url
      additionalProperties: false
      description: >-
        The page as the browser captured it. Absent when it captured none; its
        image may be missing when the sandbox was gone before it was kept.
    RequestIssue:
      type: object
      properties:
        path:
          type: array
          items:
            anyOf:
              - type: string
              - type: number
              - type: string
                enum:
                  - Infinity
                  - '-Infinity'
                  - NaN
          description: >-
            Keys leading to the wrong value inside that part of the request,
            such as `["agent", "model"]`. Empty when the problem concerns that
            part as a whole.
        message:
          type: string
          description: What is wrong with the value.
      required:
        - path
        - message
      additionalProperties: false
      description: One problem found in the request.
  securitySchemes:
    bearer:
      description: >-
        An API key of your organization, starting with `trk_`, sent as
        `Authorization: Bearer <key>`.
      type: http
      scheme: bearer

````

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