AI Tools
AI Extract Data
Pull structured JSON out of a PDF — using a built-in preset (invoice, receipt, resume), your own JSON schema, or a fully automatic “all salient fields” pass. A premium vision engine reads the page image directly for degraded scans.
PRO / ENTERPRISE only 100 credits / callAI vision: 200 / callSynchronous
Overview
Upload a PDF; the extracted data comes back inline as JSON (no download URL). The model is instructed to use null for absent fields — it never invents values.
POST
https://api.bytefuse.in/api/v1/ai/extract-dataPaid plans only
Requires a PRO or ENTERPRISE plan — anonymous →401, free-tier → 403.Request
Content type multipart/form-data:
filefilerequiredThe PDF to read (must end in
.pdf, else 415).presetstringoptionalinvoice, receipt or resume selects a built-in field map. Blank or unknown means “extract all salient key/value fields”. Ignored if schema is supplied.Default: autoschemastring (JSON)optionalA JSON schema / field map as a JSON string. If present it must parse as JSON (else
422) and overrides preset.Default: noneenginestringoptionalauto (text/OCR → LLM) or vision (reads the page image). Any other value → 422.Default: autoEngines & pricing
Billed per call, flat, regardless of page count:
ConditionCost / call
engine=auto (default) — text/OCR then LLMai.extract100engine=vision — reads the first ≤3 pages as an imageai.extract.ai200Vision billing & fallback
engine=vision wins on degraded/photographed scans where OCR garbles numbers. It’s billed the 200-credit vision rate based on the engine you requested — even if it internally falls back to the text path, the charge stands (though the response engine field reports the path that actually ran). If AI vision isn’t configured, the call returns 422.Response
200 OK, application/json:
200 OK
{
"success": true,
"data": { "invoice_number": "INV-1042", "total": 980.00, "line_items": [ … ] },
"credits_charged": 200,
"engine": "vision",
"preset": "invoice",
"had_schema": false,
"parsed_ok": true,
"processing_time_ms": 4501
}dataobject | arrayoptionalThe extracted JSON. If the model output couldn’t be parsed, this is
{ "_unparsed": "<raw text>" } (still a 200 — see parsed_ok).enginestringoptionalThe path that actually produced the data —
vision or auto (a vision request that fell back reports auto).presetstring | nulloptionalEcho of the requested preset.
had_schemabooloptionaltrue if a custom schema was supplied.parsed_okbooloptionaltrue if data is valid parsed JSON; false for the _unparsed fallback.credits_chargedintoptional100 or 200. Mirrors X-Credits-Charged.Examples
curl -X POST https://api.bytefuse.in/api/v1/ai/extract-data \
-H "X-API-Key: dt_live_your_key" \
-F "file=@invoice.pdf" \
-F "preset=invoice" \
-F "engine=vision"Errors
401Anonymous / no valid credential.
403Free-tier account — AI tools need PRO or ENTERPRISE.
415Missing filename or not a
.pdf.422
engine isn’t auto/vision, schema isn’t valid JSON, no extractable text, vision not configured, or a password-protected PDF.402 / 429 / 503Insufficient credits, rate limited, or capacity/config error.
500AI processing failed unexpectedly.
