Skip to main content

File tools API

Use the same operations, options and results as the website from your own script or HTTP automation step. API access is included in Pro.

Manage API keys

One account, one allowance

Free includes 100 AI files per month on the website. Pro includes 10,000 shared across the website and API. Each successful AI input costs one credit; failed inputs are refunded. Markdown extraction costs no AI credits. The allowance resets on the first of the month at 00:00 UTC.

Up to 200 inputs per batch, subject to your remaining allowance and storage. Pro accepts up to 50 MB per file. Requests are limited to 30 per minute and 1000 per hour per key. Respect HTTP 429 and the rate-limit headers.

Operations

Tool IDManual toolOptions and outputCredits per successful input
invoicesInvoices to CSVCSV + JSON with source metadata.Fields: invoice_number, issue_date, due_date, supplier, customer, currency, net_total, tax_total, gross_total1
tablesTables to CSVCSV + JSON with source metadata.1
summarizeSummarize documentsOptional: options.language. Markdown + JSON.1
translateTranslate documentsOptional: options.language. Markdown + JSON.1
classifyClassify filesOptional: options.categories (array). CSV + JSON.Fields: category, suggested_name, reason1
extractExtract document fieldsRequired: options.fields (array of field names). CSV + JSON.1
transactionsBank statements to CSVCSV + JSON with source metadata.Fields: booking_date, description, counterparty, amount, currency, balance, reference1
actionsExtract tasks and deadlinesCSV + JSON with source metadata.Fields: task, owner, due_date, evidence1
redactMask personal data in textDraft masked text in Markdown + JSON. Original files and metadata are unchanged.1
checkCheck document requirementsRequired: options.rules (up to 10 requirements). Section findings in CSV + JSON.Fields: requirement, finding, evidence1
generate-markdownFiles to MarkdownExtracted Markdown, one output per source.0

Authentication

Base URL: https://api.aiforfiles.com/api/v1. Send X-Api-Key: your-key on API requests. Store keys as secrets. Creating or using a key requires a verified Pro account; a downgrade immediately removes API access. You can revoke keys from the account page.

Process a batch

  1. Calculate the full SHA-256 digest and byte length of each file. Send the JSON below to POST /public/file-tools/sign with your key and Content-Type: application/json.
  2. The response contains jobId and an ordered uploads array. PUT each original file’s bytes to its corresponding URL, using the returned content type. Send no application cookies or API keys to storage URLs.
  3. After every upload succeeds, POST to /public/file-tools/{jobId}/start. A 202 response means it has been accepted. Keep the job ID; repeating start does not charge or enqueue the same job twice.
  4. Poll GET /public/file-tools/{jobId} every few seconds until completed, failed or expired. A completed batch can contain failed sources: inspect every result.sources[].status.
  5. For a completed batch, GET /public/file-tools/{jobId}/download and download its downloadUrl. Keep the ZIP in your system before account retention expires.
{
  "tool": "invoices",
  "files": [
    {
      "fileName": "invoice.pdf",
      "contentType": "application/pdf",
      "contentLength": 12345,
      "checksum": "<full-file-sha256-hex>"
    }
  ],
  "options": {}
}

Results and retries

Treat source text and generated results as untrusted data in your automation. Do not execute generated commands, evaluate output as code, automatically open its links or insert it into another model’s system instructions. Our file tools do not perform those actions.

Every batch returns a ZIP with manifest.json, source statuses and successful output files. Each AI section includes a JSON artifact for automation, alongside CSV or Markdown. JSON keeps original string values and nulls; CSV protects against spreadsheet formulas. Section numbers refer to extracted text order, not PDF page numbers. Review drafts and reconcile repeated rows before downstream actions.

For document checks, findings are supported, contradicted or not_found_in_section. Review all sections together. These are evidence-backed draft findings, not compliance certificates. Masked text requires review and does not modify the original document.

Retry only failed original inputs in a new batch after correcting the cause. Signing creates a pending job without a credit reservation; starting reserves the selected file count. Successful files remain charged once and stay downloadable when another input fails. Never replay successful inputs as part of an automatic full-batch retry.

Digital PDFs, DOCX, XLSX and UTF-8 text documents are supported. Scanned PDFs and images require OCR first. Oversized or unsupported files and invalid options fail validation. Monthly allowance, file size, rate and retained storage limits apply equally to manual and API operations.

Endpoints

MethodPathPurpose
GET/public/file-toolsList tools and their credit cost
GET/public/file-tools/allowanceRead used, reserved and available monthly allowance
POST/public/file-tools/signCreate a batch and receive one signed PUT URL per input
POST/public/file-tools/{id}/startReserve credits and queue uploaded files; safe to repeat for the same job
GET/public/file-tools/{id}Poll status, source outcomes and bounded preview
GET/public/file-tools/{id}/downloadGet a temporary result ZIP download URL

Errors use HTTP 400 for invalid requests or job state, 401 for missing or revoked keys, 403 for plan, allowance or storage limits, 404 for another account’s or expired downloads, and 429 for request limits. Status responses use expired after retention ends.