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

# Dag Endpoint

> Run a DAG planner pipeline with SSE progress updates.

Parameters
----------
request : Request
    The incoming HTTP request; used to detect client disconnects.
body : ChatStreamRequest
    JSON request body containing the query and optional parameters.



## OpenAPI

````yaml /openapi.json post /api/dag
openapi: 3.1.0
info:
  title: FIM One API
  description: >-
    All-in-one agent platform for Global × China enterprises — programmatic
    access to agents, conversations, knowledge bases, and more.
  version: 0.8.9
servers:
  - url: https://your-domain.com
    description: Your FIM One instance
security:
  - BearerAuth: []
paths:
  /api/dag:
    post:
      summary: Dag Endpoint
      description: |-
        Run a DAG planner pipeline with SSE progress updates.

        Parameters
        ----------
        request : Request
            The incoming HTTP request; used to detect client disconnects.
        body : ChatStreamRequest
            JSON request body containing the query and optional parameters.
      operationId: dag_endpoint_api_dag_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatStreamRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ChatStreamRequest:
      properties:
        q:
          type: string
          title: Q
        conversation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation Id
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
        token:
          anyOf:
            - type: string
            - type: 'null'
          title: Token
        image_ids:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Ids
        user_metadata:
          anyOf:
            - type: string
            - type: 'null'
          title: User Metadata
        doc_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Doc Mode
      type: object
      required:
        - q
      title: ChatStreamRequest
      description: Request body for ReAct/DAG streaming endpoints.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API Key (fim_xxx) or JWT token

````