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

# Stream agent run

> Run an agent on a thread and stream the response as server-sent events.



## OpenAPI

````yaml post /v1/threads/{thread_id}/runs/stream
openapi: 3.1.0
info:
  title: SeekrFlow API
  description: SeekrFlow API Documentation
  termsOfService: http://www.seekr.com/support
  contact:
    name: Seekr API Support
    url: http://www.seekr.com/contact
    email: contact@seekr.com
  version: 5.30.1
servers:
  - url: https://flow.seekr.com
    description: SeekrBuild server base URL
security: []
paths:
  /v1/threads/{thread_id}/runs/stream:
    post:
      tags:
        - Runs
      summary: Stream agent run
      description: Run an agent on a thread and stream the response as server-sent events.
      operationId: run_agent_stream_v1_threads__thread_id__runs_stream_post
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            title: Thread Id
        - name: x-team-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Team-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    RunRequest:
      properties:
        agent_id:
          type: string
          title: Agent Id
          default: default_agent
        model_settings:
          $ref: '#/components/schemas/ModelSettings'
          default:
            temperature: 1
            top_p: 1
            frequency_penalty: 0
            presence_penalty: 0
        response_format:
          anyOf:
            - $ref: '#/components/schemas/ResponseFormat'
            - type: 'null'
        group:
          type: string
          title: Group
          default: default_group
        metadata:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Metadata
      type: object
      title: RunRequest
      description: Request model for creating a run.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ModelSettings:
      properties:
        temperature:
          type: number
          maximum: 2
          minimum: 0
          title: Temperature
          default: 1
        top_p:
          type: number
          maximum: 1
          minimum: 0
          title: Top P
          default: 1
        frequency_penalty:
          type: number
          maximum: 2
          minimum: -2
          title: Frequency Penalty
          default: 0
        presence_penalty:
          type: number
          maximum: 2
          minimum: -2
          title: Presence Penalty
          default: 0
        max_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Tokens
      type: object
      title: ModelSettings
      description: >-
        Settings to use when calling an LLM.


        This class holds optional model configuration parameters (e.g.
        temperature,

        top_p, penalties, truncation, etc.).


        Not all models/providers support all of these parameters, so please
        check the API documentation

        for the specific model and provider you are using.
    ResponseFormat:
      properties:
        json_schema:
          additionalProperties: true
          type: object
          title: Json Schema
      type: object
      required:
        - json_schema
      title: ResponseFormat
      description: |-
        Specifies a JSON schema for structured output.

        When provided, the LLM will be constrained to return a JSON response
        that matches the specified schema.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: Authorization Bearer Token
      in: header
      name: Authorization

````