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

# Doc2X V3 PDF Conversion

> - Doc2X V3 PDF document conversion model, converting PDF into Markdown / LaTeX / DOCX formats
- Supports formula recognition and cross-page table merging
- The result is a ZIP archive (containing the converted document and image assets), downloaded via `results[0].url`
- Asynchronous processing mode; use the returned task ID to [query the result](/pages/en/api-manual/task-management/get-task-detail)
- The result format is `{url}`, where the URL points to a downloadable ZIP archive containing the converted document files (md / tex / docx) and image assets. See [Task Query Special Format Notes](/pages/en/api-manual/task-management/get-task-detail#special-formats)
- The ZIP link is valid for 24 hours; please download and save it promptly




## OpenAPI

````yaml openapi/en/doc2x-v3.json POST /v1/run/generations
openapi: 3.1.0
info:
  title: Doc2X V3 PDF Conversion
  version: '1.0'
servers:
  - url: https://api.aihubmax.com
security:
  - BearerAuth: []
paths:
  /v1/run/generations:
    post:
      tags:
        - Document > PDF Conversion
      summary: Doc2X V3 PDF Conversion
      description: >
        - Doc2X V3 PDF document conversion model, converting PDF into Markdown /
        LaTeX / DOCX formats

        - Supports formula recognition and cross-page table merging

        - The result is a ZIP archive (containing the converted document and
        image assets), downloaded via `results[0].url`

        - Asynchronous processing mode; use the returned task ID to [query the
        result](/pages/en/api-manual/task-management/get-task-detail)

        - The result format is `{url}`, where the URL points to a downloadable
        ZIP archive containing the converted document files (md / tex / docx)
        and image assets. See [Task Query Special Format
        Notes](/pages/en/api-manual/task-management/get-task-detail#special-formats)

        - The ZIP link is valid for 24 hours; please download and save it
        promptly
      operationId: doc2x-v3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Doc2xRequest'
            examples:
              pdf_to_markdown_default_settings:
                summary: PDF to Markdown (default settings)
                value:
                  model: doc2x-v3
                  pdf_url: https://example.com/document.pdf
                  page_count: 10
                  convert_mode: md
                  formula_mode: normal
                  filename: output
                  merge_cross_page_forms: false
      responses:
        '200':
          $ref: '#/components/responses/TaskCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    Doc2xRequest:
      type: object
      required:
        - model
        - pdf_url
        - page_count
      properties:
        model:
          examples:
            - doc2x-v3
          type: string
          default: doc2x-v3
          description: >-
            `doc2x-v3`: PDF → md / tex / docx conversion; the result is a
            downloadable ZIP archive
        pdf_url:
          description: Download URL of the PDF file
          type: string
          example: https://example.com/document.pdf
        page_count:
          description: >-
            Number of PDF pages, used for pre-authorization billing and runtime
            validation
          minimum: 1
          type: integer
          example: 10
        convert_mode:
          default: md
          description: Output format
          enum:
            - md
            - tex
            - docx
          type: string
          example: md
        formula_mode:
          default: normal
          description: Formula processing mode
          enum:
            - normal
            - dollar
          type: string
          example: normal
        filename:
          anyOf:
            - maxLength: 200
              type: string
            - type: 'null'
          default: null
          description: >-
            Output file name (without extension; truncated at runtime if it
            exceeds 50 characters)
          example: output
        merge_cross_page_forms:
          default: false
          description: Whether to merge cross-page tables
          type: boolean
          example: false
    TaskResponse:
      type: object
      properties:
        created:
          type: integer
          description: Task creation timestamp
          example: 1757165031
        id:
          type: string
          description: Task ID
          example: task-unified-1757165031-uyujaw3d
        model:
          type: string
          description: The actual model name used
        object:
          type: string
          description: The specific type of the task
          enum:
            - document.generation.task
        progress:
          type: integer
          description: Task progress percentage (0-100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: Task status
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          type: object
          description: Asynchronous task information
          properties:
            can_cancel:
              type: boolean
              description: Whether the task can be cancelled
              example: true
            estimated_time:
              type: integer
              description: Estimated completion time (seconds)
              example: 45
        type:
          type: string
          description: The output type of the task
          enum:
            - document
          example: document
    ErrorResponse400:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Bad request format
            type:
              type: string
              example: invalid_request_error
    ErrorResponse401:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid API key
            type:
              type: string
              example: authentication_error
    ErrorResponse402:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Insufficient account balance
            type:
              type: string
              example: insufficient_quota
    ErrorResponse422:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Parameter validation failed
            type:
              type: string
              example: validation_error
    ErrorResponse429:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Rate limit exceeded
            type:
              type: string
              example: rate_limit_error
    ErrorResponse500:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Internal server error
            type:
              type: string
              example: server_error
    ErrorResponse503:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Service temporarily unavailable, please try again later
            type:
              type: string
              example: service_unavailable
  responses:
    TaskCreated:
      description: Task created successfully
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TaskResponse'
    BadRequest:
      description: Bad request format
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse400'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse401'
    PaymentRequired:
      description: Insufficient balance
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse402'
    UnprocessableEntity:
      description: Parameter validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse422'
    TooManyRequests:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse429'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse500'
    ServiceUnavailable:
      description: Service temporarily unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse503'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        ## All endpoints require Bearer Token authentication ##

        Add the following to your request header:

        `Authorization: Bearer YOUR_API_KEY`

````