Key facts
| Endpoint | POST https://api.plugsky.com/v1/chat/completions with JSON mode and an explicit schema |
| Compatibility | Same shape as OpenAI; change base_url and model name |
| Validation | Schema checks plus business rules; one corrective retry, then human review |
| Models | 30+ models; plugsky-micro and plugsky-lite handle uniform documents efficiently |
| Pricing model | Flat monthly self-serve plans with unlimited fair-use usage |
| Free tier | Free plan with 2 free AI models, no card required |
| Throughput | Bounded concurrency with idempotency keys; the batch endpoint is coming soon |
| Governance | Scoped keys and audit logs per extraction pipeline |
TL;DR
- JSON mode gives structure; your validators give correctness.
- Define nullability explicitly so missing data is visible.
- Retry once with the exact validation error, then queue for review.
- Make writes idempotent with a document hash key.
- Track per-field accuracy and straight-through processing, not aggregate accuracy.
How it works, step by step
- Change the base URL to Plugsky and confirm an existing structured-output request parses unchanged.
- Write the extraction schema with types, formats, allowed values and explicit nullability.
- Send the document with JSON mode and a concise instruction to extract only schema fields.
- Validate each field; on failure retry once with the exact validation error included.
- Flag low-confidence or unresolved fields and route them to a human review queue.
- Persist results with idempotency keys and monitor per-field accuracy on a golden set.
Original data
Try it yourself
Open the OpenAI-compatible API tester →
Architecture of an extraction service
Five parts around one call:
- Ingest: normalize the document, strip markup and keep page or section markers as provenance.
- Schema registry: versioned schemas per document type, including nullability and formats.
- Extractor: JSON-mode call with the document, schema and a small number of examples.
- Validator: schema, format and business-rule checks, with one corrective retry.
- Review queue: flagged fields routed to humans with the source context attached.
Implementation details
Choices that prevent silent data corruption:
- Require explicit nulls for absent fields; an omitted key is indistinguishable from a parsing bug.
- Normalize formats in code — dates, amounts and identifiers — rather than trusting the model to standardize them.
- Keep examples minimal and representative; too many examples bloat prompts and bias extraction toward their formatting.
- Use a document hash as the idempotency key so retries and replays never duplicate records.
- Cap
max_tokensso an extraction cannot ramble into an essay about the document. - For long documents, extract per section and merge, rather than truncating the input.
Evaluation and limitations
Score fields, not documents:
- Per-field precision and recall: a 99% document-level score can hide a failing critical field.
- Formatted-value accuracy: exact match for dates, currencies and identifiers.
- Invalid-output rate: schema failures per thousand documents.
- Review yield: reviewer agreement with flagged items — calibration for your thresholds.
- Straight-through processing: share of documents requiring no human touch.
Limitations: no correctness guarantee without validation and review, scanned inputs need OCR first, schema changes require re-evaluation, long documents exceed context limits if you do not section them, and the batch endpoint is coming soon — bulk runs today need queueing, concurrency limits and retries.
Honest comparison
| Capability | Extraction on Plugsky API | Hosted document AI service | Custom NER models |
|---|---|---|---|
| Setup | Schema plus prompt in your stack | Vendor document models | Labeling and training |
| Flexibility | Any field set you define | Prebuilt document types | Depends on training data |
| Validation | Your code, one corrective retry | Vendor confidence APIs | Model metrics |
| Integration | OpenAI-compatible call | Service SDK | MLOps pipeline |
| Cost shape | Flat monthly self-serve, unlimited fair use | Per-page pricing | Engineering and GPU time |
Frequently asked questions
How does JSON mode help extraction?
It constrains the response to a schema so your parser receives structured fields rather than prose, which removes most post-processing and retry logic.
What should happen when a field is missing?
Return an explicit null with a confidence marker and validate downstream. Silent omission hides data problems.
How many retries should I allow?
One corrective retry with the exact validation error, then route to review. More retries add latency without new information.
How do I process documents in bulk?
The batch endpoint is coming soon. Today, run a queue with bounded concurrency, idempotency keys and backoff, and store failures for reprocessing.
Which model is best for extraction?
Uniform documents run well on plugsky-micro or plugsky-lite, while messy or ambiguous documents may benefit from a stronger alias. Benchmark per document type.
Can extraction drive automated decisions?
Only with validation and review gates. Keep irreversible actions behind a human or a rule-based check until field accuracy is proven over time.
Can I try extraction for free?
Yes. JSON mode is live, the free plan includes two free models with no card, and the 14-day full-access trial lets you evaluate stronger aliases on your documents.