Skip to main content

Base URL

All API requests are made to:
https://platform.aifano.com

Authentication

Every request requires a Bearer token in the Authorization header:
Authorization: Bearer ak_live_your_api_key_here
API keys are created in the Aifano Studio under Settings → API Keys. See Authentication for details.

Request Format

All endpoints accept JSON request bodies with Content-Type: application/json:
curl -X POST "https://platform.aifano.com/parse" \
  -H "Authorization: Bearer $AIFANO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "https://example.com/document.pdf"}'

Response Format

Responses are JSON with a consistent structure. Successful responses include:
{
  "job_id": "job_abc123",
  "duration": 2.34,
  "usage": {
    "num_pages": 5,
    "credits": 5
  },
  "result": { ... }
}
Error responses include an error field:
{
  "error": "Description of what went wrong"
}
See Response Format and Error Codes for details.

Endpoints Overview

Document Processing

MethodEndpointDescription
POST/parseParse a document into structured JSON
POST/parse_asyncParse a document asynchronously
POST/extractExtract structured data using a JSON schema
POST/extract_asyncExtract data asynchronously
POST/splitSplit a document into logical sections
POST/split_asyncSplit a document asynchronously
POST/editEdit or fill forms in a document
POST/edit_asyncEdit a document asynchronously

Pipelines

MethodEndpointDescription
POST/pipelineRun a pipeline on a document
POST/pipeline_asyncRun a pipeline asynchronously

Files & Jobs

MethodEndpointDescription
POST/uploadUpload a document to Aifano storage
GET/job/{job_id}Get the status and result of an async job
GET/jobsList all jobs for your organization
POST/cancel/{job_id}Cancel a running or pending job

Input Types

All processing endpoints accept a document reference via the input field:
Input TypeFormatExample
Public URLhttps://...https://example.com/doc.pdf
Presigned URLhttps://...?signature=...S3, GCS, Azure presigned URLs
Aifano referenceaifano://...aifano://abc123.pdf
Job referencejobid://...jobid://job_abc123

SDKs & Libraries

Python

pip install aifano

JavaScript / TypeScript

npm install @aifano/sdk
SDKs are coming soon. In the meantime, use the REST API directly with any HTTP client.

Need Help?