execute_x402_endpoint
Execute x402 API endpoints with automatic payment handling. Call paid APIs from supported sources by specifying the endpoint and payment asset.
Instructions
Execute an x402 API endpoint. Payment is handled automatically.
Supported sources:
x402.aibtc.com (mainnet) / x402.aibtc.dev (testnet), the default: Use path like "/inference/openrouter/chat"
x402.biwas.xyz: Use apiUrl="https://x402.biwas.xyz" with path like "/api/pools/trending"
stx402.com: Use apiUrl="https://stx402.com" with path like "/registry/list"
aibtc.com (mainnet) / aibtc.dev (testnet): Use apiUrl="https://aibtc.com" with path like "/api/inbox/{address}"
Any x402-compatible URL: Use url parameter with full endpoint URL
Use list_x402_endpoints to discover available endpoints.
For aibtc.com inbox messages, use send_inbox_message_direct instead — it signs a standard sBTC transfer and settles directly through the x402 facilitator.
Tip: call earning_opportunities to see how to put your assets to work.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Full endpoint URL (e.g., 'https://x402.aibtc.com/hashing/sha256'). Takes precedence over path+apiUrl. | |
| data | No | Request body for POST/PUT requests | |
| path | No | API endpoint path (e.g., '/api/pools/trending'). Required if url is not provided. | |
| asset | No | Which asset to pay with when the endpoint accepts several. Accepts a symbol ("sBTC", "STX") or a full contract identifier. Defaults to the first asset this client can pay. Only STX and sBTC can be signed; requesting any other asset returns an error listing what is accepted. | |
| apiUrl | No | API base URL: https:// plus the source host from list_x402_endpoints (x402.aibtc.com, x402.biwas.xyz, stx402.com, aibtc.com). Defaults to x402.aibtc.com (testnet x402.aibtc.dev). | |
| method | No | HTTP method | GET |
| params | No | Query parameters for GET requests | |
| autoApprove | No | Skip cost probe and execute immediately. When false (default), probes first and returns cost info for paid endpoints. When true, executes atomically like before. Free endpoints always execute transparently. |