Data template

Structured data extraction prompt template

Extract fields from free text into a strict JSON object. Turning semi-structured documents such as invoices, receipts, or forms into records your code can parse without cleanup.

The prompt

prompt.md
## Task
Extract the invoice fields from the document below.

## Requirements
- Use null for any field that is not present; do not infer values.
- Dates must use the YYYY-MM-DD format.
- Amounts must be numbers without currency symbols.

## Output format
Return only valid JSON with the keys invoice_number, issue_date, due_date, vendor_name, total_amount, and currency.

## Input
<document>
{{document}}
</document>

Variables

VariableWhat to pass in
{{document}}The document text, for example OCR output or text extracted from a PDF.

Each variable sits inside its own tags so the model treats what you insert as data, not instructions.

How it scores

100/100 with no warnings or critical issues, checked in CI on every change.

DimensionScore
Clarity100
Specificity100
Completeness100
Structuren/a
Consistency100
Output specification100
Efficiency100
Security100

Tokens and cost per model

Input tokens for the template itself, before you fill in the variables. Costs use the list prices in the model catalog, each dated with when it was last verified; confirm with your provider.

ModelTokensInput cost / 1,000 calls
GPT-4.192 $0.1840
GPT-4.1 mini92 $0.0368
Claude Sonnet 5.592 (approx.)$0.1840
Claude Haiku 4.592 (approx.)$0.0920
Gemini 2.5 Flash92 (approx.)$0.0276

Adapting it

After editing, the workspace re-scores the prompt as you type and flags anything that regresses.

More templates