Open-source Python SDK for autonomous x402 payments

Give your agents a payment stack they can trust.

Discover paid APIs, enforce durable spending policy, settle USDC on-chain, and gate work on independent validation—all from one Python SDK.

$pip install arc-agent-pay
PyPI v0.4.0 GitHubMITPython 3.11+Arc Testnet

One agent run, end to end

research: “USDC payments on Arc”
budget 0.10 USDC
  • POST /research

    no API key sent

    402 Payment Required
  • sign transfer · 0.005 USDC

    EIP-3009, off-chain

    signed
  • retry with X-PAYMENT

    settles on Arc Testnet

    200 OK
Payment settled on-chaintx 0x9f2c…a41b

Arc Testnet · x402 Protocol · EIP-3009 · Circle USDC

One client, explicit policy

Add autonomous payments without hiding the controls.

PaymentClient handles the 402 flow while your policy and SQLite journal keep every authorization bounded, durable, and inspectable.

payment_client.py
from arc_agent_pay import PaymentClient, PaymentPolicy, SqlitePaymentStore

policy = PaymentPolicy(
    max_payment_usdc="0.05",
    daily_cap_usdc="2.00",
)

async with PaymentClient(
    account=account,
    policy=policy,
    payment_store=SqlitePaymentStore("payments.db"),
) as client:
    response = await client.get(url)
01

Settlement

Automatic x402 negotiation and EIP-3009 USDC settlement with explorer-verifiable receipts.

02

Identity

ERC-8004 agent identity, reputation checks, and evidence-bound validation attestations.

03

Workflow

Durable policy and payment journals, validation escrow, and an ERC-8183 client profile.

We take care of the plumbing.

spent0.064 / 0.100
0.050 USDCblocked

Budgets that actually hold.

Every run gets a hard cap. Quote-aware policy adds maximum-price, rolling spend, velocity, provider, network, asset, recipient, and kill-switch controls before any signature.

Agents find the right API on their own.

A built-in registry ranks services by name, tags, and description. Your agent searches for what it needs — 'crypto prices' — and gets back live, payable endpoints.

request402
pay + retryauto
response200

Your agent code never changes.

PaymentClient is a drop-in HTTP client. When a server answers 402, the payment is signed, attached, and retried behind the scenes — your application logic stays exactly as it was.

Payment receipt
amount
0.005 USDC
network
Arc Testnet
tx
0x9f2c…a41b

Every payment on the record.

A durable SQLite journal records quoted terms and pending, authorized, settled, failed, or ambiguous outcomes. Successful settlement still links to its Arc explorer transaction.

An agent pays. The protocol settles.

Five steps, a few seconds, every payment verifiable on-chain.

01

Request

The agent calls a paid API — no auth header, no API key.

02

402

The server answers with a price: 0.005 USDC, payable on Arc.

03

Sign

The agent signs an EIP-3009 authorization off-chain. No gas.

04

Retry

The signed payment rides along in the X-PAYMENT header.

05

Settle

The server settles on Arc Testnet and returns 200 with the tx hash.

Hosted playground activity.

Live runs and on-chain payments made by this public playground.

Agent runs
completed in the playground
Payments settled
on Arc Testnet
USDC moved
in per-call nanopayments
Topics researched
by autonomous agents

Frequently asked

An open-source Python SDK that lets AI agents pay for APIs as they use them. Servers price each call over the x402 protocol, and the agent settles in USDC on Arc Testnet — no accounts, no API keys.

Give your agents a wallet of their own.

Run a live agent in the browser — no signup, no keys, no gas. Watch it discover an API, pay in USDC, and settle on Arc Testnet in seconds.