Document extraction,
without the token bill.
Create a reusable processor from examples, then turn documents into validated JSON through one stable API.
https://decomp.shubhambadgujar.com/v1Authentication
Create test or live secret keys in the signed-in dashboard and send one as a bearer token. Keep keys in your backend only.
Authorization: Bearer sk_live_xxxxx1. Create a template
Send 1–5 PDF, image, or text samples as multipart form data. Each sample may be up to 15 MB.
curl -X POST https://decomp.shubhambadgujar.com/v1/templates \
-H "Authorization: Bearer $DECOMP_API_KEY" \
-F "name=Vendor invoice" \
-F "documents=@sample-1.pdf" \
-F "documents=@sample-2.pdf" \
-F "documents=@sample-3.pdf"{
"template_id": "tpl_q7h2k9m4",
"job_id": "job_4f2a8d1c",
"status": "processing"
}2. Poll the job
Template generation is asynchronous. Poll until its status becomes completed or failed.
GET /v1/jobs/job_4f2a8d1c3. Extract a document
Send multipart field document, JSON text, or document_base64. Documents may be up to 20 MB. Extraction runs OCR, deterministic extractors, consensus, and validation without LLM inference.
POST /v1/templates/tpl_q7h2k9m4/extract{
"success": true,
"data": {
"invoice_number": "INV-2048",
"total": 18420
},
"confidence": 0.991,
"credits_used": 1
}Template lifecycle
GET /v1/templates
GET /v1/templates/{id}
POST /v1/templates/{id} # retry a failed template
DELETE /v1/templates/{id}Deleting a template also removes its samples, jobs, and extraction history.
Credits and keys
GET /v1/credits
GET /v1/api-keys # dashboard session
POST /v1/api-keys # dashboard session
DELETE /v1/api-keys/{id} # dashboard sessionCosts and request limits are controlled by the administrator. A 429 response means the configured per-minute limit was exceeded.
Errors
Every error has a stable machine-readable code and a safe human-readable message. Failed processing operations automatically return charged credits.
{
"error": {
"code": "insufficient_credits",
"message": "100 credits are required; 42 are available."
}
}