xrays 76% Cost Reduction via Prompt Caching
Unit Economics X-Ray: The True Margin of AI Automation Workflows
· Verified via AutoLayered Claude Eval Harness
Exposing the Margin Compression Trap
Most AI builders calculate gross margin using a single-turn prompt estimate. In production, multi-turn agentic loops re-send 15,000 to 40,000 tokens of system instructions, tool definitions, and RAG context on every step—destroying unit economics at scale.
Telemetry Across 500,000 Agent Runs
Our X-Ray simulator modeled a B2B document-verification and extraction pipeline running 500,000 jobs/month:
| Architecture Pattern | Monthly Input Tokens | Monthly API Spend | Gross Margin (at $0.05/job) |
|---|---|---|---|
| Naive Uncached Loop | 6.2 Billion | $18,600 | 25.6% |
| Anthropic Prompt Caching + Batch API | 6.2 Billion (85% Cache Hit) | $3,410 | 86.3% |
Key Takeaway
Structuring static system prompts, JSON schemas, and few-shot examples at the top of the context window with cache_control: {"type": "ephemeral"} on Claude APIs is the single highest-leverage architectural change for AI-native startups.
Reproduce This Benchmark
Want to run our adversarial Claude Eval Harness against your own RAG or automation pipeline?