# Can an AI agent pay for and access a gated API on its own?

Every "sign up for our API" flow assumes a human. There's an email to confirm, a
dashboard to click through, a credit card with a name on it. That's fine when a
person is buying. It falls apart the moment the buyer is software — an agent that
earned some money and now needs to spend it on the infrastructure it runs on.
The agent has a wallet. It doesn't have an inbox, a browser, or a legal name.

So here's the question we built for: **can an agent go from "I hit a paywall" to
"I'm in" with no human in the loop?**

## The straight line

Yes, and it's shorter than you'd think. Becoming a paying customer of a
Grantor-gated service is four ordinary contract calls, paid in USDC on Base:

```
createTenant  -> you now have a tenant, and you're its admin
topUp         -> fund it with USDC
drawPeriod    -> activate the current billing period
enroll        -> register the key (or ZK identity) you'll authenticate with
```

There is no signup, no form, and no server on the other end to approve you. A
tenant is a row in a public contract, not a record in someone's database — so
"registering" is something you do *to the chain*, with your own wallet. An agent
that earns USDC (say, via x402 settlements on the same chain) funds its own
access with the same asset, in the same place, with no facilitator or bridge in
between. Money in, identity out, one hop.

The only human moment in the entire flow is funding the wallet once. After that,
the agent onboards, pays, and authenticates itself.

## How the agent even knows what to do

It doesn't need to be told in advance. The discovery is built into the protocol.

When an agent hits a resource it isn't authorized for, the `401` it gets back
isn't a dead end — it's a map. The response carries
`WWW-Authenticate: Grantor-Deed` and a stable `learn` URL that points at a
machine-readable onboarding manifest (`/.well-known/grantor-onboard.json`,
identical everywhere). The agent parses it, sees the exact calls to make and the
funding rule — *you pay your own gas; nobody sponsors you, and nobody can drain
anyone else's funds* — and proceeds. The `npx grantor-onboard` kit automates
every step.

The protocol surface *is* the documentation. Any agent that bounces off a gated
endpoint is handed the path to get through it.

## What it authenticates with

The credential is a **deed** — self-certifying, no authorization server anywhere
in the path. The agent mints one and the relying app verifies it in-process
against the public on-chain registry with a single `eth_call`, then turns it
into its own standard OIDC JWT that any JOSE library validates. Nobody runs a
token service; nobody can subpoena one; the relying party trusts the chain, not
a company.

And it can do this **anonymously**. In `agent-zk` mode the agent proves in
zero-knowledge that it's an enrolled member of the service's registry *without
revealing which member* — the verifier learns "an authorized agent" and a
pseudonym, nothing that links which agent hit which server. Identity for callers
that aren't people, without a surveillance trail as the price of admission.

## The honest part

This is an **unaudited developer preview**. The registry is live on Base mainnet
(chain 8453) and the SDKs resolve it, but the contracts have not been
independently audited — don't put irreplaceable funds behind it yet. If you just
want to see the whole loop run for free, there's a Base Sepolia (84532) path with
play-money USDC. Both are the same code; only the money is different.

## Try it

- The machine channel: [llms.txt](https://chaingrantor.com/llms.txt) — point
  your agent at it.
- The kit: `npx grantor-onboard preflight`.
- The SDKs: `@grantor/verify` on npm, `grantor-verify` on PyPI and crates.io —
  minting and verifying ship in TypeScript, Python, Go and Rust.
- The walkthrough: [self-onboarding, 401 to paying tenant](https://chaingrantor.com/docs/ONBOARD.html).

An agent that can earn shouldn't need a human to sign it up for the things it
spends on. Now it doesn't.