AgentTab lets an AI agent pay per tool call from a budget its owner approves once with PayPal: an authorization hold, batched partial captures, refunds the owner confirms, and seller payouts. An AI agent decides which paid calls are worth it; an AI assistant helps the owner dispute the ones that were not.

Inspiration

AI agents increasingly need to buy things one call at a time: an article, a data query, an answer from a paid panel. Today there are only bad options. Hand the agent your card, and it has no limits and no allowlist. Approve every purchase yourself, and the agent stops being useful. Pay per call, and fixed fees eat the purchase: US PayPal Checkout is 3.49% + $0.49 per transaction, so the fixed fee alone on a $0.05 article is almost ten times its price.

What it does

AgentTab gives an AI agent a PayPal-authorized spending tab instead of a card.

  1. The agent requests a tab. Its request names a budget, a per-call cap, the sellers and an expiry (preset in the demo); the owner can tighten any of it.
  2. The owner approves once, with PayPal. That is an authorization hold: nothing is charged yet, and no card number ever reaches the agent.
  3. Every paid tool call is metered. Sellers sell through paid MCP tools. Each call is signed by the agent, checked against the owner's rules (budget, cap, allowlist, expiry) before the seller is paid, and recorded on a live ledger.
  4. Usage is captured in batches from the PayPal hold (partial captures), so many small calls share one capture and one fee.
  5. An AI assistant handles disputes. Ask "which charge was least worth it?"; the assistant checks the tab's PayPal order through the PayPal Agent Toolkit and proposes a refund of that call. Nothing moves until the owner presses Confirm.
  6. Closing the tab captures what was used, voids the rest of the hold, and pays each seller its share through PayPal Payouts, minus refunds and a platform fee.

Who it's for, and why it matters

Sellers who want to be paid by AI agents per call (newsrooms, data providers, expert panels) and the people whose agents buy from them. The fee math is the case: 40 calls averaging $0.25, paid one by one at the standard US rate (3.49% + $0.49), cost $19.95 in fees for $10 of purchases; even at PayPal's micropayments rate (4.99% + $0.09) it is $4.10. On one tab with a $10 capture batch, the same $10 costs $0.84 in checkout fees (about 8.4%), before payout fees ($0.25 per seller payout through the Payouts API, which can be batched across tabs). AgentTab earns a platform fee on each seller payout.

How we built it

  • PayPal: Orders v2 with intent: AUTHORIZE (the budget hold), Payments v2 partial captures (final_capture: false), final capture, void, refunds, and Payouts v1. Every money call carries a PayPal-Request-Id; capture and refund retries are first looked up on the PayPal order by invoice_id, so a retried capture or refund is not sent twice (resends verified on the sandbox).
  • AI: the buying agent and the tab assistant are LLM tool-use loops. The hosted demo runs Gemini Flash-Lite on Google's free tier through its OpenAI-compatible API, rotating to the next Gemini model when one model's daily quota is used up; the same loops run on Claude when an Anthropic key is set. The assistant gets the PayPal Agent Toolkit's get_order, guarded so it can read only the tab's own order. The Toolkit is used read-only by design: the AI can look and propose, and money moves only when the owner confirms.
  • Sellers are Model Context Protocol servers whose paid tools answer "payment required" until paid from the tab. Payment messages use the x402 format over MCP with our own paypal-tab scheme (not an official x402 scheme), so standard x402 MCP clients can pay from a PayPal authorization. The paid-MCP integration with PayPal support we found (PayMCP) creates one order per call with a human approval link; AgentTab needs one approval per budget, then meters calls unattended.
  • TypeScript, Hono, Vitest (94 tests), deployed on Render. If the free AI quota runs out, the agent and the assistant fall back to clearly labeled scripted and rule-based modes, so the PayPal flow never breaks.

Verified on the PayPal sandbox

The run in the video (hosted demo, 2026-11-02): $5.00 authorized → the agent bought 4 calls ($0.02 + $0.02 + $0.25 + $0.40; it fetched the same price history twice) → one capture of $0.69 (6YW68319BB778352S) → asked which charge was least worth it, the assistant looked up the order with the PayPal Agent Toolkit's get_order and proposed refunding the duplicate $0.02 call → owner confirmed → PayPal refund 4M786559SF5213928 → tab closed: $4.31 released (voided), payout completed (Field Panel $0.36, Openfield Data $0.24, platform fee $0.07). A separate smoke test (docs/SANDBOX_EVIDENCE.md) covers idempotent capture and refund resends and captures refused after final capture or void.

Challenges we ran into

Moving money safely in many tiny steps. A capture whose outcome is unknown is never resent until PayPal's own records show it did not happen. Pending captures settle before the final capture; refunds in flight hold back seller payouts. Captures can never exceed the authorization, and tabs stay inside PayPal's 3-day honor period. The owner key rotates when the owner approves on PayPal, so a review link the agent saw stops working. On the AI side: free-tier quotas are per model and per day, so the hosted demo rotates models and says plainly when the quota is out.

Accomplishments we're proud of

A complete money loop on real PayPal APIs (authorize, batch capture, refund, void, payouts) that an AI agent drives and a person controls, with every step visible on the ledger.

What we learned

Agent payments are less about paying and more about limits, batching and undo. PayPal's authorize-and-capture model fits that well.

What's next

Verify the owner with Log in with PayPal; PayPal multiparty platform fees instead of Payouts; reauthorization for tabs longer than three days; dropping a disputed call from the next capture instead of capturing early to refund it; seller onboarding.

Demo sellers, places and data are fictional. The demo uses a $5 budget and a $0.50 capture batch so a capture appears within a short run; production would use a $10 batch. Repository started 2026-10-12.

Built With

  • claude
  • gemini
  • hono
  • model-context-protocol
  • node.js
  • paypal-agent-toolkit
  • paypal-orders-api
  • paypal-payments-api
  • paypal-payouts
  • playwright
  • typescript
  • vitest
Share this project:

Updates

Submission history