Tutorial · Build on Arc
READING TIME ~18 minLEVEL BeginnerUPDATED May 2026
A friendly tutorial · zero prior crypto knowledge needed

Build an AI agent that can spend money, on Arc.

You’re going to give an AI agent a wallet, fund it with a few test dollars, and watch it pay for an API call on its own: no signups, no credit cards, no API keys. We’ll use Circle’s Agent Stack on the Arc network, and we’ll go slowly. Every command is explained.

You'll write
~15commands
You'll spend
$0.00testnet
You'll need
Node 20+
By the end
A live agent
00 / Primer

Three things to know before we start.

If any of these feel fuzzy, that's fine. We'll come back to them as we go; for now, just skim.

CONCEPT 01

An AI agent is just a program that takes actions.

It reads instructions, picks a tool, calls the tool, and decides what to do next. Until recently, agents could only do free stuff. We’re about to fix that.

CONCEPT 02

Arc is a blockchain built for payments.

Think of it as a fast, cheap settlement layer where money (specifically USDC, a stablecoin pegged to the US dollar) moves in fractions of a second. Your agent will use it as its bank.

CONCEPT 03
$ circle

Agent Stack is your toolbox.

A command-line tool (circle), a wallet system, a marketplace of paid APIs, and some skills for your AI. You give one prompt; the stack handles the plumbing.

01 / What you'll build

An agent that pays $0.01 to answer a question it couldn't before.

Specifically: you'll prompt your agent to research a topic. It will discover a paid research API, pay a few cents in USDC from its own wallet, and bring back an answer with sources.

The end-state, in seven steps.

Each step is small. Most are one command. By the end you’ll have a working agent and, more importantly, a mental model for how this all fits together.

  • 01 Install the Circle CLI 2 min
  • 02 Sign in & create a wallet on Arc 3 min
  • 03 Fund the wallet from the testnet faucet 1 min
  • 04 Set spending guardrails (mainnet) 3 min
  • 05 Install Circle skills into your AI tool 2 min
  • 06 Pay for your first x402 API call 4 min
  • 07 Inspect transaction history 4 min
~/my-first-agent · circle
$circle wallet balance —address 0xa1f3…2c89 —chain ARC-TESTNET
balance: 5.00 USDC
$circle services pay https://api.example.com/search \
—address 0xa1f3…2c89 —chain ARC-TESTNET —max-amount 0.05
→ inspecting payment requirements…
→ paying via x402… paid 0.022 USDC ✓
→ response 200 OK (1.4 kb)
$
A note on money

We’ll use testnet USDC (fake money for testing) for this whole tutorial. You won’t spend a real cent. When you’re ready to deploy for real, you swap one flag and your agent uses real USDC. Nothing else changes.

01
Install the CLI
2 minutes

Get the circle command on your machine.

The Circle CLI is a single tool you’ll talk to from your terminal. It manages wallets, installs “skills” (knowledge packs) for your AI, and connects to the rest of Circle’s products. You’ll need Node.js v20.18.2 or later installed first.

Open a terminal (Terminal.app on Mac, or whatever you use on Windows/Linux) and run:

terminal

$ npm install -g @circle-fin/cli

That installs the circle command globally. Confirm it worked:

terminal

$ circle —version

// what just happened

npm pulled the Circle CLI from the public package registry and installed it as a system-wide command. From this point on, your shell knows circle as a binary you can call from anywhere.

On first use, Circle CLI will prompt you to accept its Terms of Use. If you want to handle this non-interactively (for scripts), run circle terms accept.

First time using a terminal?

The $ isn’t something you type. It’s just the prompt symbol your terminal shows you. Type only what comes after it, then press Enter.

Checkpoint. circle —version prints a version number. If it does, move on.
02
Create the wallet
2 minutes

Sign in and create a wallet on Arc.

Agent wallets authenticate by email OTP: Circle emails you a one-time code, you paste it in, and a wallet session is created for you. We’ll do this on testnet first, where everything is free.

terminal

$ circle wallet login you@example.com —testnet

Check your inbox, paste the OTP when prompted. Your first agent wallet is provisioned automatically. Now create an additional named wallet for this tutorial:

terminal

$ circle wallet create —type agent —testnet

List your wallets on Arc testnet to grab the address you just made:

terminal

$ circle wallet list —chain ARC-TESTNET —type agent

Copy the address (the 0x… string). That’s your wallet’s public ID (like an email address for money), and you’ll pass it as —address in every command from here on.

You
prompt
AI Agent
decides
Wallet on Arc
pays
// what just happened

Circle created a managed wallet record on Arc testnet and bound it to your email session. The wallet has a public address (where money is received) but the spending key is held by Circle and only released when you authenticate: same pattern as a custodial exchange account.

Why is this called an "agent wallet"?

It’s a managed wallet your AI agent can use directly through the CLI, without you typing passwords each time. On mainnet, Circle’s compliance and policy controls apply to every transaction (see Step 4).

03
Fund it
1 minute

Auto-fund the wallet from the testnet faucet.

On testnet, Circle automatically tops your wallet up from a faucet. No amount or method needed. One command:

terminal

$ circle wallet fund {‘\n’} —address 0xYOUR_ADDRESS {‘\n’} —chain ARC-TESTNET

Replace 0xYOUR_ADDRESS with the address you copied in Step 2. Now check your balance:

terminal

$ circle wallet balance {‘\n’} —address 0xYOUR_ADDRESS {‘\n’} —chain ARC-TESTNET

For mainnet (real money), use —method crypto to fund from another wallet, or —method fiat to use the onramp provider, and pass —amount with the dollar value you want to deposit.

Checkpoint. Balance command reports more than 0 USDC.
04
Guardrails (mainnet)
3 minutes

Tell the wallet what it’s not allowed to do.

This step is the most important one in the whole tutorial, but a heads-up: spending policies are mainnet-only. On testnet you don’t need them (it’s play money). When you graduate to real USDC, set hard caps the wallet enforces no matter what the agent decides.

The command sets per-tx, daily, weekly, and monthly transfer caps. Limits must satisfy per-tx ≤ daily ≤ weekly ≤ monthly:

terminal · mainnet

$ circle wallet limit set {‘\n’} —address 0xYOUR_ADDRESS {‘\n’} —chain ARC {‘\n’} —policy-type stablecoin {‘\n’} —per-tx 0.50 {‘\n’} —daily 5 {‘\n’} —weekly 20 {‘\n’} —monthly 50

Setting a limit triggers a second email OTP for confirmation. You can also constrain who the wallet can pay (recipient-allowlist) or which contracts it can call (contract-allowlist):

terminal · mainnet

$ circle wallet limit set {‘\n’} —address 0xYOUR_ADDRESS {‘\n’} —chain ARC {‘\n’} —policy-type stablecoin {‘\n’} —rule-type recipient-blocklist {‘\n’} —targets "[0xBAD1,0xBAD2]"

Check your remaining budgets any time:

terminal · mainnet

$ circle wallet limit budget —address 0xYOUR_ADDRESS

// what just happened

You wrote enforcement rules into the wallet itself. From this point, every outbound transfer is checked against these limits before it touches the chain. A misbehaving agent can request a $1,000 transfer all day; the wallet will reject it without ever broadcasting.

Read this twice

These limits are enforced by Circle, not by the AI. Even if the agent tries to spend more, the transaction is rejected. Skip this step on testnet; come back to it before you ever fund the wallet with real USDC.

05
Connect your AI
2 minutes

Bolt Circle skills onto your AI coding tool.

The Agent Stack works with Claude Code, Cursor, Codex, and other agent frameworks. “Skills” are open-source knowledge packs (from the circlefin/skills catalog) that teach your AI how to use Circle’s tools.

List available skills, then install them into your framework of choice. We’ll use Claude Code:

terminal

$ circle skill list

terminal

$ circle skill install —tool claude-code

Omitting —name installs every available skill. You can target multiple frameworks at once by repeating the flag: —tool claude-code —tool cursor.

Restart your AI tool (close and reopen Claude Code), then ask it:

claude-code

> What’s in my Circle wallet on Arc testnet?

It’ll run the right circle wallet balance commands under the hood and report back.

Checkpoint. Your AI can read the wallet. We’re ready for the fun part.
06
First paid task
4 minutes

Discover and pay for a paid API.

Most useful research APIs cost money. That’s why your AI normally hits a wall and says “I can’t access the internet.” The Agent Stack has two commands for this: circle services search to find services in the marketplace, and circle services pay to actually call one.

Search the marketplace for web-search services:

terminal

$ circle services search “web search” {‘\n’} —category WEB_SEARCH_RESEARCH {‘\n’} —limit 10

Inspect what a specific service will charge before you pay:

terminal

$ circle services inspect https://api.example.com/search

Now pay for the call. The —max-amount flag is your safety net: the CLI refuses to pay more than that in USDC, no matter what the service quotes:

terminal

$ circle services pay https://api.example.com/search {‘\n’} —address 0xYOUR_ADDRESS {‘\n’} —chain ARC-TESTNET {‘\n’} —max-amount 0.05 {‘\n’} -X POST {‘\n’} -d '{"q":"top open-source vector databases 2026"}'

// what just happened

The CLI made a normal HTTPS request, got back an HTTP 402 Payment Required with a price quote, paid that amount in USDC from your wallet on Arc, then re-sent the same request, this time with proof of payment in the headers. The server saw the proof and responded 200 OK with the data. Three round-trips, one command, one charge.

From your AI tool, you can just ask: “Research X using a paid search service. Spend up to $0.05.” The skills installed in Step 5 will do this automatically.

What is x402?

x402 is the HTTP protocol used here. A server replies 402 Payment Required with a price; the client pays in USDC and retries, getting 200 OK. Normal HTTP, with money built in. If payment fails, debug logs land at ~/.circle-cli/payments/.

07
Inspect
4 minutes

See exactly what your agent spent, and where.

Every payment your agent made is recorded on Arc. List the transaction history for your wallet:

terminal

$ circle transaction list {‘\n’} —address 0xYOUR_ADDRESS {‘\n’} —chain ARC-TESTNET {‘\n’} —limit 10

Filter by direction or state if you want just the paid calls:

terminal

$ circle transaction list {‘\n’} —address 0xYOUR_ADDRESS {‘\n’} —chain ARC-TESTNET {‘\n’} —operation transfer {‘\n’} —tx-type outbound {‘\n’} —state confirmed

You can also open console.circle.com in a browser, sign in, and see the same activity in a dashboard. Both views show the same truth.

Going to production?

Three changes: (1) sign in without —testnet, (2) fund with —method crypto or —method fiat and a real amount, (3) set your circle wallet limit set policies before funding. The CLI commands otherwise stay identical: swap ARC-TESTNET for ARC.

∎ / Recap

That's the whole loop.

You set up a wallet, locked it down, attached it to an AI, and watched the AI pay for something useful. Everything else you build from here is a variation on those four moves.

Wallet
Holds the money. Enforces the rules.
Policy
Caps spend per call, per day, per service.
Skills
Teach your AI how to use the wallet.
x402
The protocol that turns HTTP into a checkout.