
Your AI Doesn't Need to Read the Whole API Spec. We Tested 6.
When you ask an AI to help you use a service like Stripe or GitHub, it often needs that service's API spec. An API spec is the full technical manual that lists every request the service accepts. For big services, that manual is enormous, and your AI usually needs only a few entries from it.
AI models read and charge by the token, a small chunk of text that is often part of a word. More tokens means a bigger bill.
Our tool, API Spec Digest, reads the spec for your AI and hands back only the part it asked about. We tested it on 6 real specs. The median result was 99.9% fewer tokens, and every answer listed the right endpoints. It costs about 2 cents (24 sats) per call.
What's in an API spec?
A spec lists every endpoint, which is one address in the API that does one job, such as "create a payment" or "list reviews on a pull request." For each endpoint, it also describes every input and every possible reply in detail.
That detail adds up quickly. GitHub's spec has 1,242 endpoints and is about 2.6 million tokens long. That is far more than most AI models can read at once, so an AI either gives up on the spec or searches through it in pieces.
API Spec Digest gives your AI a short table of just the endpoints that match its question. Each row shows the method, the path, the endpoint's name, a one-line summary, the required inputs and the type of reply. The digest also includes the API's name, server address and sign-in method.
The results
We gave API Spec Digest one real task for each spec, such as "create a payment intent with Stripe." We then counted the tokens in the raw spec and in the digest it returned.
| Spec | Task | Raw spec (tokens) | Digest (tokens) | Fewer tokens |
|---|---|---|---|---|
| Stripe | Create a payment intent | 1,410,570 | 542 | 99.96% |
| GitHub | Work with pull request reviews | 2,617,446 | 1,020 | 99.96% |
| Kubernetes | Manage Deployments | 972,562 | 1,137 | 99.88% |
| Twilio | Send a text message | 385,250 | 250 | 99.94% |
| Slack | Post chat messages | 126,108 | 494 | 99.61% |
| Petstore (a small sample spec) | List all endpoints | 3,812 | 576 | 84.9% |

Across all 6 specs, the median was 99.9% fewer tokens. Every one of the five large specs, which ranged from 126,000 to 2.6 million tokens, came back as a digest of about 250 to 1,140 tokens.
Here is what that means in dollars. On an AI model that charges $2 per million tokens of input, reading the GitHub spec once would cost about $5.23, if the model could hold it at all. The digest costs about a fifth of a cent to read, plus about 2 cents for the service. The Stripe spec would cost about $2.82 to read raw, and the Twilio spec would cost about $0.77.
Smaller is only useful if it is right, so we checked. In all 6 cases, the number of endpoints the digest found matched our own count of the same spec. We also spot-checked the names, summaries and paths in the Stripe, Twilio and Kubernetes digests, and all of them were correct. For example, the Stripe digest correctly listed "Create a PaymentIntent" at POST /v1/payment_intents.
Does it actually save you money?
For big specs, yes, by a wide margin. On a $2 model, API Spec Digest pays for itself once it saves about 10,000 tokens. Each of the five large specs saved more than 125,000 tokens on a single call.
For small specs, it saves less. The Petstore sample spec is only 3,812 tokens long. The digest still cut it by 84.9%, but the raw spec costs well under a cent to read. For a spec that small, your AI can simply read the whole thing, and API Spec Digest is mainly worth it for the tidy table.
In short, it pays most when the spec is big, when your AI uses a mid-priced or premium model, or when the full spec would not fit in your AI's memory at all.
How to use it
- Add Amazap to Claude or another AI app at amazap.com/mcp. (MCP is a standard way to plug tools into AI apps.)
- Ask a question about an API, such as "How do I create a payment intent with Stripe?"
Your AI gives API Spec Digest a link to the spec. It can also narrow the results with a tag (a group of endpoints, such as "pulls"), the start of a path (such as /v1/payment_intents), a search word, or a maximum size for the reply. You see the price in sats before you pay: about 2 cents (24 sats) per call. If a paid call fails, the price goes back to your balance as credit. To learn how AI agents pay for tools like this, see agentic payments on Amazap.
How we tested
- Specs: 6 public specs: Stripe, GitHub, Kubernetes, Twilio, Slack and the Petstore sample spec. They included both JSON and YAML formats and ranged from 3,812 to 2,617,446 tokens.
- Tasks: one task per spec. We used a path start for Stripe and Slack, a tag and search word for GitHub, a path start and search word for Kubernetes, a search word for Twilio, and no filter for Petstore.
- Counting: OpenAI's cl100k_base tokenizer, counted on the raw spec and on the digest table. Other models count a little differently, so exact costs vary. The reply also carries the same list in a structured form for software. Counting that too, the median was still 99.8% fewer tokens.
- Checking: we parsed each spec ourselves and compared endpoint counts, and we spot-checked names, summaries and paths on three specs.
- Price: 24 sats per call, about $0.02 on the test date. The service is
amazap-basics-api-spec-digest. - Date: 2026-10-13.
- Full data: api-spec-digest-benchmark.csv.
See also: the Log Squeezer benchmark.
FAQ
Why are API specs so expensive for an AI to read?
A spec describes every endpoint of a service in full detail. In our test, the large specs ran from about 126,000 to 2.6 million tokens, while the part needed for one task was usually under 1,200 tokens.
How much can API Spec Digest save?
On 6 real specs, the median was 99.9% fewer tokens. On a $2-per-million-token model, reading GitHub's spec once would cost about $5.23, while the digest costs about a fifth of a cent to read plus about 2 cents for the service.
Does it get the endpoints right?
Yes, in our test. In all 6 cases, the number of endpoints it found matched our own count, and our spot checks of names, summaries and paths were all correct.
Is it worth it for a small spec?
Usually not on price alone. A small spec like Petstore, at 3,812 tokens, costs well under a cent to read in full. The digest still cut it by 84.9%, so it is mainly worth it there for the tidy table.
How much does API Spec Digest cost?
About 2 cents (24 sats) per call. The price is set in dollars, so the sats amount follows the bitcoin rate. That is the full price, and you see it before you pay.