Skip to main content
Glama

Contents

What is tab · Why tab · Mandates · How a payment works · Quickstart · For API providers · For agent developers · Settlement · Security model · Testing · Architecture · Roadmap


Related MCP server: agent-tools-mcp

What is tab

tab is an open payment protocol for software agents.

It lets an agent discover a paid HTTP service, receive a price, authorize the purchase against rules set by its owner, pay, and receive the result. No human has to create an account, enter a card, or copy an API key.

Owners define those rules once, in a signed mandate:

Constraint

Purpose

Total budget

Caps lifetime spend

Maximum price per request

Blocks a single expensive call

Allowed sellers

Restricts where money can go

Spending window

Resets the budget each UTC day, or keeps one lifetime total

Expiration

Ends the authority automatically

The owner signs once. The agent then transacts on its own, and it cannot exceed what the owner authorized.

Owner
  │
  │ signs mandate
  ▼
Agent
  │
  │ HTTP request
  ▼
Gateway ────────► API
  │
  │ verifies mandate
  │ enforces budget
  │ settles payment
  ▼
USDC

Why tab

Software agents can already call APIs and use tools. Paying for those services is the part that still requires a person.

Today a human creates an account, enters payment information, generates an API key, configures billing, and hands credentials to the agent. tab replaces all of that with an HTTP payment.

Agent calls API

HTTP/1.1 402 Payment Required

Account signup, card on file, API key handoff, billing setup.

Agent pays through tab

HTTP/1.1 200 OK
Tab-Receipt: evm:0x...

No account. No card details. No shared owner key. No unrestricted wallet.

Mandates

A mandate is a signed spending authorization from an owner to an agent.

Field

Example

Agent

7f2c...

Budget

$25.00

Maximum per call

$0.05

Allowed sellers

api.example.com

Expires

2026-10-01

The owner key never has to be online while the agent is working. Every payment is checked independently by the seller's gateway against the signed mandate, so changing the agent's prompt cannot increase its authority.

How a payment works

tab uses standard HTTP payment semantics. A priced endpoint answers with 402 Payment Required and a signed challenge describing the purchase. The agent checks the price against its mandate and signs a credential bound to that exact request.

The gateway then runs the full lifecycle:

Step

Action

1

Verify the challenge

2

Verify the mandate

3

Verify the agent

4

Verify the exact request

5

Reserve the budget

6

Call the upstream service

7

Settle only after a successful response

8

Return a signed receipt

If the upstream service fails, the payment is voided.

Quickstart

Requires Node.js 22.13 or newer.

git clone https://github.com/paidwithtab/tab
cd tab

npm install
npm run demo

The demo starts a paid API, a tab gateway, a catalog, and a local wallet.

1. Call the paid endpoint directly.

curl -i http://127.0.0.1:1402/quote

The server answers with a signed challenge:

HTTP/1.1 402 Payment Required
WWW-Authenticate: Tab challenge="eyJ2ZXIiOiJ0YWIvMCIs..."

2. Call it through tab.

npm run cli -- fetch \
  --agent keys/agent-claude.json \
  --mandate keys/mandate-claude.json \
  http://127.0.0.1:1402/quote

tab handles the payment and returns the API response together with a receipt.

Full walkthrough

For API providers

Any HTTP API becomes payable with a small JSON specification. Leave out rail to run on sandbox balances while you develop.

{
  "realm": "api.example.com",
  "recipient": "<wallet>",
  "rail": "evm",
  "evm": {
    "rpc": "https://rpc.testnet.chain.robinhood.com",
    "chain_id": 46630,
    "token": "0x5B6C7cAF7F99f99154fD8375ec935Fcf03F326f5",
    "decimals": 6,
    "recipient": "<your 0x payout address>"
  },
  "upstream": "http://127.0.0.1:8080",
  "routes": [
    { "method": "GET",  "path": "/v1/things/:id", "price": "0.01"  },
    { "method": "POST", "path": "/v1/generate",   "price": "0.002" }
  ]
}

Start the gateway:

tab serve \
  --spec spec.json \
  --announce https://catalog.example.com

The gateway handles payment negotiation, authorization, settlement, receipts, and proxying. Your application keeps serving normal HTTP.

Read the seller documentation

For agent developers

1. Create an agent key.

tab key new --out agent.json

2. Issue it a mandate.

tab mandate issue \
  --owner owner.json \
  --agent agent.json \
  --budget 5.00 \
  --window day \
  --max-per-call 0.05 \
  --allow 'api.example.com' \
  --out mandate.json

3. Spend within those limits.

import { TabClient, receiptOf } from './src/client.js';

const client = new TabClient({
  agent,
  mandate,
  maxPerCallUsd: '0.05',
});

const res = await client.fetch('https://api.example.com/v1/things/42');

console.log(receiptOf(res)?.ref);

tab also exposes five MCP tools, so compatible agents can discover and purchase services without ever receiving the owner's private key:

Tool

Purpose

tab_search

Find services in a catalog

tab_discover

Inspect a service and its pricing

tab_fetch

Make a paid request

tab_balance

Check remaining budget

tab_limits

Read the active mandate constraints

Read the buyer documentation

Settlement

tab supports USDC settlement on Robinhood Chain, following a delivery first model. The gateway does not settle a payment until the upstream service has responded successfully.

authorize
    │
    ▼
reserve
    │
    ▼
call API
    │
    ├── failure ──► void
    │
    ▼
success
    │
    ▼
settle
    │
    ▼
receipt

Security model

tab is built around bounded authority.

Property

Guarantee

Owner keys stay offline

The owner signs the mandate. The agent never receives the owner's private key.

Agents have explicit limits

Compromising an agent exposes only the authority its mandate granted.

Requests are cryptographically bound

Credentials commit to the exact request, including query string and body digest.

Payments cannot be replayed

Challenges are single use, and chain settlement adds a nonce boundary.

Gateways hold no buyer keys

The gateway verifies and broadcasts what the agent authorized. It cannot create payments on its own.

Security issues involving payment invariants should be reported privately through SECURITY.md.

Testing

tab currently runs 106 automated checks across protocol behavior, adversarial conditions, and EVM settlement.

Suite

Checks

Coverage

npm test

51

Gateway, catalog, MCP, receipts, payment lifecycle

npm run test:adversarial

24

Concurrency, replay, mutation, SSRF, persistence

npm run test:evm

31

Cryptography, EVM transactions, Robinhood Chain

The concurrency suite fires 150 simultaneous $0.01 requests at a $1.00 mandate. Exactly 100 settle.

Architecture

                        ┌─────────────┐
                        │    Owner    │
                        └──────┬──────┘
                               │
                         signed mandate
                               │
                               ▼
┌─────────────┐        ┌─────────────┐
│   Catalog   │◄──────►│    Agent    │
└─────────────┘        └──────┬──────┘
                              │
                         HTTP + payment
                              │
                              ▼
                       ┌─────────────┐
                       │ tab Gateway │
                       └──────┬──────┘
                              │
                     verify + authorize
                              │
                ┌─────────────┴─────────────┐
                ▼                           ▼
          ┌──────────┐                ┌──────────┐
          │   API    │                │   USDC   │
          └──────────┘                └──────────┘
src/          protocol, gateway, catalog, client, CLI and MCP
src/evm/      EVM cryptography, transactions and JSON RPC
src/rails/    sandbox and EVM settlement rails
web/          site and catalog
examples/     demos and example specifications
test/         protocol, adversarial and EVM tests

SPEC.md       protocol specification
DEPLOY.md     deployment and operations

Protocol

The specification lives in SPEC.md.

Current version: Draft 0.3 · Wire protocol: tab/0

Roadmap

Areas currently under exploration:

  • x402 compatibility

  • Agents acting as sellers

  • Metered pricing and payment channels

  • Windowed onchain budgets

  • Header binding and subscriptions

  • Fee splits and gas sponsorship

License

MIT. See LICENSE.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for AgentPay — the payment gateway for autonomous AI agents. Fund a wallet once, give your agent the key, and it discovers, provisions, and pays for tool APIs on its own. One key, every tool.
    112 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables MCP-compatible agents to discover and call x402 paid services from a directory of over 2,000 APIs.
    Apache 2.0
  • A
    license
    A
    quality
    B
    maintenance
    Enables any existing API to become a pay-per-call service for agents by issuing HTTP 402 payment requests and settling USDC payments via CDP, while exposing MCP tools that charge per call and support Bazaar discovery.
    3
    74 npm
    MIT