Acme Co, invoice INV-2041, total $1,240.00, due November 30
{ "vendor": "Acme Co", "invoice": "INV-2041", "total": 1240.00, "due": "2026-11-30" }
Where extraction usually starts
Most teams extract fields by asking a frontier model to “return valid JSON”, then add retries for answers that don’t parse and checks for fields that go missing. Every document pays frontier prices. A specialist returns your fields, in your shape, on every call.
How it works
- Describe the job. List the fields and paste a few real documents as text: “From each invoice, return vendor, invoice number, total and due date.”
- Agree on what good looks like. Facet writes plain statements of a good answer, like “totals are numbers without currency symbols” or “dates use year, month, day”, each with examples. Edit any that are off.
- Create, then correct. Facet builds the specialist on its own, usually in about half an hour, and checks it against every statement before it goes live. When a field comes back wrong, say what should change. Facet quotes the fix before it spends anything.
Three ways to use it
- In the app: sign in, describe the fields, and choose Create.
- From your agent: connect Claude, Cursor, ChatGPT, Codex or VS Code to Facet, then paste:
Use Facet to build a specialist that reads invoice text and returns vendor, invoice
number, total and due date as JSON. Here are five real invoices: ... Show me the draft
and the price before you approve anything.
- In your code: keep your OpenAI SDK and change two lines, the address and the model name.
import os
from openai import OpenAI
client = OpenAI(base_url=os.environ["FACET_BASE_URL"], api_key=os.environ["FACET_API_KEY"])
reply = client.chat.completions.create(model="invoice-fields", messages=[{"role": "user", "content": invoice_text}])
Why a specialist for extraction
- The same shape every time. You define the fields once; every answer comes back in that shape, ready for your database.
- Checked before every update. A new version goes live only after it passes every statement you agreed on, and any update rolls back in one step.
- Fast and low cost. A Facet specialist does one job, so it answers faster than a frontier model, and every build shows its price before it starts.
- Yours. Export it any time, free, and run it wherever you like.
Questions
Can Facet read PDFs or scanned images?
Facet reads text today. For a PDF or a scan, turn it into text first with any text extraction tool, then send the text to your specialist.
What happens when a field isn't in the text?
You decide. Write a rule such as "leave the due date empty when none is given", and Facet checks every version of your specialist against it before it goes live.
Can I add fields later?
Facet can add a field to a specialist, quoting the change before it builds it, but renaming or removing a field means starting a new specialist, so the apps already calling it never break.