API Documentation

Integrate InvoiceAI extraction into your applications

Authentication
Include your API key in the Authorization header of every request.
Base URL:https://api.invoiceai.dev/v1

API Keys

Production Key

iai_mock_sk_EXAMPLE_NOT_REAL_KEY_001

Nov 1, 2025active

Development Key

iai_mock_sk_EXAMPLE_NOT_REAL_KEY_002

Dec 15, 2025active

Old Integration Key

iai_mock_sk_EXAMPLE_NOT_REAL_KEY_003

Aug 20, 2025revoked
Endpoints
POST/v1/extract

Upload a PDF invoice and extract structured data using AI. The file should be sent as multipart form data.

cURL

curl -X POST https://api.invoiceai.dev/v1/extract \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@invoice.pdf"

JavaScript

const formData = new FormData();
formData.append('file', pdfFile);

const response = await fetch('https://api.invoiceai.dev/v1/extract', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
  body: formData,
});
const data = await response.json();

Response

{
  "success": true,
  "data": {
    "documentType": "invoice",
    "confidence": 0.97,
    "fields": [...],
    "lineItems": [...]
  }
}
Response Types
TypeScript interfaces for API response objects

Extraction Result

interface ExtractionResult {
  documentType: string
  confidence: number
  fields: ExtractedField[]
  lineItems: LineItem[]
  processingTime: number
  modelUsed: string
}

Extracted Field

interface ExtractedField {
  key: string
  label: string
  value: string
  confidence: number
  category: FieldCategory
}