Back to News
OneShotSoul.MarketsAgent CommerceUSDCBaseStablecoinsAI Agents

Agent-to-Agent Payments: When Machines Pay Machines Without Human Approval

J NicolasJ Nicolas
··8 min read
Agent-to-Agent Payments: When Machines Pay Machines Without Human Approval

Most payment systems assume a human is somewhere in the loop. A credit card needs a cardholder. An OAuth flow needs someone to click "Authorize". A wire transfer needs a compliance officer to approve it. These assumptions are baked so deep into financial infrastructure that they're invisible until you try to build something that breaks them.

AI agents break all of them at once.

When an agent needs to pay another agent for a research report, a verification check, or a voice call, there's no human available to approve the transaction. The agent is running autonomously, possibly at 3am, possibly inside another agent's workflow. The payment either happens programmatically or it doesn't happen at all. This is the core problem that agent-to-agent payments have to solve.

Why Traditional Payment Rails Fail Agents

Credit cards require a cardholder agreement, a billing address, and a human-readable statement. They're designed around the assumption that a person will review charges and dispute fraudulent ones. Agents can't dispute charges. They can't receive OTP codes. They can't complete CAPTCHA challenges or click through 3D Secure popups.

Bank APIs are worse. ACH transfers take days and require account verification flows that involve micro-deposits and manual confirmation. SWIFT is even slower and more expensive. OAuth-based payment authorization (the kind Stripe and PayPal use) explicitly requires a browser redirect and a human session.

The problem compounds when you consider scale. An agent orchestrating a research workflow might need to pay for dozens of sub-tasks in parallel: web scraping, data enrichment, contact verification, email drafting. Each of those might be provided by a different agent or service. You can't have a human approve each micro-transaction. The latency alone would kill the workflow.

What agents need is a payment primitive that is programmable, instant, permissionless, and stable in value. That's a short list of requirements, but it rules out almost everything in traditional finance.

USDC as the Agent Currency

USDC fits the requirements better than anything else currently available. It's a dollar-pegged stablecoin, so agents don't need to manage exchange rate risk or convert between currencies mid-workflow. It settles in seconds on chains like Base, not days. It's programmable: you can attach conditions, limits, and authorization signatures to transfers. And it's permissionless: any wallet can send and receive it without applying for an account.

The stability matters more than it might seem. If an agent is paying 0.50 USDC for a research report, that needs to mean $0.50, not "approximately $0.50 depending on what ETH is doing right now." Agents operating on fixed budgets can't absorb volatility. USDC removes that variable.

On Base specifically, transaction fees are low enough that micro-payments make economic sense. A $0.10 payment with a $2.00 gas fee is useless. On Base, that same payment costs a fraction of a cent in gas, which means agents can pay per-task without the economics falling apart.

The x402 Protocol: Payment Without Human Approval

The x402 protocol is how agent payments actually happen without a human in the loop. It extends HTTP with a payment layer: when a client requests a resource and that resource costs money, the server returns a 402 Payment Required response with a machine-readable payment specification. The client pays, attaches proof of payment to the next request, and the server delivers the resource.

The whole flow happens in code, between machines, in milliseconds. No browser. No OAuth popup. No human.

Here's what a 402 response looks like:

HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "x402Version": 1,
  "accepts": [
    {
      "scheme": "exact",
      "network": "base-mainnet",
      "maxAmountRequired": "500000",
      "resource": "https://api.oneshotagent.com/research/report",
      "description": "Company research report",
      "mimeType": "application/json",
      "payTo": "0xAbCd...1234",
      "maxTimeoutSeconds": 60,
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "extra": {
        "name": "USD Coin",
        "version": "1"
      }
    }
  ],
  "error": "Payment required"
}

The maxAmountRequired field is in the smallest unit of the asset (USDC has 6 decimals, so 500000 = $0.50). The client reads this, constructs a signed payment authorization, and retries the request with an X-PAYMENT header containing the proof.

The payment proof uses EIP-3009 TransferWithAuthorization, which lets a wallet sign an authorization for a specific transfer without actually broadcasting a transaction first. The server validates the signature, executes the transfer on-chain, and returns the resource. The agent never needed a human to approve anything.

Authorization Patterns: Spending Policies for Agents

Autonomous payments don't mean unlimited payments. Any serious agent deployment needs spending controls, and those controls have to be enforced in code rather than by a human reviewing a monthly statement.

There are three patterns that work in practice:

Pre-funded wallets with per-task limits. The agent gets a wallet funded with a set amount of USDC. Each task type has a maximum it's allowed to spend. The agent checks its balance and the task limit before initiating any payment. If a service quotes more than the limit, the agent rejects it and either finds an alternative or escalates to a human orchestrator.

Budget envelopes per workflow run. When a workflow starts, it gets allocated a budget. All agent-to-agent payments within that workflow draw from the same envelope. When the envelope is empty, the workflow stops rather than overspending. This is useful for bounded research tasks where you want to cap total cost regardless of how many sub-tasks get spawned.

Signed spending policies attached to requests. The orchestrating agent signs a policy that specifies what downstream agents are allowed to spend on its behalf. Sub-agents carry this policy and present it when making payments. The payment infrastructure validates the policy before processing. This mirrors how corporate purchasing cards work: the cardholder has a limit set by finance, and the card enforces it automatically.

In practice, most implementations combine the first two. A wallet-level cap prevents runaway spending if something goes wrong. A per-workflow budget keeps individual task costs predictable.

Code Example: An Agent Paying for a Research Report

Here's a concrete implementation using the OneShot SDK. This agent requests a company research report from OneShot's research tool, handles the 402 payment flow automatically, and returns the result.

import { OneShotClient } from '@oneshot-agent/sdk';
import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { base } from 'viem/chains';

// Agent wallet funded with USDC on Base
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const walletClient = createWalletClient({
  account,
  chain: base,
  transport: http(),
});

const client = new OneShotClient({
  walletClient,
  spendingLimit: 2_000_000, // $2.00 USDC max per request (6 decimals)
});

async function getCompanyResearch(companyName: string) {
  // Client handles 402 negotiation and payment automatically
  const result = await client.research.company({
    query: companyName,
    depth: 'detailed',
  });

  if (result.paymentMade) {
    console.log(`Paid ${result.amountPaid / 1e6} USDC for research report`);
    console.log(`Transaction: ${result.txHash}`);
  }

  return result.data;
}

// This runs without any human approval
const report = await getCompanyResearch('Acme Corp');
console.log(report.summary);

The spendingLimit parameter is the per-request ceiling. If OneShot's server quotes more than $2.00 for the report, the client throws before making any payment. The agent can catch that error and decide what to do: try a cheaper research depth, skip the company, or log it for human review.

The SDK handles the 402 negotiation, signature construction, and payment verification internally. From the agent's perspective, it's a single async call. The payment happens as a side effect, recorded on-chain with a transaction hash the agent can log for accounting purposes.

You can find the full OneShot SDK documentation including authentication setup, available tools, and pricing per call.

What Happens When a Payment Fails

Payment failures in agent workflows are different from payment failures in human workflows. A human can retry manually, call their bank, or use a different card. An agent needs to handle failures programmatically without blocking.

The failure modes worth designing for are:

Insufficient balance: the agent's wallet doesn't have enough USDC. The right response is to stop the workflow, log the failure with the current balance and the required amount, and notify a human operator. Don't retry in a loop hoping the balance magically increases.

Quote exceeds spending limit: the service is asking for more than the agent's policy allows. Log the quote and the limit, then either find an alternative service or skip the task. This is a policy decision, not a system error.

Transaction timeout: the payment was signed but the on-chain transaction didn't confirm within the server's timeout window. The server will reject the payment proof. The agent should check whether the transaction eventually confirmed (it might) before retrying, to avoid double-payment.

Network congestion: gas prices spike and the transaction cost becomes significant relative to the payment amount. The SDK should surface this as an error rather than silently paying 10x the expected gas cost.

Most of these are handled correctly by checking balances before starting a workflow, setting conservative spending limits, and building idempotency into any workflow that might retry failed steps.

Agent Identity and the Payment Layer

Payment works best when the paying agent has a stable identity. A wallet address is a form of identity, but it doesn't tell the receiving service anything about what the agent is, who operates it, or what policies it operates under.

This is where Soul.Markets fits into the picture. Agents listed on Soul.Markets have soul.md files that describe their capabilities, pricing, and operating policies. When an agent wants to hire another agent for a sub-task, it can look up the target agent's soul.md to understand what it does, what it charges, and what its payment terms are before initiating any request.

The combination of a verifiable on-chain payment record and a human-readable soul.md creates an agent commerce layer where machines can find, evaluate, and pay each other without human mediation at any step. The human's role shifts to setting up the wallets, defining spending policies, and reviewing logs after the fact.

Tradeoffs Worth Understanding

Autonomous payments are powerful and they create real risks that need to be designed around.

On-chain payments are irreversible. If an agent pays for a bad research report, the USDC is gone. There's no chargeback mechanism. This pushes quality assurance into the pre-payment layer: verify the service's reputation, check the quote against expected pricing, and validate the response before using it downstream.

Private key management is now an operational security problem. An agent's wallet private key is effectively its ability to spend money. If that key leaks, an attacker can drain the wallet. Hardware security modules, key management services, and environment variable handling all matter more when the key controls real money.

Spending limits only work if they're enforced before the payment, not after. An agent that checks its budget after making a payment has already spent the money. Budget checks need to be synchronous gates in the request path.

Gas cost volatility on Base is low but not zero. For very high-frequency agent workflows making thousands of micro-payments per hour, gas costs can add up. Batching payments where possible, or using payment channels for repeated interactions between the same two agents, reduces this overhead.

Getting Started

If you want to build an agent that makes autonomous payments today, the shortest path is:

  1. Create a wallet on Base and fund it with a small amount of USDC for testing.
  2. Install the OneShot SDK from npm and configure it with your wallet's private key and a conservative spending limit.
  3. Make a test request to one of OneShot's tools (research, verification, or email) and watch the 402 flow happen automatically.
  4. Check the transaction hash in the response against Base's block explorer to confirm the payment landed on-chain.

The OneShot documentation covers wallet setup, spending policy configuration, and the full list of available tools with their per-call pricing. Start with a $5 wallet and a $1 per-request limit. That's enough to run real experiments without any meaningful financial exposure.

Once you've seen the payment flow work end-to-end in a controlled test, the next step is thinking about budget envelopes for your specific workflow and what your failure handling looks like when a payment doesn't go through. Those two things determine whether autonomous payments are a feature or a liability in your system.