Cost Optimization

Syntax-Level Optimization: Prompts for Machines — Skip the Formatting

Formatting tokens can account for up to 13–20% of prompt length. Prompts are instructions for machines, not documents for humans. Those **bold** markers, JSON braces, and indented newlines… are all money spent on formatting.

Four Optimization Strategies
Format Comparison Demo
YAML vs JSON: Same Data Structure
❌ JSON (High Token Usage)

        
✅ YAML (Saves Tokens)

        
💡 Real measurement: In Lyra's prompts, ** bold symbols alone consumed 8.5% of tokens. Including lists, headings, and JSON formatted indentation, total formatting tokens reached 13%. At tens of millions of calls, 20% of the monthly budget is spent on "making it readable for product managers."