Use Cases + Implementation

How do you build OCR workflows with an OpenAI-compatible API?

An OpenAI-compatible API slots into an OCR pipeline after the text is extracted: keep your SDK, point it at api.plugsky.com, and use JSON mode to turn OCR text into typed field records. Validation and filing run as function-call tools, so an existing document workflow gains structured extraction without new integrations or a new client library.

Key facts

API compatibilityDrop-in /v1/chat/completions with JSON mode and function calling (live)
Extraction outputJSON mode for typed field records with source references
ValidationFunction-calling tools for totals, dates, identifiers and duplicates
Models30+ models behind one endpoint, route extraction and reconciliation separately
MigrationBase URL and model-name change; OCR engine and pipelines stay as they are
PricingFlat monthly plans with unlimited fair-use usage on self-serve
OCRDedicated OCR engine in your pipeline; image endpoints are coming soon
Free tierplugsky-micro and plugsky-lite on the free plan, no card required

TL;DR

  • Keep the OCR engine; change the model client and add structured extraction.
  • Use JSON mode for field records with source references and confidence.
  • Validate arithmetic, identifiers and duplicates in tools, not in the model.
  • Route exceptions to a review queue with the source page attached.
  • Evaluate on labelled documents and re-run when templates change.

How it works, step by step

  1. Centralise the model client so base URL, key and model names come from configuration.
  2. Keep OCR output intact — text, page numbers and confidence — as the input to extraction.
  3. Define JSON schemas per document type with fields, types, required flags and source references.
  4. Set the client to https://api.plugsky.com/v1 and map extraction and reconciliation tasks to different models.
  5. Implement validation tools and run them on every extracted record before filing.
  6. Run a shadow batch over labelled documents and compare field accuracy and exception routing with the current process.
  7. Cut over behind a flag, monitor correction rates, and keep the previous provider path for rollback.
1Centralise themodel client sobase URL, key and2Keep OCR outputintact — text, pagenumbers and3Define JSON schemasper document typewith fields, types,4Set the client tohttps://api.plugsky.com/v1and map extraction5Implementvalidation toolsand run them on6Run a shadow batchover labelleddocuments and

Try it yourself

Open the JSON schema validator for LLM tools →

Where compatibility fits an OCR pipeline

OCR workflows already have an engine that produces text; what they often lack is structured extraction and reliable validation. That is exactly what an OpenAI-compatible endpoint provides: JSON mode to turn text into typed records, function calling to run checks, and streaming for interactive tools. No new SDK, no bespoke response parsing.

Plugsky's chat completions endpoint is live with JSON mode and function calling. Image generation and files endpoints are coming soon, so keep OCR and bulk document handling in your pipeline and use the model layer for understanding the text.

Structured extraction and validation

Define a schema per document type and demand strict output: values, types, source references and a per-field confidence. Then validate in code. Rejecting malformed records is better than repairing them, because a silently corrected field is an unauditable edit to a financial or legal record.

  • Arithmetic: recompute totals, tax and line items and compare with printed values.
  • Identifiers: validate tax numbers and account codes with checksum or master-list tools.
  • Duplicates: check document number plus amount plus date before filing.
  • Provenance: store the OCR page reference on every field for reviewer verification.

Scale, review and exceptions

Volume work suits tiered routing: small models for straightforward extraction, stronger models for ambiguous layouts and reconciliation. With 30+ models behind one endpoint, changing the routing for one document type is a configuration edit. Keep batch processing in your own scheduler; the files and batch endpoints are coming soon.

Build the review queue as a first-class part of the system, not an afterthought. Reviewers should see the source page beside the extracted fields and be able to correct, accept or reject in one pass; their corrections become evaluation data. Track straight-through rate and field-level accuracy per document type, re-evaluate when templates or suppliers change, and deploy in a region that satisfies your document handling policy, including on-prem when scans cannot leave the network.

Honest comparison

AspectPlugskyStaying on OpenAITemplate OCR tools
Client changeBase URL and model namesNoneVendor-specific
Structured outputJSON mode with source referencesAvailableTemplate-bound
ValidationFunction-calling tools in your codeSame patternLimited rules
AdaptabilityNew layouts via prompts and schemasSameTemplate rework
PricingFlat monthly with unlimited fair use on self-servePer-tokenPer-page or seat

Frequently asked questions

Do we still need an OCR engine?

Yes. Plugsky does not provide a live OCR endpoint. Keep your engine, then use the compatible chat endpoint for structured extraction, validation and routing. Image endpoints are coming soon.

Why JSON mode instead of free text?

Typed records feed downstream systems directly and can be validated field by field. Free text requires parsing, which reintroduces the ambiguity you are trying to remove.

How do we stop bad records being filed?

Validate every field against schema and business rules, and file only records that pass. Send failures to a review queue with the source page rather than correcting them automatically.

Can different document types use different models?

Yes. Route simple invoices to small models and complex contracts to stronger ones. 30+ models sit behind one endpoint, so routing is per-type configuration.

Is streaming useful here?

For interactive review tools, yes — reviewers see extraction progress. Batch processing does not need streaming and can run with lower overhead.

How do we start without disrupting the current process?

Shadow-run the new extraction on labelled documents in parallel, compare field accuracy and exception routing, then cut over behind a flag with rollback in configuration.

Can it run on-prem?

Yes. Plugsky supports region-locked cloud planes plus VPC, on-prem and air-gapped deployment, so scanned documents can remain inside your network.