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

# Run Pipeline

> Execute a pre-configured pipeline on a document. Combines multiple processing steps (parse, extract, split) into a single call.



## OpenAPI

````yaml api-reference/openapi.json post /pipeline
openapi: 3.1.0
info:
  title: Aifano Platform API
  version: 1.0.0
  description: >-
    Transform unstructured documents into structured data. Parse, extract,
    split, and edit documents at scale.
servers:
  - url: https://platform.aifano.com
    description: Production
security:
  - BearerAuth: []
paths:
  /pipeline:
    post:
      tags:
        - Pipelines
      summary: Run Pipeline
      description: >-
        Execute a pre-configured pipeline on a document. Combines multiple
        processing steps (parse, extract, split) into a single call.
      operationId: pipeline
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PipelineRequest'
      responses:
        '200':
          description: Pipeline result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    PipelineRequest:
      type: object
      required:
        - input
        - pipeline_id
      properties:
        input:
          $ref: '#/components/schemas/DocumentInput'
        pipeline_id:
          type: string
          description: The ID of the pipeline to execute.
    PipelineResponse:
      type: object
      properties:
        job_id:
          type: string
        duration:
          type: number
        usage:
          $ref: '#/components/schemas/Usage'
        result:
          type: object
    DocumentInput:
      description: >-
        The document to process. Accepts: (1) a public URL, (2) a presigned S3
        URL, (3) an `aifano://file_id` from /upload, or (4) a `jobid://job_id`
        from a previous /parse call.
      oneOf:
        - type: string
          description: URL or aifano:// reference
        - $ref: '#/components/schemas/UploadResponse'
    Usage:
      type: object
      properties:
        num_pages:
          type: integer
          description: Number of pages processed.
        credits:
          type: number
          nullable: true
          description: Credits consumed.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message.
    UploadResponse:
      type: object
      required:
        - file_id
      properties:
        file_id:
          type: string
          description: File reference in `aifano://file_id` format.
        presigned_url:
          type: string
          nullable: true
          description: Presigned URL for direct access.
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized - invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Use your Aifano API key (starts with `ak_live_`)
        as the Bearer token.

````