Hedera testnet

Connect your agent

Use h4o2 from your AI client to find APIs, read the Hedera x402 docs, and pay for calls you’ve approved.

Open agent settings

Connect your client

You’ll need a client that supports remote HTTP MCP with OAuth and a Hedera testnet account in HashPack.

MCP server URLhttps://api.h402.007575.xyz/mcp
Cursor
  1. Open Cursor’s MCP settings and add a custom MCP server. You can also edit ~/.cursor/mcp.json directly.
  2. Add the h402 entry under mcpServers. Keep any entries already there.
  3. Save the configuration and select Connect or Sign in next to h402 to open the browser.
Cursor MCP configuration
{
  "mcpServers": {
    "h402": {
      "url": "https://api.h402.007575.xyz/mcp"
    }
  }
}
Claude Code
  1. Run the command below in your terminal. User scope makes h402 available across your projects.
  2. Open Claude Code and run /mcp. Select h402 and authenticate in the browser.
Claude Code command
claude mcp add --transport http --scope user h402 'https://api.h402.007575.xyz/mcp'
Codex
  1. Run the add command. If a browser opens, continue there. If Codex asks you to authenticate later, run the sign-in command.
  2. Use /mcp in Codex to confirm h402 is connected.
Codex add command
codex mcp add h402 --url 'https://api.h402.007575.xyz/mcp'
Codex sign-in command
codex mcp login h402
Other MCP clients

Add a remote server named h402. Select Streamable HTTP, paste the server URL above, and start the browser authorization flow.

Set up your spending wallet

  1. In the browser, connect HashPack. Scan the WalletConnect QR code in HashPack mobile or copy the pairing link into your wallet. Select your Hedera testnet account and sign the h4o2 sign-in message, then return to your client.
  2. Ask your agent to run wallet_status. On first use, h4o2 creates a separate spending account and shows its address and stable h4o2 agent ID. Your HashPack account is the key to signing in. Its private key stays in HashPack.
  3. Send testnet USDC (token 0.0.429274) to the spending account from HashPack or use the Circle testnet faucet. Choose Hedera Testnet, then recheck the balance with wallet_status.
  4. Open Agent settings and save a total spending cap. Your wallet starts with a cap of zero. You can also manage approved endpoints and revoke individual client connections here.

Use the same Hedera account when you reconnect from another client. It opens the same agent, spending wallet, budget, and receipts.

Make your first paid call

  1. Ask the agent to find an API with search_services. Check the endpoint, price, and payout account against the marketplace.
  2. In Agent settings, approve the current endpoint version. The agent can read approvals but only you can change them.
  3. Ask the agent to call that service with a maximum price and an idempotency key. If settlement is pending, have it reuse the same key when it checks or retries.
  4. Ask for the result and HashScan receipt. Use recent_receipts to find it again in a later chat.
Example prompt
Find a knowledge-search API under 0.02 USDC. Show me the service ID, price, and payee so I can approve it in Agent settings. Wait for me before making the paid call.

Tools and resources

search_services
Find verified marketplace endpoints and inspect their price, payee, and input schema.
discover_facilitator_services
Browse the facilitator’s live Bazaar for Hedera testnet USDC endpoints. Use marketplace search to find a payable listing.
wallet_status
Get your agent ID, spending account, balance, funding instructions, and budget.
get_spending_policy
Check which endpoint versions you’ve approved and get the settings link.
call_service
Call a verified API with your price cap and payment policy. Returns the API result and, after settlement, a receipt.
recent_receipts
Find settled purchases from this session or earlier sessions, with HashScan links.
get_h402_docs
Read the bundled buyer, merchant, or facilitator guide inside your client.

The agent can read the buyer, merchant, and facilitator guides as MCP resources or through get_h402_docs. Try “Read the facilitator guide and explain how I can verify a receipt in HashScan.”

Building an API? Ask for the build_h402_endpoint prompt. It loads the merchant and facilitator guides together, including payment quotes, Bazaar metadata, and listing activation.

Troubleshooting

Sign-in doesn’t open
Check the server URL ends in /mcp and use your client’s authenticate action. If this is a self-hosted market, ask the operator to enable WalletConnect OAuth.
The wallet won’t pair
Check that you selected a Hedera testnet account. Start a fresh browser connection if the QR code or sign-in request expired.
Payment is blocked
Check the testnet USDC balance, remaining budget, and current endpoint approval. An updated endpoint needs a fresh approval.
A payment is pending
Keep the original idempotency key and check again. Creating a new key may start a new purchase.