Agent-to-Agent Payments
Orchestrator agents hiring sub-agents, paying for completed tasks, and settling value peer-to-peer — all without human approval at the transaction level.
The pattern
A common multi-agent architecture has one orchestrator agent that delegates tasks to specialized sub-agents and pays them upon completion. ClawdGo is the settlement layer for this pattern.
Each agent in the system has its own ClawdGo account. The orchestrator holds a funded balance. Sub-agents hold receiving accounts. When a sub-agent completes work, the orchestrator calls POST /v1/transfers to pay the sub-agent's account — peer-to-peer USDC, settled on Solana, no human in the loop.
Setup: two accounts, two roles
const client = new ClawdGo({ apiKey: process.env.CLAWDGO_OPERATOR_KEY });
// Orchestrator — funded, can send
const orchestrator = await client.accounts.create({
name: "orchestrator-prod"
});
await client.policy.update(orchestrator.account_id, {
max_single_transfer: 100,
max_daily_spend: 1000,
require_memo: true,
});
// Sub-agent — receives payments
const subAgent = await client.accounts.create({
name: "research-sub-agent-prod"
});
// No spending policy needed — this agent only receives
console.log("Sub-agent receives USDC at:", subAgent.usdc_token_account);
Paying a sub-agent on task completion
async function payForCompletedTask(taskId: string, agentAccountId: string, amount: string) {
const transfer = await orchestratorClient.transfers.create({
from: process.env.ORCHESTRATOR_ACCOUNT_ID,
to: agentAccountId, // ClawdGo account_id or raw SPL address
amount,
memo: `Task reward: ${taskId}`,
idempotency_key: `task-reward-${taskId}`, // deterministic — safe to retry
});
if (transfer.status === "settled") {
console.log(`Paid $${amount} USDC for task ${taskId}. Tx: ${transfer.tx_signature}`);
}
return transfer;
}
// In your orchestrator's task loop:
const result = await subAgent.executeResearchTask("Summarize earnings calls Q3");
if (result.completed) {
await payForCompletedTask("task-88", result.agentAccountId, "35.00");
}
Trust between agents
In the current model, agents trust each other at the application layer — ClawdGo handles settlement but not negotiation or verification. If you need a more formal commitment mechanism (e.g., the sub-agent should not get paid if it returns bad work), use application-level verification before calling payForCompletedTask.
Agentic freelance network pattern
A more complete version of this pattern where the orchestrator dynamically discovers and hires sub-agents:
// Sub-agents register their ClawdGo account IDs with a central coordinator
const subAgentRegistry = {
"research": "acct_03x1m7p9k2qrst4ab",
"code-review": "acct_04y2n8q0l3rsuv5cd",
"data-labeling": "acct_05z3o9r1m4stvw6ef",
};
async function hireAndPay(taskType: string, taskId: string, budget: string) {
const agentAccountId = subAgentRegistry[taskType];
// Dispatch task to agent (your application logic)
const result = await dispatchTask(taskType, taskId);
// Settle payment on ClawdGo
return orchestratorClient.transfers.create({
from: process.env.ORCHESTRATOR_ACCOUNT_ID,
to: agentAccountId,
amount: budget,
memo: `${taskType} task ${taskId}`,
idempotency_key: `${taskType}-${taskId}`,
});
}