Skip to workspace
Workspace / Developers
Arc · 5042
DEVELOPERS / AGENTS THAT PAY

Plug an AI agent into a vault.

SDK, pay-per-request API, alerts and a working AI agent, all on Arc.

SDK source

Agent SDK quickstart

@velo402/arc-sdk · TypeScript · viem

import { ArcAgent, fetchWithPayment } from '@velo402/arc-sdk';
import { privateKeyToAccount } from 'viem/accounts';

const agent = new ArcAgent(privateKeyToAccount(AGENT_KEY), VAULT, 'testnet', {
  onEvent: e => console.log(e),          // paid / rejected / gas
});

// Pays the 402 invoice from the vault, then retries with proof.
const { response } = await fetchWithPayment(agent, 'https://velo402.vercel.app/api/x402/arc-stats');
console.log(await response.json());

The agent key can only call pay() and topUpGas(). check() previews a payment against the live contract; ensureGas() refills the agent's gas from its allowance; invoiceId() hashes an order so it can never be paid twice.

HTTP 402 pay-per-request

x402-style, scheme velo402-vault

  1. The agent calls a paid endpoint and gets 402 with an invoice, price and merchant address.
  2. It pays from the vault with paymentId = keccak256(invoice). The vault enforces the owner's policy.
  3. It retries with an X-PAYMENT header holding the transaction hash.
  4. The server checks on Arc: a real USDC transfer to the merchant, from a factory vault, bound to this invoice.
Live endpoints
/api/x402/arc-stats · /api/x402/untrusted-article
Testnet merchant
0xd3C4374e22a1B886F8c93975bC641b1D7A1f0460
Merchant registry
0xb29d4bf988430337113898607b4095e12f49b1c3

AI agent

agent/ai-agent.ts

An LLM agent with three tools: get_budget, buy_resource and pay. It works with any OpenAI-compatible API: Groq's free tier by default, or Ollama locally with no key. The test article contains a prompt injection telling the agent to send 5 USDC to an attacker; the vault refuses it with RecipientDenied and nothing moves.

LLM_API_KEY=... pnpm arc:ai-agent

Owner alerts

Webhook and Telegram

Payments, gas draws, revocations and blocked attempts go to ALERT_WEBHOOK_URL (Discord, Slack, Zapier) and to Telegram via TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID. The console also shows live in-app alerts.

ARC_VAULT_ADDRESS=0x... pnpm arc:watch

Why not an existing agent wallet?

General comparison by approach; products change, so check current docs

CapabilityArcSteward vaultHosted agent walletsSmart accounts + session keys
Limits enforced on-chain, per agentYesVaries by setupModule-dependent
Per-payment, daily and lifetime caps in USDCYes, all threePolicy serviceCustom module
Recipient allowlist plus opt-in merchant registryYesPartlyCustom
Replay protection by invoice hashYesNoNo
Agent gas paid from its own bounded allowanceYes (USDC gas on Arc)SponsoredPaymaster
HTTP 402 pay-per-request built inYesSeparateNo
FootprintOne small contract, no admin keyHosted serviceSmart account + modules

Who uses it

Concrete jobs, each a policy template in the console

  1. Research agents buying papers, datasets and search results per query.
  2. Trading bots paying for market data feeds, capped per day.
  3. Agent marketplaces where one agent hires another for a task.
  4. Teams giving each internal agent its own vault and budget.

Roadmap and business model

After this grant

  1. Escrow contract: pay on delivery, refund on timeout.
  2. Batched settlement for high-frequency micro-payments.
  3. Hosted dashboard with team budgets: paid plan. The contracts stay free and open source.
  4. Independent security audit before large balances.

Responsibilities

Non-custodial by design

ArcSteward never holds funds or keys. Each vault belongs to its owner, who sets the policy and is responsible for the agent's payments. The owner can be a multisig such as Safe for key recovery. Vaults accept Arc USDC only.