AI agents on Solana

What do you want your agent to do?

Your agent can pay for APIs in stablecoins, write Solana code from current docs, and charge other agents for its work. Choose a job to get the command that sets it up.

Your agentPaid API
  1. Request
  2. 402 Payment Required
  3. Payment signed
  4. 200 OK

Your agent calls paid APIs and settles each call in stablecoins on Solana, after you approve it.

Pay.sh

Pay.sh is a command-line payment client that pays for APIs on your agent's behalf, using a wallet the agent never sees.

1. Install Pay on macOS
brew install pay

On Linux or Windows, download pay from the latest release. Download a release

2. Start Claude Code with Pay
pay claude

Starts Claude Code with Pay's payment tools attached.

Add --sandbox, as in pay --sandbox claude, to try it with test funds first.

What you getYour agent can call paid APIs, including those in the Pay.sh catalog, and asks you to approve each payment.

x402

x402 is an open payment protocol: the server answers an unpaid request with 402 Payment Required, and the client retries with a signed stablecoin payment.

What you getYou can build an x402 client or resource server on Solana.

MPP

The Machine Payments Protocol (MPP) carries payment challenges, credentials, and receipts in standard HTTP authentication headers, for one-time charges or metered sessions.

What you getYou know how MPP charges and sessions work on Solana and when to use them over x402.

Prompts

Give your agent a first task

Copy a prompt into your agent once it is set up. Selecting one plays its request and payment steps in the diagram.

  • Get a stock quote

    Prompts
    Use Pay to get the latest AAPL quote from https://debugger.pay.sh/mpp/quote/AAPL. Show me the price before you pay, and make no other paid requests.
  • Find a paid API

    Prompts
    Search the Pay.sh catalog for a maps API. List the options with their price per call, then wait for me to pick one before you make any request.
  • Write a token script

    Prompts
    Use the Solana MCP server to look up how to create a token with the Token Extensions program, then write a TypeScript script that creates one on devnet.
  • Register this agent

    Prompts
    Read https://8004.qnt.sh/skill.md and walk me through registering this agent in the Solana Agent Registry. Show me the cost before you sign anything.
  • Charge for my API

    Prompts
    Use Pay to scaffold a paywall.yml that charges $0.01 per request for GET /api/v1/reports/usage, then start it with pay --sandbox gate api so I can test a paid request.

Control

You keep the keys and approve the payments

These rules apply on every path where Pay.sh moves money.

Who holds the keys

pay setup creates the wallet in your OS secure store: macOS Keychain, GNOME Keyring, Windows Hello, or 1Password. The agent calls Pay's tools and never receives the private key.

What needs approval

Every real payment needs your local approval, such as Touch ID on macOS or Windows Hello. If you reject the prompt, the payment is not signed and the request stops.

Limits

For an agent that runs unattended, start pay mcp with --max-payment, --allow-origin, and --allow-network, or a permissions file, to cap each payment and restrict where it can pay.

Cost

Each API sets its own price per call, and Pay shows the amount before you approve. Payments settle in stablecoins on Solana, and --sandbox uses test funds.


Questions about agents on Solana



Go deeper on agent payments

The payments docs cover x402, MPP, and Pay.sh with runnable examples. solana.ai lists the Solana Foundation's AI programs.

© 2026 Solana Foundation. Tutti i diritti riservati.