For agents
Agent integration · x402
AgentMint speaks the x402 protocol (Coinbase, May 2025). Agents discover skills, sign EIP-3009 transferWithAuthorization payloads with their own wallet, and settle USDC on Base — no signup, no API key, no monthly invoice. Settlement runs in ~200ms with sub-cent gas.
Networks
base-sepolia
Asset
USDC
Settlement
≈200ms
1 · Discovery
GET /api/v1/marketplace/agent/ returns the full machine-readable catalog with x402 payment metadata.
Loading…2 · Anonymous payment flow (no account)
- 1 Agent POSTs to
/execution/invoke/<slug>/without auth. - 2 Server returns 402 PAYMENT_REQUIRED with x402 metadata (network, asset, payTo, maxAmountRequired in atomic USDC, EIP-712 domain + types).
- 3 Agent signs EIP-712
TransferWithAuthorizationwith its private key (ethers/web3.py). USDC supports EIP-3009 natively → gasless for agent. - 4 Agent retries with
X-PAYMENTheader (base64-encoded signed payload). - 5 Server posts payload to facilitator (Coinbase hosted or self-hosted). Facilitator submits the on-chain transfer, returns
tx_hash. - 6 Server executes the skill, returns result + sets
X-PAYMENT-RESPONSEwith the tx_hash.
3 · Quick example (curl + ethers.js)
# A. Probe skill — get x402 PAYMENT_REQUIRED
curl -X POST -H "Content-Type: application/json" \
-d '{"input": {"query": "..."}}' \
https://api.orkai.ai/api/v1/execution/invoke/citation-researcher/
# Response (excerpt):
# {
# "x402Version": 1,
# "paymentRequirements": [{
# "scheme": "exact",
# "network": "base-sepolia",
# "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
# "maxAmountRequired": "400000", // 0.40 USDC (6 decimals)
# "payTo": "0x...publisherAddr",
# "extra": { "nonce": "0x...", "domain": {...}, "types": {...} }
# }]
# }
# B. Sign in agent runtime (TypeScript / ethers v6)
import { Wallet, TypedDataDomain } from "ethers";
const wallet = new Wallet(process.env.AGENT_PRIVATE_KEY);
const sig = await wallet.signTypedData(domain, types, message);
const xPayment = btoa(JSON.stringify({
x402Version: 1, scheme: "exact", network: "base-sepolia",
payload: { signature: sig, authorization: message },
}));
# C. Retry — server settles + executes
curl -X POST \
-H "Content-Type: application/json" \
-H "X-PAYMENT: $X_PAYMENT" \
-d '{"input": {"query": "..."}}' \
https://api.orkai.ai/api/v1/execution/invoke/citation-researcher/Demo helper:
POST /api/v1/execution/invoke/<slug>/demo-sign/ returns a mock-signed X-PAYMENT for testing without USDC.4 · Account mode (optional)
Some agents prefer prepaid wallets (humans funding the agent budget). Create a scoped API key and pay from your AgentMint ledger. No on-chain settlement — pure off-chain wallet, useful for KYC'd workflows or when an agent can't hold a private key.
Log in to manage keys.
Why crypto for agents?
- Stripe / cards: $0.30 + 2.9% fixed → impossible below ~$10 ticket. Sub-cent skills are unprofitable on fiat rails.
- USDC on Base L2: gas ~$0.0001, settlement ~200ms, 0% protocol fee. Per-call billing for $0.010 works.
- EIP-3009: agent signs once, facilitator pays gas → agent never holds ETH.
- No KYC required at the protocol level. Compliance happens at wallet/exchange layer.
- Adopted by AWS Bedrock AgentCore, Stripe (x402 integration), Cloudflare. De-facto standard 2026.