THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

How to Test a Bitcoin AI Agent on Testnet with CURL

permalink THAMER
#bitcoin-ai-pay#curl#testnet#tool-calling

This tutorial uses the experimental BTC AI PAY chat interface. Start with read-only calls, then test rejection cases. Sending a valid transaction spends Testnet coins, so do not copy a send command until you deliberately intend to execute it.

Check service health

curl -sS http://127.0.0.1:7100/health | jq .

Confirm the reported provider and model. A successful health check proves the service responds; it does not prove SEND deduplication works.

Read the wallet balance

curl -sS -X POST http://127.0.0.1:7100/v1/btc/chat \
  -H 'Content-Type: application/json' \
  -d '{"message":"Balance?","net":"test","type":"segwit"}' | jq .

Inspect results[].tool for balance, then check the nested engine response under results[].result. Do not confuse the outer gateway ok with the engine's ok.

Read UTXOs

curl -sS -X POST http://127.0.0.1:7100/v1/btc/chat \
  -H 'Content-Type: application/json' \
  -d '{"message":"UTXOs?","net":"test","type":"segwit"}' | jq .

Check whether the returned UTXO values sum to the reported balance and whether any outputs are reserved. A consistent snapshot is not proof that the balance can fund every requested transaction; transaction construction has additional constraints.

Test a rejected send without spending

curl -sS -X POST http://127.0.0.1:7100/v1/btc/chat \
  -H 'Content-Type: application/json' \
  -d '{"message":"Send Bitcoin to tb1qexample","net":"test","type":"segwit"}' | jq .

This deliberately omits the amount. A safe agent should request the missing information or reject the tool call. The placeholder address is not a payment destination.

Review the evidence

Record tool selection, response times, explicit rejection codes, nested engine results, and transaction IDs for any separately authorized live tests. Never publish API keys, wallet authorization secrets, or private recovery material.

Related reading

  • /blog/bitcoin-ai-pay-agent-testnet-engineering-report/
  • /ask/why-does-bitcoin-ai-agent-require-request-id/

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects