Document AI API reference.
Quickstart, authentication, endpoint reference, and async patterns for Extraction, Extraction Pro, and Document Analysis.
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
pip install abscode
3. Make your first call
from abscode import DocumentAI client = DocumentAI(api_key="abs_sk_...") result = client.extraction.basic( file="path/to/invoice.pdf", document_type="invoice" ) print(result.fields) # {'invoice_number': 'INV-2026-001', 'total': 12450.00...}
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 -X POST https://api.abscode.com/v1/extraction/basic \ -H "Authorization: Bearer abs_sk_..." \ -F "file=@invoice.pdf" \ -F "document_type=invoice"
Rate limits
Every plan has a fair-use throughput limit, and higher plans get more headroom. The limits are generous enough that normal application traffic never touches them; they exist to stop runaway automation. Your current limit is shown in your portal and returned in the API response headers, so your code can pace itself. If you have a large batch to process, use the asynchronous Jobs API — it queues your documents and works through them as capacity allows, rather than turning requests away.
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.
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_request | Bad parameter, malformed file, unsupported format |
| 401 | invalid_api_key | Missing or revoked key |
| 402 | credit_limit_reached | Credit limit hit. Body carries usage, the limit, and a raise-limit URL — raise the limit or commit to a monthly minimum in one click |
| 402 | service_suspended | Account suspended after unresolved payment failure. Configuration, keys and data are retained; service restores on payment |
| 403 | feature_not_in_plan | Document Analysis attempted on pay-as-you-go or the free trial — it requires a committed plan |
| 413 | file_too_large | File above the per-call size limit |
| 429 | rate_limited | Slow down, see Retry-After header |
| 500 | server_error | Transient, retry with exponential backoff |
Extraction · POST /v1/extraction/basic
Pricing: 1 credit 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. The endpoint path keeps /basic for backwards compatibility; the product name is Extraction.
Request
| Param | Type | Notes |
|---|---|---|
file | multipart | PDF, TIFF, JPG, PNG (required) |
document_type | string | e.g. invoice, bank_statement, receipt, kyc, payslip |
schema | object | Optional override of the default field schema |
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: 2 credits per page
Everything in Extraction, 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).
{
"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: 2.5 credits per page · committed plans only
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. Not available on pay-as-you-go or the free trial — calls without a committed plan return 403 feature_not_in_plan.
How it works
Discovery call → estimate in rule-configuration blocks → rule configuration on your sample document set → sandbox endpoint → production integration → ongoing tuning. Pre-configured rule packs have no setup fee; custom rules are configured in 20-hour blocks, quoted after a free discovery call. Learn more →
OCR Full Text & Aadhaar Masking — on-premise
Plain OCR and Aadhaar masking are not offered as cloud APIs. Both are available as part of our on-premise deployment — searchable-PDF OCR at volume, and UIDAI-compliant Aadhaar redaction inside your own environment. Read about the on-premise option or talk to sales.
Jobs API (async)
For multi-page documents, batches, or any workload where synchronous response time matters less than throughput, use the async pattern. The api field accepts extraction.basic, extraction.pro or analysis.run:
# 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.
{
"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
| SDK | Latest | Package |
|---|---|---|
| Python | 1.0.0 | abscode |
| Node.js / TypeScript | 1.0.0 | @abscode/sdk |
| Java | 1.0.0 | com.abscode:sdk |
| .NET | 1.0.0 | Abscode.Sdk |
| Go | 1.0.0 | github.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.