Call an x402 Endpoint
Use B3OS to pay for and call an x402 protected resource from a workflow.
Use this recipe when a workflow needs to call an API that requires x402 payment before returning a response.
Pattern
texttrigger -> prepare request -> call x402 protected resource -> process response -> notify or continue
x402 protected call
Action
Use the x402 action when you want a workflow node to handle payment and request execution.
json{ "type": "call-x402-protected-resource", "connector": { "type": "wallet", "id": "conn_wallet" }, "payload": { "url": "https://api.example.com/protected-resource", "method": "GET", "headers": {}, "body": {} }, "children": ["process_response"]}
x402 calls can spend value. Use a dedicated wallet, explicit limits, and monitoring before enabling fully automated production calls.
API Surfaces
| Task | Endpoint |
|---|---|
| List endpoints | GET /v1/x402-endpoints |
| Create an endpoint | POST /v1/x402-endpoints |
| Probe endpoint requirements | POST /v1/x402-endpoints/probe |
| Execute a paid call | POST /v1/x402-endpoints/execute |
| Test an endpoint | POST /v1/x402-endpoints/test |
