Each line on the left is one support ticket. On the right, the parser turns it into a JSON object your application can use. Edit a value to see validation; “Inject errors” shows what gets rejected.
1 · AI response in .mini
2 · JSON for your application
Field rules and AI instructions
Contract signature
Prompt block for a generative model (EN)
Bloque de especificación para un modelo generativo (ES)
contract.json
Same tickets, three ways to write them. Tokens are billable pieces of text: a smaller bar means less response cost at the same model and rate. Instructions and retries are extra.
How much response text does AI write?
All formats and measurement details
TOON reference v4.1.1. Token counting: …. Response serialization only; generation quality and total API cost are not measured here.
See the same data in another format
Design your own contract: start blank or extend the sample, add fields, inspect the generated document and prompt, then download contract.json. To check a directory of contracts and fixtures later, run mini --forks DIR check-forks.
1 · Identity
2 · Fields
Invariant check
3 · Generated contract
Prompt block
Example document
Structure
prefix|n=12|key=value|key=a,b,c ← header (contract + count + metadata)
f1|f2|f3,f4*,f5|a,b,c|… ← one record per line, fields by position
list elements separated by ','
selected element ends with *
tuple = fixed comma-separated group
Escapes
\| literal vertical bar (everywhere) \\ literal backslash (everywhere) \n line break inside a value (everywhere) \, literal list separator (inside list elements) \* literal trailing asterisk (inside list elements)
Fork invariants
I1 one line = one valid record I4 new fields only at the tail I2 prefix and n are mandatory I5 fixtures must round-trip I3 inherited core never changes (breaking change ⇒ new prefix)
Error codes
| Code | Condition |
|---|---|
| E01 | no header |
| E02 | prefix ≠ contract |
| E03 | missing n |
| E04 | record count ≠ n |
| E05 | record arity outside core…core+extensions |
| E06 | type mismatch / required empty |
| E07 | list or tuple arity |
| E08 | marker rule violated |
| E09 | bad escape |
| E10 | enum violation |
| E11 | duplicate unique value |
| E12 | header entry malformed/missing |
| E13 | numeric range |
| E20/E21 | invalid contract / fork invariant |
Full specification: SPEC.md in the repository. Reference implementation: Python (src/minifmt) and TypeScript (ts/src); the engine of this page, js/mini.js, is generated from the TypeScript library and passes the conformance suite.