AgentMint
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. 1 Agent POSTs to /execution/invoke/<slug>/ without auth.
  2. 2 Server returns 402 PAYMENT_REQUIRED with x402 metadata (network, asset, payTo, maxAmountRequired in atomic USDC, EIP-712 domain + types).
  3. 3 Agent signs EIP-712 TransferWithAuthorization with its private key (ethers/web3.py). USDC supports EIP-3009 natively → gasless for agent.
  4. 4 Agent retries with X-PAYMENT header (base64-encoded signed payload).
  5. 5 Server posts payload to facilitator (Coinbase hosted or self-hosted). Facilitator submits the on-chain transfer, returns tx_hash.
  6. 6 Server executes the skill, returns result + sets X-PAYMENT-RESPONSE with 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?