{
  "openapi": "3.1.0",
  "info": {
    "title": "ASHDOCS API",
    "version": "1.0",
    "description": "30 document tools behind one API key. Sandbox keys (ash_test_) never bill. Failed jobs are never charged."
  },
  "servers": [
    {
      "url": "https://api.ashdocs.com"
    }
  ],
  "tags": [
    {
      "name": "Convert",
      "description": "Render or transform documents: HTML/URL/Markdown to PDF, format conversion."
    },
    {
      "name": "Edit",
      "description": "Merge, split, compress, rotate, watermark and other page-level PDF operations."
    },
    {
      "name": "Extract",
      "description": "OCR and structured data extraction \u2014 tables, schema-driven JSON, bank statements."
    },
    {
      "name": "Secure",
      "description": "Passwords and PII redaction."
    },
    {
      "name": "Generate",
      "description": "Invoices, barcodes, QR codes, screenshots, and Open Graph images."
    },
    {
      "name": "Jobs",
      "description": "Poll the status of an asynchronous (202) job."
    },
    {
      "name": "Webhooks",
      "description": "Register a signed HTTP callback for job and pipeline events."
    }
  ],
  "paths": {
    "/api/v1/tools/html-to-pdf": {
      "post": {
        "tags": [
          "Convert"
        ],
        "summary": "HTML to PDF",
        "operationId": "run_html_to_pdf",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "html": "<h1>Hello</h1><p>Invoice #1042</p>",
                "options": {
                  "format": "A4"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/url-to-pdf": {
      "post": {
        "tags": [
          "Convert"
        ],
        "summary": "URL to PDF",
        "operationId": "run_url_to_pdf",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "url": "https://example.com",
                "options": {
                  "wait_for": "networkidle"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 2
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/merge": {
      "post": {
        "tags": [
          "Edit"
        ],
        "summary": "Merge PDF",
        "operationId": "run_merge",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_urls": [
                  "https://example.com/a.pdf",
                  "https://example.com/b.pdf"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/split": {
      "post": {
        "tags": [
          "Edit"
        ],
        "summary": "Split PDF",
        "operationId": "run_split",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "ranges": [
                    [
                      1,
                      3
                    ],
                    [
                      4,
                      6
                    ]
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/rotate": {
      "post": {
        "tags": [
          "Edit"
        ],
        "summary": "Rotate PDF",
        "operationId": "run_rotate",
        "x-credits": 0,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "degrees": 90,
                  "pages": [
                    1,
                    2
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 0
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/compress": {
      "post": {
        "tags": [
          "Edit"
        ],
        "summary": "Compress PDF",
        "operationId": "run_compress",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/watermark": {
      "post": {
        "tags": [
          "Edit"
        ],
        "summary": "Watermark PDF",
        "operationId": "run_watermark",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "text": "CONFIDENTIAL",
                  "opacity": 0.3
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/password-add": {
      "post": {
        "tags": [
          "Secure"
        ],
        "summary": "Password Protect",
        "operationId": "run_password_add",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "user_password": "S3cret!"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/password-remove": {
      "post": {
        "tags": [
          "Secure"
        ],
        "summary": "Remove Password",
        "operationId": "run_password_remove",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "password": "S3cret!"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/extract-pages": {
      "post": {
        "tags": [
          "Edit"
        ],
        "summary": "Extract Pages",
        "operationId": "run_extract_pages",
        "x-credits": 0,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "pages": [
                    1,
                    2,
                    3
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 0
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/remove-pages": {
      "post": {
        "tags": [
          "Edit"
        ],
        "summary": "Remove Pages",
        "operationId": "run_remove_pages",
        "x-credits": 0,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "pages": [
                    7,
                    8
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 0
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/page-numbers": {
      "post": {
        "tags": [
          "Edit"
        ],
        "summary": "Add Page Numbers",
        "operationId": "run_page_numbers",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "position": "bottom-center"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/metadata": {
      "post": {
        "tags": [
          "Edit"
        ],
        "summary": "Edit Metadata",
        "operationId": "run_metadata",
        "x-credits": 0,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "metadata": {
                    "title": "Q3 Report",
                    "author": "ASHDOCS"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 0
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/image-to-pdf": {
      "post": {
        "tags": [
          "Convert"
        ],
        "summary": "Images to PDF",
        "operationId": "run_image_to_pdf",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_urls": [
                  "https://example.com/1.jpg",
                  "https://example.com/2.jpg"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/pdf-to-image": {
      "post": {
        "tags": [
          "Convert"
        ],
        "summary": "PDF to Images",
        "operationId": "run_pdf_to_image",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "dpi": 150,
                  "format": "png"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/ocr": {
      "post": {
        "tags": [
          "Extract"
        ],
        "summary": "OCR PDF",
        "operationId": "run_ocr",
        "x-credits": 3,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "language": "eng"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job queued.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "queued": {
                      "type": "boolean"
                    },
                    "status_url": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "status": "queued",
                  "queued": true,
                  "status_url": "/api/jobs/job_01h9x8k2m4n6p8q0"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/office-to-pdf": {
      "post": {
        "tags": [
          "Convert"
        ],
        "summary": "Office to PDF",
        "operationId": "run_office_to_pdf",
        "x-credits": 2,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/report.docx"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "status": "queued",
                  "queued": true,
                  "status_url": "/api/jobs/job_01h9x8k2m4n6p8q0"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/pdf-to-text": {
      "post": {
        "tags": [
          "Extract"
        ],
        "summary": "PDF to Text",
        "operationId": "run_pdf_to_text",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/pdf-to-table": {
      "post": {
        "tags": [
          "Extract"
        ],
        "summary": "PDF to Table",
        "operationId": "run_pdf_to_table",
        "x-credits": 2,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "output_format": "csv",
                  "pages": "all",
                  "header_row": true,
                  "merge_tables": false,
                  "detect_borderless": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "credits_consumed": 2,
                  "confidence_summary": {
                    "overall": 0.94,
                    "needs_review_count": 0
                  },
                  "needs_review": false,
                  "outputs": [
                    {
                      "filename": "tables.csv",
                      "url": "https://example.com/sample.pdf"
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/pdf-to-data": {
      "post": {
        "tags": [
          "Extract"
        ],
        "summary": "PDF to Data (schema)",
        "operationId": "run_pdf_to_data",
        "x-credits": 3,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "schema": {
                  "invoice_number": "string",
                  "total": "number",
                  "due_date": "date"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "credits_consumed": 3,
                  "confidence_summary": {
                    "overall": 0.94,
                    "needs_review_count": 0
                  },
                  "needs_review": false,
                  "result_id": "res_01h9x8k2m4n6p8q0",
                  "confidence": {
                    "invoice_number": 0.99,
                    "total": 0.97,
                    "due_date": 0.88
                  }
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/bank-statement-to-csv": {
      "post": {
        "tags": [
          "Extract"
        ],
        "summary": "Bank Statement to CSV",
        "operationId": "run_bank_statement_to_csv",
        "x-credits": 3,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "output_format": "csv",
                  "date_format": "%Y-%m-%d",
                  "categorize": false
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "credits_consumed": 3,
                  "confidence_summary": {
                    "overall": 0.94,
                    "needs_review_count": 0
                  },
                  "needs_review": false,
                  "outputs": [
                    {
                      "filename": "transactions.csv",
                      "url": "https://example.com/sample.pdf"
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/pdf-to-markdown": {
      "post": {
        "tags": [
          "Extract"
        ],
        "summary": "PDF to Markdown",
        "operationId": "run_pdf_to_markdown",
        "x-credits": 2,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "include_page_markers": false
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 2
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/markdown-to-pdf": {
      "post": {
        "tags": [
          "Convert"
        ],
        "summary": "Markdown to PDF",
        "operationId": "run_markdown_to_pdf",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "content": "# Report\n\n- one\n- two",
                "options": {
                  "format": "A4"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/pdf-to-html": {
      "post": {
        "tags": [
          "Convert"
        ],
        "summary": "PDF to HTML",
        "operationId": "run_pdf_to_html",
        "x-credits": 2,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "mode": "responsive",
                  "inline_images": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 2
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/invoice-pdf": {
      "post": {
        "tags": [
          "Generate"
        ],
        "summary": "Invoice PDF",
        "operationId": "run_invoice_pdf",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "invoice": {
                  "currency": "USD",
                  "line_items": [
                    {
                      "description": "Consulting \u2014 October",
                      "quantity": 10,
                      "unit_price": 150,
                      "tax_rate": 0
                    }
                  ]
                },
                "options": {
                  "template": "clean"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/barcode": {
      "post": {
        "tags": [
          "Generate"
        ],
        "summary": "Barcode",
        "operationId": "run_barcode",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "data": "012345678905",
                "symbology": "ean13",
                "options": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/qr-code": {
      "post": {
        "tags": [
          "Generate"
        ],
        "summary": "QR Code",
        "operationId": "run_qr_code",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "content": {
                  "type": "url",
                  "value": "https://www.ashdocs.com"
                },
                "options": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/screenshot": {
      "post": {
        "tags": [
          "Generate"
        ],
        "summary": "Screenshot",
        "operationId": "run_screenshot",
        "x-credits": 2,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "url": "https://example.com",
                "options": {
                  "format": "png",
                  "viewport": {
                    "width": 1280,
                    "height": 800
                  },
                  "full_page": false
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 2
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/og-image": {
      "post": {
        "tags": [
          "Generate"
        ],
        "summary": "OG Image",
        "operationId": "run_og_image",
        "x-credits": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "template": "basic",
                "fields": {
                  "title": "Documents that run themselves.",
                  "background": "#101014"
                },
                "options": {
                  "width": 1200,
                  "height": 630
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 1
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/v1/tools/redact-pdf": {
      "post": {
        "tags": [
          "Secure"
        ],
        "summary": "Redact PDF",
        "operationId": "run_redact_pdf",
        "x-credits": 2,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "file_url": "https://example.com/sample.pdf",
                "options": {
                  "types": [
                    "email",
                    "ssn",
                    "credit_card"
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool completed synchronously.",
            "headers": {
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "credits_consumed": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "request_id": "req_01h9x8k2m4n6p8q0",
                  "job_id": "job_01h9x8k2m4n6p8q0",
                  "status": "completed",
                  "url": "https://example.com/sample.pdf",
                  "credits_consumed": 2
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits, or an extraction-only tier's extraction allowance is exhausted."
          },
          "422": {
            "description": "Request failed validation \u2014 see survey 0.2.9/0.2.11 for the current (inconsistent) error shape."
          }
        }
      }
    },
    "/api/jobs": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "List your recent jobs",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/jobs/{job_id}": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "Get a job by job_id \u2014 the id every status_url points to",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/jobs/{job_id}/logs": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "Per-job timing, credit and error timeline",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/jobs/{request_id}": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "Get a job by request_id (a distinct id from job_id \u2014 survey 0.2.6)",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/batch": {
      "post": {
        "tags": [
          "Jobs"
        ],
        "summary": "Run one tool over multiple files, one credit ledger entry",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "tool_key": {
                    "type": "string"
                  },
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  },
                  "options": {
                    "type": "string",
                    "default": "{}"
                  },
                  "max_concurrency": {
                    "type": "integer",
                    "default": 5
                  }
                }
              },
              "example": {
                "tool_key": "compress",
                "options": "{}",
                "max_concurrency": 5
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "batch_id": "batch_01h9x8k2m4n6p8q0",
                  "results": [
                    {
                      "filename": "a.pdf",
                      "status": "completed",
                      "url": "https://api.ashdocs.com/api/files/usr_.../job_.../a.pdf?exp=...&sig=..."
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include batch"
          }
        }
      }
    },
    "/api/v1/batch/{batch_id}": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "Get a batch run's status",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/webhooks": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Register a webhook (X-ASHDOCS-Signature HMAC-SHA256, survey 0.2.9)",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "example": {
                "url": "https://example.com/hooks/ashdocs",
                "events": [
                  "job.completed",
                  "job.failed"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "webhook_id": "wh_01h9x8k2m4n6p8q0",
                  "url": "https://example.com/hooks/ashdocs",
                  "events": [
                    "job.completed",
                    "job.failed"
                  ],
                  "secret": "whsec_...",
                  "enabled": true
                }
              }
            }
          },
          "403": {
            "description": "Plan does not include webhooks"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Sandbox keys (prefix ash_test_) run every tool end-to-end without consuming credits."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Replays the cached response for 24h on a repeat with the same key + API key (survey 0.2.5). Recommended (UUID4) on every job-creating call."
      }
    },
    "headers": {
      "IdempotencyReplayed": {
        "description": "Present when this response was served from the idempotency cache rather than re-run.",
        "schema": {
          "type": "boolean"
        }
      }
    }
  }
}
