Guide

How can an AI agent find, try and pay for an AI API on its own?

Short answer: An agent finds an API through llms.txt, the MCP Registry, OpenAPI files and package registries; checks models, prices and readiness from a JSON list such as /v1/models; asks its person before spending; stays inside a per-key limit it can read; and never handles card details: it hands the person a payment page. Smarty Pants offers each of these: llms.txt, an MCP server listed in the official MCP Registry, /openapi.json, /v1/models with prices and is_ready, GET /v1/key for the limit, and add_credit for a Stripe page the person pays on.

People pick an API by reading a pricing page. Agents pick one by reading files. An API an agent can use without a human walking it through needs five things: a way to be found, a machine-readable list of models and prices, a way to know if it works right now, a spending limit the agent can read, and a payment step that a person completes. Here is how each one looks, with Smarty Pants as the worked example.

1. How does an agent find the API?

Through files and registries made for machines.

Door What it is Smarty Pants
llms.txt A plain-text summary for language models at the site root /llms.txt, /llms-full.txt
MCP Registry The official list of MCP servers that clients search network.smartypants/smartypants
Well-known file A JSON card at a fixed path /.well-known/mcp.json
OpenAPI A description of every public route /openapi.json
Package registries Install by name pip install smartypants-network, npm install smartypants-network

2. How does it check models and prices?

From a JSON list it can read without signing in. GET https://smartypants.network/v1/models lists every model with its exact build, context size, per-token price and license. The MCP server at /mcp (no sign-in) adds find_model and estimate_cost.

3. How does it know the API works right now?

From a readiness field and honest errors. On Smarty Pants each model has is_ready; when it is false, keep your current provider. A 429 or 503 means no Mac can take the request right now, with a Retry-After header. For code jobs, /v1/results/jobs publishes how recent jobs went as JSON, with a sha256 anyone can check.

4. How does it stay inside a budget?

It reads its own limit before costly work. GET https://smartypants.network/v1/key returns the key’s limit, what it has spent and remaining_usd. A person can give any key its own monthly limit; each connected MCP app is capped at $20 a month and its connection lasts 90 days.

5. Who pays?

The person, on a payment page. The agent should ask its person before spending, and never handle card details. Over the signed-in MCP server (/mcp/account), add_credit returns a Stripe page; the person pays there and the balance updates about a minute later.

Anyone can sign up with an email at smartypants.network/api and create a key; new accounts get $10 of free credit, usable for 90 days. Requests run on Macs owned by other people. Owners agree not to read requests and the app doesn't show them, but a serving Mac decrypts each request in memory to answer it, so that is a rule and a design, not a technical guarantee. Don't send sensitive data on the general network.

Frequently asked questions

What is llms.txt?

A plain-text file at the root of a site that tells language models what the site offers and links its key docs. Smarty Pants publishes https://smartypants.network/llms.txt and a longer https://smartypants.network/llms-full.txt.

How does an agent find an MCP server?

From the official MCP Registry (registry.modelcontextprotocol.io), from directories that copy it, or from a site's /.well-known/mcp.json. Smarty Pants is listed in the registry as network.smartypants/smartypants.

Can an agent pay for an API by itself?

It should not handle card details. On Smarty Pants an agent calls add_credit over MCP, which returns a Stripe payment page, and the person pays there. The agent should ask the person before spending at all.

How does an agent know how much it may spend?

GET https://smartypants.network/v1/key shows the key's own spending limit, what it has spent and remaining_usd. Each MCP connection is capped at $20 a month.

How do I get a key?

Anyone can sign up with an email at smartypants.network/api and create a key; new accounts get $10 of free credit, usable for 90 days.

Sources

  1. llms.txt proposal
  2. Official MCP Registry
  3. Smarty Pants in the MCP Registry
  4. Smarty Pants: llms.txt
  5. Smarty Pants: Agent kit and docs

Try a pinned open model on real Macs.

See every model, its listed price and the code to call it. Smarty Pants works with the OpenAI SDK you already use: change the base URL and the key.

Requests run on Macs owned by other people. Owners agree not to read requests and the app doesn't show them, but a serving Mac decrypts each request in memory to answer it, so that is a rule and a design, not a technical guarantee. Don't send sensitive data on the general network.