CLI tool for fetching URLs with automatic payment handling.
pip install -e .# GET request
fetch https://api.example.com/resource
# POST with body
fetch -X POST -d '{"query": "test"}' https://api.example.com/search
# PUT request
fetch -X PUT -d '{"name": "updated"}' https://api.example.com/resource/123
# DELETE request
fetch -X DELETE https://api.example.com/resource/123Provide credentials via flags:
fetch --key 0x... https://api.example.comOr via environment variables:
export TEMPO_PRIVATE_KEY=0x...
fetch https://api.example.com/resourceOptionally override the RPC URL (defaults to rpc.testnet.tempo.xyz):
fetch --key 0x... --rpc-url https://rpc.testnet.tempo.xyz/ https://api.example.comWhen a request returns 402 Payment Required:
- The client parses the
WWW-Authenticateheader to get the payment challenge - Creates a credential by executing the payment on Tempo
- Retries the request with the
Authorizationheader
This happens automatically via the Machine Payments Protocol client wrapper.