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 keysOne 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 ID | Manual tool | Options and output | Credits per successful input |
|---|---|---|---|
invoices | Invoices to CSV | CSV + JSON with source metadata.Fields: invoice_number, issue_date, due_date, supplier, customer, currency, net_total, tax_total, gross_total | 1 |
tables | Tables to CSV | CSV + JSON with source metadata. | 1 |
summarize | Summarize documents | Optional: options.language. Markdown + JSON. | 1 |
translate | Translate documents | Optional: options.language. Markdown + JSON. | 1 |
classify | Classify files | Optional: options.categories (array). CSV + JSON.Fields: category, suggested_name, reason | 1 |
extract | Extract document fields | Required: options.fields (array of field names). CSV + JSON. | 1 |
transactions | Bank statements to CSV | CSV + JSON with source metadata.Fields: booking_date, description, counterparty, amount, currency, balance, reference | 1 |
actions | Extract tasks and deadlines | CSV + JSON with source metadata.Fields: task, owner, due_date, evidence | 1 |
redact | Mask personal data in text | Draft masked text in Markdown + JSON. Original files and metadata are unchanged. | 1 |
check | Check document requirements | Required: options.rules (up to 10 requirements). Section findings in CSV + JSON.Fields: requirement, finding, evidence | 1 |
generate-markdown | Files to Markdown | Extracted 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
- Calculate the full SHA-256 digest and byte length of each file. Send the JSON below to
POST /public/file-tools/signwith your key andContent-Type: application/json. - The response contains
jobIdand an ordereduploadsarray. 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. - 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. - Poll
GET /public/file-tools/{jobId}every few seconds untilcompleted,failedorexpired. A completed batch can contain failed sources: inspect everyresult.sources[].status. - For a completed batch, GET
/public/file-tools/{jobId}/downloadand download itsdownloadUrl. 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
| Method | Path | Purpose |
|---|---|---|
| GET | /public/file-tools | List tools and their credit cost |
| GET | /public/file-tools/allowance | Read used, reserved and available monthly allowance |
| POST | /public/file-tools/sign | Create a batch and receive one signed PUT URL per input |
| POST | /public/file-tools/{id}/start | Reserve 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}/download | Get 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.