Ed Grzetich Original Research 2026

Tokens Not Jokin'

How API Documentation Format Affects AI Code Generation

Every time an AI coding tool reads your API docs, the tool spends tokens. Does the format of those docs affect the number of tokens? The code quality? We ran over 21,000 integration tests across 4 AI models and 2 APIs to find out.

Available Now! Get the Book →
21,000 integration tests
4 AI models tested
4 doc formats compared

Your docs have two audiences now

Developers still read your API docs. But increasingly, AI coding tools read them first. Every token your documentation consumes is a token that can't be used for reasoning, code generation, or context about the user's project.

The question
How much?
Does format affect token cost? And if so, by how much?
Who's affected
Everyone
Any API whose docs are consumed by AI coding tools
What nobody's measuring
The cost of format
Teams measure doc readability and completeness. Almost nobody measures token efficiency or AI comprehension rates by format. This book changes that.

Get the findings first

Research updates, chapter releases, and documentation strategy insights. 1-2 emails per month. No spam.

The questions we tested

Which documentation format is most token-efficient for AI consumption?
We tested 4 formats head-to-head. The results are in the book.
Does format affect AI code generation quality, or just cost?
We measured both. The answer has implications for how you build docs.
Do bigger AI models handle all formats equally?
From local models you can run on a laptop to the largest cloud APIs.
Can you serve both humans and AI from a single doc source?
The book includes a framework for serving both humans and AI from a single documentation source.
How do you test your own docs for AI readiness?
Full testing toolkit and methodology included in the appendices.

Not opinions. Tests.

Built control APIs

Popular APIs are all over the internet, including in LLM training data. Testing with Stripe's docs means you might be measuring memorization, not comprehension. We built two control APIs from scratch to eliminate contamination.

Same APIs, four formats

Identical information documented in four different formats. Same endpoints, same parameters, same constraints. The only variable is how it's structured.

Tested across model sizes

From local models you can run on a laptop to frontier cloud APIs. Format impact changes with model capability.

Measured what matters

Token efficiency, code generation pass rates, error handling quality, and overall accuracy. Not just "does it work" but "how well, at what cost."

Research, framework, implementation

Part I

The Problem

The problem nobody's measuring. Why your doc format creates a hidden tax on every AI interaction with your API.

3 chapters
Part II

The Experiment

Over 21,000 integration tests. 4 formats. 4 models. 2 APIs. The complete results, with data on token efficiency, code generation quality, and error handling.

5 chapters
Part III + Appendices

The Framework

The decision framework. How to choose the right format for your team, test your own docs, and optimize without rewriting everything. Where documentation is heading. Plus the complete testing toolkit, the control API references in all formats, and everything you need to reproduce the research yourself.

7 chapters + 5 appendices

See what your docs cost

Paste your API documentation and see the token cost in real time. The first step to understanding the problem.

Try the Docs Cost Calculator →
Apr 15, 2026

What's Inside the Book?

A detailed look at the book's structure, the research included in each part, and the key takeaways for API teams.

Mar 31, 2026

The Book Is Here

After several months and 21,000+ integration tests, Tokens Not Jokin' is here.

Mar 2, 2026

How I Built a Contamination-Free API to Test AI Doc Formats

If you test how well AI tools use Stripe's API docs, how do you know what you're measuring? Here's how I solved the contamination problem.

Feb 21, 2026

The Problem Nobody's Measuring

Your company tracks API latency, uptime, and error rates. But nobody's tracking what it costs AI tools to read your API documentation.

Get the findings

Available now on Leanpub

Available on Leanpub. All formats: PDF, EPUB, and web.

Get the research updates

New findings, chapter releases, and documentation strategy insights. No spam, no fluff.

Ed Grzetich

Independent researcher studying how API documentation format affects AI code generation. Building MCP servers that bridge REST APIs and conversational AI interfaces. 15+ years in technical documentation across defense (General Dynamics/NASA), fintech (Mastercard), and cloud computing (AWS). Presented "Making Data Conversational: Building MCP Servers as API Bridges" at AI in Fort Wayne.