When you feed the model a uniform array of records, JSON repeats every field name, brace, and quote on every row. TOON declares the field names once in a header and emits bare value rows, so you pay for values, not for structure you already stated.
Serialize Uniform Tables as TOON, Not JSON
Unlock this tip โ and 50 more
This is one of 51 advanced, fact-checked tactics reserved for Pro. Get the full 73-tip library, a searchable archive, and a new tip every morning. Free for 7 days, then $9/mo.
Prefer to browse? The 22 Beginner tips are free forever.
More in Output Control
Return IDs and Enums, Not Sentences
For classification, routing, and selection tasks, have the model emit a short code, ID, or enum value instead of a polite sentence. The downstream code only needs the token, not the prose around it.
Strip the Preamble: Ask for the Answer Only
Chat models love to restate your question, add caveats, and offer follow-ups. On high-volume tasks those wrapper tokens dominate the bill. Tell the model to return only the payload.
Set max_tokens as a Hard Cost Ceiling, Not an Afterthought
Output tokens are the expensive half of most API bills. Setting an explicit max_tokens on every API call turns an open-ended cost into a known maximum.