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

# Run agent (SSE streaming)

> Run the agent with a query and stream SSE events.



## OpenAPI

````yaml /docs/reference/openapi.json post /run
openapi: 3.1.0
info:
  description: >-
    The HTTP API of an agent served with `omniserve run --agent agent.py`: runs,
    approvals, budgets, background tasks, sessions and the evidence of every
    run.
  title: OmniServe
  version: latest
servers:
  - description: omniserve run, locally
    url: http://localhost:8000
security: []
paths:
  /run:
    post:
      tags:
        - Runs
      summary: Run agent (SSE streaming)
      description: Run the agent with a query and stream SSE events.
      operationId: run_agent_sse_run_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: SSE stream of agent events
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    RunRequest:
      description: Request model for agent run endpoint.
      properties:
        query:
          description: The query/prompt for the agent
          title: Query
          type: string
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional session ID for conversation continuity
          title: Session Id
      required:
        - query
      title: RunRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ErrorResponse:
      description: Standard error response model.
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: Additional error details
          title: Detail
        error:
          description: Error type
          title: Error
          type: string
        message:
          description: Error message
          title: Message
          type: string
      required:
        - error
        - message
      title: ErrorResponse
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````