Datoka Agent
Signed receipts for agent execution declarations.
0.002 USDC per receipt ยท Free verification
MCP endpoint: https://datoka-agent.bhazarstudio.workers.dev/mcp (POST)
# Datoka Agent
Signed receipts for declared AI-agent executions. Launch price: 0.002 USDC per receipt on Base (eip155:8453). No subscription.
A receipt proves a signed declaration and integrity; it does not independently observe execution or establish result correctness. Receipts are not blockchain-anchored.
## Endpoints
- Service: https://datoka-agent.bhazarstudio.workers.dev
- OpenAPI: https://datoka-agent.bhazarstudio.workers.dev/openapi.json
- Catalogue: https://datoka-agent.bhazarstudio.workers.dev/catalog
- Pricing: https://datoka-agent.bhazarstudio.workers.dev/pricing
- Streamable HTTP MCP: https://datoka-agent.bhazarstudio.workers.dev/mcp
- Public keys: POST https://datoka-agent.bhazarstudio.workers.dev/v1/operations/get_agent_public_keys with {}
- POST /v1/operations/prepare_agent_event: free. Validate an agent execution declaration and compute its commitment. Does not create a receipt.
- POST /v1/operations/issue_agent_receipt: 0.002 USDC. Persist a signed execution declaration receipt. Public price: 0.002 USDC via x402 on the advertised network. Preserve event, idempotencyKey and payment authorization on retries. Signed declarations do not independently prove execution.
- POST /v1/operations/verify_agent_receipt: free. Verify the declaration against a trusted Datoka receipt. A valid signature does not independently prove the action occurred.
- POST /v1/operations/get_agent_public_keys: free. Return public keys of this issuer. The operator must establish trust in this issuer independently.
## First free request
```sh
curl -sS 'https://datoka-agent.bhazarstudio.workers.dev/v1/operations/get_agent_public_keys' -H 'Content-Type: application/json' -d '{}'
```
## Connect directly over MCP
Add this remote Streamable HTTP server URL in your MCP client: https://datoka-agent.bhazarstudio.workers.dev/mcp
No account or API key is required for the three free tools. Call get_agent_public_keys with {} to test the connection.
Client configuration example: https://datoka-agent.bhazarstudio.workers.dev/mcp.json (clients may require their own JSON format).
Paid issuance requires an x402-capable client with its own wallet; adding the MCP URL alone does not enable spending.
HTTP discovery manifest: https://datoka-agent.bhazarstudio.workers.dev/.well-known/x402
## Buying a receipt
1. Compute JCS/SHA-256 hashes of inputs and outputs locally. Never send raw prompts or outputs.
2. POST {event,idempotencyKey} to /v1/operations/issue_agent_receipt. See OpenAPI for the strict event schema.
3. Read the HTTP 402 and PAYMENT-REQUIRED header. Check exact scheme, Base chain, native USDC, amount <= 2000 atomic units and the payTo address below.
4. Use an EOA wallet funded with native USDC on Base to sign the EIP-3009 authorization, off-chain. Smart wallets and Permit2 are not supported by this service.
5. Persist the complete event, idempotencyKey AND original payment payload privately before submitting PAYMENT-SIGNATURE.
6. Save the returned receipt AND PAYMENT-RESPONSE. Verify the receipt with the free verifier or locally against a trusted public key.
7. If a response is lost, retry the SAME stored purchase. Never create a replacement signature or idempotency key automatically, even after expiry. payment_pending requires recovery, not a new charge.
Native USDC: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Authorized recipient: 0x4a7A972F84E2A64b3B9B64AC1383Df5c413c0E59
For MCP, payment is in params._meta["x402/payment"], confirmation in result._meta["x402/payment-response"]. A tool result with isError=true is an error even with HTTP 200.
## Runnable client
Download https://datoka-agent.bhazarstudio.workers.dev/example.mjs. Install Node 24+ and run:
```sh
npm install @x402/core@2.27.0 @x402/evm@2.27.0 viem@2.57.0
node example.mjs
```
This default command only requests a free price quote. To purchase once, set DATOKA_TEST_PRIVATE_KEY_FILE to a private JSON file containing a test wallet's privateKey, and DATOKA_PURCHASE_STATE to a new private file path in an existing directory. Then run node example.mjs --buy --approve-one-purchase. Never use your personal wallet seed. The example caps the purchase at 0.002 USDC, persists the authorization before submission and reuses the same state on retry. Back up the private state; do not delete it after a timeout.
The operator distribution also provides examples/purchase.ts for a dedicated test wallet and independent local signature verification.
## Errors
400: invalid event; correct the request before paying.
402: payment required or rejected; inspect the offer/error, do not loop blindly.
409: request/authorization conflict; retain the original purchase.
429: rate/quota limit; wait before retrying the same request.
503/payment_pending: settlement outcome uncertain; retain and resume original purchase only.
503/payment_gateway_unavailable: payment provider unavailable; retain original purchase.
Verification is free. Replayed paid receipts do not incur a new charge. Third-party funding/withdrawal fees are separate from the receipt price.