1. Connect your client
Add a remote MCP server in a client that supports Streamable HTTP. Use this exact endpoint:
https://datoka-api.bhazarstudio.workers.dev/mcp
The endpoint is a protocol address, not a webpage. Opening it in a browser can return 405; connect through MCP instead. Let the client initialize, list the tools and read their schemas before calling them.
2. Complete the first operation
Use the provider SDK to hash the actual URL, selected headers and exact request/response bytes locally. Call prepare_api_exchange for free validation.
Instructions you can give your agent
Connect to Datoka API, list its tools and explain the input for prepare_api_exchange. Use real captured bytes if available; do not invent hashes or authorize payment.
3. Check the price before approval
Signed HTTP exchange declaration: 0.002 USDC
One receipt; preparation and verification are free.
4. Keep and verify your result
Keep the event, idempotency key and original authorization. Retry the same purchase to retrieve its receipt without requesting a new purchase. Verify the signature and expected context.
If something goes wrong
A 402 response is a price request, not a completed payment. A 415 means the request body or media type is wrong. An HTTP 200 MCP response may still contain a tool error: inspect isError and the result.
For HTTP, use the status and structured error body. For MCP, inspect the tool result as well as the transport status. Do not retry a paid operation with a new identifier while the original payment is unresolved.