AI agents can’t sign up for your API. So they leave.

Most APIs are built for humans. A sign-up form, an email confirmation, a credit card, an API key to copy. An agent that runs into that just gives up. You never see that traffic, and you never earn anything from it.

So I built Stempl. It’s a gate in front of your API that lets agents pay with work instead of money.

Everyone Is Giving 402 a Job

HTTP 402 Payment Required sat unused for almost thirty years. Now everyone wants it.

  • x402 settles in stablecoins.
  • L402 runs over Lightning.
  • Machine Payments Protocol, launched by Stripe and Tempo this year.

They all answer the same question: how does an AI agent pay for an API call? And they all give the same kind of answer. With money.

That’s clever. But it means every agent needs a wallet, someone has to fund it, and the API owner needs a way to receive it. That’s a lot of setup for one API call.

What reCAPTCHA Got Right

This reminded me of reCAPTCHA. Millions of people digitised books just by proving they weren’t a robot. They didn’t pay with money. They paid with a bit of work.

reCAPTCHA had humans label data to prove they weren’t bots.

What if bots labeled data to get in?

An agent always has one thing it can pay with: the ability to read something and answer a question about it.

How It Works

AI agentwants your dataGatein front of the APIStempltasks + quality controlYour APIunchanged1. request2. 402 + work key3. do the work4. access token5. with token: throughverified ✓GET402keytasksanswerstokentoken200 data
  1. An agent calls your endpoint and gets a machine-readable 402 Payment Required, with a work key and instructions.
  2. It picks up a batch: one question and a few records from someone’s workload. Classify them, score them, or answer something about them.
  3. Its answers are cross-checked against other agents. Good work counts. Sloppy work earns nothing.
  4. After enough good batches it gets an access token and comes back. No account, no API key, no wallet, no human in the loop.

Your API stays exactly as it is. Existing customers with their own key go straight through.

Keeping the Work Honest

An agent that answers “yes” to everything shouldn’t get in. So every batch hides a test.

  • Check items. A batch of 5 holds 3 new records and 2 that earlier agents already answered. Item ids are random, so an agent can’t tell which is which. The batch only passes if it agrees on the checks.
  • Fuzzy answers. Scores from 0 to 1 pass within a tolerance of earlier answers, by default the median ± 0.2. Text answers are compared by meaning, with embeddings, not by exact words.
  • Stop early. Once 2 answers to a record agree, that record is done. No agent’s work is wasted on it.

The Other Side: an Agent Workforce

The work has to come from somewhere.

Anyone who has built a data pipeline knows the expensive part usually isn’t storage or compute. It’s the labels. Classifying records, scoring them, pulling answers out of messy text. You either pay people to do it, or you pay an LLM per token and then still check its output.

With Stempl, a business uploads a CSV, JSONL or text file and asks one question about every record. They define the answer fields themselves: yes/no, pick one, a score, or free text. Stempl knows nothing about any domain. It just hands out the work and checks it.

The business gets back verified results, plus how far the agents agreed. Stempl already meters items, characters and estimated tokens per batch, so the work can be priced later.

What I Tried First

The first version didn’t use agents at all.

It labeled data with a local model: Gemma 4 26B, served by Ollama on the CPU of my home server. No GPU. I gave it a JSON schema for structured output, turned off reasoning tokens, ran one request at a time and kept the context small.

It worked. A full labeling pipeline with zero API costs.

But one CPU-bound model caps your throughput, and it was sharing RAM with a Minecraft server. So Stempl moved on. Now AI agents fetch batches over an API and check each other. The local model might come back later to seed a few “gold” answers that the owner confirms.

Under the Hood

The trust model is two signed JWTs, so the gate never has to call home:

  • Work key. Signed by the API’s own gate key and handed to the agent in the 402. It says how much work the agent owes.
  • Access token. Signed by Stempl’s Ed25519 key once the work passes. The gate checks it offline, with Stempl’s public key from a JWKS endpoint.

The gate fits in three ways:

  • Proxy: internet → gate → API. The API needs no changes and can be written in any language.
  • Gateway plugin: your gateway (Traefik, for example) keeps routing and TLS, and asks the gate about each request through forward auth.
  • FastAPI middleware: one line in a Python API.

All three share one small library, gatekit, so the signing logic can’t drift apart.

Behind it all is a single Python service with SQLite. It runs on a box in my home, behind a Cloudflare Tunnel. No Kubernetes, no managed services.

That’s the question I asked on LinkedIn, and I still don’t have a clean answer.

The 402 response literally tells an agent what to do. That’s the whole point. But it’s also exactly what people worry about when a web page tells an agent what to do.

What I do know: I don’t think this replaces payments. Some API calls are worth a wallet. But not every call is, and not every agent has one.

Try It

It’s an experiment, and you can try it right now. Point your agent at the demo Flight API at flights.stempl.dev and let it follow the instructions in the 402. The flights are made up. /flights is open, but the details cost work.

The landing page at stempl.dev has a walkthrough. Demo work is public, so don’t upload anything personal.

Next up are self-service accounts, so API owners can set up their own gate and businesses can upload their own work.

Two Things I’m Taking With Me

Payment doesn’t have to mean money. reCAPTCHA proved that years ago. Agents just flip it around.

Trust comes from cross-checking, not from the agent. You never trust one answer. You trust two answers that agree.

Your API gets a new kind of customer. It just pays in a different currency.

Evert