AgentPMT lets autonomous agents buy Agent Credits (100 credits = $1) and invoke marketplace tools and workflows over HTTP. Identity is a wallet signature (no API keys).
Autonomous Agents
Wallet Identity + Credits for fully autonomous tool and workflow usage
For the full endpoint docs and code samples, see /external-agent-api.
Identity: A Wallet Address + Signatures
Your agent is identified by an EVM wallet address. To check balances, invoke tools, or fetch and run workflows, your agent signs standardized messages (EIP-191 personal-sign). Credits are attached to that wallet address.
No Wallet? Use AgentAddress
If your agent runtime doesn't already have a wallet, generate one with AgentAddress. AgentAddress runs locally in your browser and produces an address + secret key + recovery phrase.
Operational guidance
- Treat the AgentAddress secret key like a real wallet secret. If someone gets it, they can spend that wallet's credits.
- If you want strong guardrails, keep the agent wallet empty of on-chain funds and fund it with credits only (see sponsored top-ups below).
Buying Credits (Two Patterns)
Credits are purchased via the x402 payment flow using a v2 header handshake (PAYMENT-REQUIRED / PAYMENT-SIGNATURE). Payments are accepted in USDC and EURC across multiple L2 chains.
Supported chains and tokens
| Chain | Chain ID | Tokens |
|---|---|---|
| Base (default) | 8453 | USDC, EURC |
| Arbitrum | 42161 | USDC |
| Optimism | 10 | USDC |
| Polygon | 137 | USDC |
| Avalanche | 43114 | USDC, EURC |
| Base Sepolia (testnet) | 84532 | USDC |
Ethereum mainnet is excluded (gas too expensive). Default is Base USDC. The 402 response lists all supported chain+token options -- pick any one.
Pattern A: Agent Pays and Credits Itself (Fully Autonomous)
Use this when your agent wallet holds USDC and is allowed to purchase credits directly. This is the simplest flow.
# Step 1: request payment requirements (returns 402 + PAYMENT-REQUIRED header)
curl -i -s -X POST "https://www.agentpmt.com/api/external/credits/purchase" \
-H "Content-Type: application/json" \
-d '{ "wallet_address":"0xAGENT_WALLET", "credits": 500, "payment_method":"x402" }'
# Step 2: sign the EIP-3009 authorization from the returned requirements,
# then retry with PAYMENT-SIGNATURE (base64 JSON, x402Version:2 payload).
curl -s -X POST "https://www.agentpmt.com/api/external/credits/purchase" \
-H "Content-Type: application/json" \
-H "PAYMENT-SIGNATURE: <base64-json>" \
-d '{ "wallet_address":"0xAGENT_WALLET", "credits": 500, "payment_method":"x402" }'Pattern B: Human Sponsors Credits to the Agent Wallet
Use this when a human wants to pay from their own wallet, but give the agent only a capped amount of spend power via credits (without sharing the human wallet key).
In this model:
- The agent has its own wallet (for identity and signing requests).
- The human pays USDC from a different wallet.
- The human includes a sponsor signature authorizing which agent wallet should receive the credits for that payment.
Human does
- sign an EIP-3009 USDC authorization (x402)
- sign the sponsor message that names the agent wallet
Agent does
- POST the signed payloads to buy credits to its own wallet
- use those credits autonomously via signed tool/workflow calls
# Human sponsors credits to an agent wallet using x402
# (The payment authorization "from" is the human wallet; credits are granted to wallet_address.)
# Step 1: request payment requirements
curl -i -s -X POST "https://www.agentpmt.com/api/external/credits/purchase" \
-H "Content-Type: application/json" \
-d '{
"wallet_address":"0xAGENT_WALLET",
"credits": 500,
"payment_method":"x402",
"payer_wallet_address":"0xHUMAN_WALLET",
"sponsor_signature":"0x<signature-by-human-wallet>"
}'
# Step 2: sign authorization from requirements, then retry with PAYMENT-SIGNATURE
curl -s -X POST "https://www.agentpmt.com/api/external/credits/purchase" \
-H "Content-Type: application/json" \
-H "PAYMENT-SIGNATURE: <base64-json>" \
-d '{
"wallet_address":"0xAGENT_WALLET",
"credits": 500,
"payment_method":"x402",
"payer_wallet_address":"0xHUMAN_WALLET",
"sponsor_signature":"0x<signature-by-human-wallet>"
}'
# sponsor_signature signs this exact message (EIP-191 personal-sign):
agentpmt-external-sponsor
payer:0xhuman_wallet_lower...
recipient:0xagent_wallet_lower...
credits:500
nonce:0x<same-nonce-as-authorization>Running Tools and Workflows Autonomously
Once the agent wallet has credits, the agent can:
Create a session nonce
Check credit balance
List and invoke tools
Fetch and run workflows

