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

# Invoke Expert (SSE Stream)

> Invoke a Profy Expert agent. Returns a Server-Sent Events stream with dot-notation event names (run.created, output.text.delta, tool_call.created, run.completed, etc.).



## OpenAPI

````yaml POST /v1/agents/run
openapi: 3.0.0
info:
  title: Profy Platform API
  version: 1.0.0
  description: >-
    Platform API for building on Profy — invoke Experts, use models, report
    billing events, and manage OAuth.
servers:
  - url: https://api.profy.cn
    description: Production
security: []
paths:
  /v1/agents/run:
    post:
      tags:
        - Platform API
      summary: Invoke an Expert (SSE stream)
      description: >-
        Invoke a Profy Expert agent. Returns a Server-Sent Events stream with
        dot-notation event names (run.created, output.text.delta,
        tool_call.created, run.completed, etc.).
      operationId: agentsRun
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                expert_identifier:
                  type: string
                  description: Expert identifier (e.g. 'my-expert')
                message:
                  type: string
                  description: User message to send to the Expert
                session_id:
                  type: string
                  description: Existing session ID to continue a conversation (optional)
                model:
                  type: string
                  description: Override model selection (optional)
              required:
                - expert_identifier
                - message
      responses:
        '200':
          description: SSE stream with agent response events
          headers:
            X-Session-Id:
              schema:
                type: string
              description: Session ID for continuing the conversation
          content:
            text/event-stream:
              schema:
                type: string
        '400':
          description: Missing required fields or no LLM config available
        '401':
          description: Unauthorized — invalid or missing API key / token
        '403':
          description: Expert access denied (not purchased or trial exhausted)
        '404':
          description: Expert not found or not published
        '502':
          description: Agent runtime error
        '504':
          description: Agent runtime timeout
      security:
        - BearerToken: []
        - ApiKey: []
components:
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth2 access token issued via POST /oauth/token
    ApiKey:
      type: http
      scheme: bearer
      description: Developer API Key (sk-pro-xxx) created at platform.profy.cn

````