DOCUMENTATION · DOCUMENT AI APIs

Document AI API reference.

Quickstart, authentication, endpoint reference, and async patterns for OCR, Aadhaar Masking, Extraction Basic + Pro, and Document Analysis.

Other docs: Scanning SDK · Compression SDK · Docs home

Quickstart

From signup to first API call in 5 minutes. Pick a language SDK or use REST directly.

1. Get an API key

Go to abscode.com/signup. No credit card required. You'll receive free trial credit and an API key immediately.

2. Install the SDK

python
node.js
java
pip install abscode

3. Make your first call

python
from abscode import DocumentAI

client = DocumentAI(api_key="abs_sk_...")

result = client.ocr.extract(
    file="path/to/document.pdf"
)

print(result.text)
print(result.confidence)

Authentication

All API calls require an API key passed in the Authorization header. Keys are issued in the portal and can be rotated at any time.

Key format

API keys start with abs_sk_ (live) or abs_test_ (sandbox). Never expose live keys in client-side code — use a server-side proxy for browser and mobile contexts.

curl
curl -X POST https://api.abscode.com/v1/ocr/extract \
  -H "Authorization: Bearer abs_sk_..." \
  -F "file=@document.pdf"

Rate limits

Per-account rate limits prevent runaway costs and protect fair-use for all customers. Scale with your top-up pack.

PackRequests/secConcurrentBurst
Free trial2 req/sec410
Mini Pack +10 req/sec2050
Starter Pack +30 req/sec60150
Growth Pack +60 req/sec120300
Scale Pack200 req/sec4001000
EnterpriseCustomCustomCustom

Rate-limit headers on every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Error codes

All errors return a JSON body with code, message, and request_id.

HTTPCodeMeaning
400invalid_requestBad parameter, malformed file, unsupported format
401invalid_api_keyMissing or revoked key
402insufficient_creditWallet credit exhausted — top up to continue
413file_too_largeFile above the per-call size limit
429rate_limitedSlow down — see Retry-After header
500server_errorTransient — retry with exponential backoff

OCR Full Text · POST /v1/ocr/extract

Pricing: flat per-page

Extract every word from PDFs, TIFFs, scanned images, and photos. Returns raw text, per-page confidence, and an optional searchable PDF overlay.

Request

ParamTypeNotes
filemultipartPDF, TIFF, JPG, PNG (required)
languagesstring[]e.g. ["en", "hi", "ta"] — defaults to auto-detect
output_searchable_pdfbooleanIf true, returns URL to PDF with text overlay
asyncbooleanIf true, returns a job_id instead of inline result

Example

python
result = client.ocr.extract(
    file="document.pdf",
    languages=["en", "hi"],
    output_searchable_pdf=True
)

print(result.text)
print(result.searchable_pdf_url)

Aadhaar Masking · POST /v1/aadhaar-masking/redact

Pricing: flat per-page

Availability: India only.

UIDAI-compliant automatic Aadhaar number redaction. Detects 12-digit Aadhaar patterns and QR code regions across documents. Output preserves the original document layout.

Request

ParamTypeNotes
filemultipartPDF, TIFF, JPG, PNG (required)
asyncbooleanFor large multi-page KYC bundles
python
result = client.aadhaar_masking.redact(
    file="customer_kyc_pack.pdf"
)

print(result.masked_pdf_url)
print(result.redactions_count)

Extraction Basic · POST /v1/extraction/basic

Pricing: flat per-page

Pre-trained extraction for invoices, bank statements, receipts, KYC forms, contracts, payslips, lab reports, and ID documents. Returns named fields with bounding boxes.

Request

ParamTypeNotes
filemultipartPDF, TIFF, JPG, PNG (required)
document_typestringe.g. invoice, bank_statement, receipt, kyc, payslip
schemaobjectOptional override of the default field schema
python
result = client.extraction.basic(
    file="invoice.pdf",
    document_type="invoice"
)

print(result.fields)
# {'invoice_number': 'INV-2026-001', 'total': 12450.00, ...}

Extraction Pro · POST /v1/extraction/pro

Pricing: flat per-page

Everything in Extraction Basic, plus per-field confidence scores, format validation (GSTIN, IFSC, PAN, Aadhaar VID, IBAN), and cross-field guardrails (invoice total reconciles, bank statement balances, date plausibility).

response.json
{
  "invoice_number": { "value": "INV-2026-0017", "confidence": 0.99 },
  "vendor_gstin": { "value": "27AAAAA0000A1Z5", "confidence": 0.94,
    "validation": "passed", "check_digit": "verified" },
  "total_amount": { "value": 12450.00, "confidence": 0.97,
    "reconciles_with_line_items": true },
  "guardrails": { "all_passed": true, "warnings": [] }
}

Document Analysis · POST /v1/analysis/run

Pricing: Custom — contact sales for scoping

Rule-based intelligent document review — NDA gap analysis, contract compliance, regulatory filing validation, policy adherence checks. Rules are codified per use case during onboarding, then exposed as an endpoint scoped to your account.

How it works

Discovery call → rule configuration on your sample document set → sandbox endpoint → production integration → quarterly rule tuning. Most engagements ship within 4–6 weeks. Learn more →

Jobs API (async)

For multi-page documents, batches, or any workload where synchronous response time matters less than throughput, use the async pattern:

python
# 1. Create job
job = client.jobs.create(api="extraction.basic")

# 2. Upload one or more documents
client.jobs.upload(job.id, file="batch_001.pdf")

# 3. Poll or receive webhook
status = client.jobs.get(job.id)

Webhooks

Register a callback URL in the portal. We POST job.completed events with a signed payload (HMAC-SHA256). Retry policy: exponential backoff for 24 hours.

webhook payload
{
  "event": "job.completed",
  "job_id": "job_01HZ...",
  "api": "extraction.basic",
  "result_url": "https://api.abscode.com/v1/jobs/job_01HZ.../result",
  "timestamp": "2026-06-08T05:21:11Z"
}

Server SDKs

SDKLatestPackage
Python1.0.0abscode
Node.js / TypeScript1.0.0@abscode/sdk
Java1.0.0com.abscode:sdk
.NET1.0.0Abscode.Sdk
Go1.0.0github.com/abscode/go-sdk

This is a docs landing page

Full documentation will include interactive API explorers, request/response schemas, embedded sandbox per endpoint, OpenAPI / Swagger spec, and per-use-case tutorial guides. This page shows the structure and entry points.