# AgentProof integration guide

AgentProof is machine-paid evidence and provenance infrastructure for autonomous agents.

## Discovery
- MCP: https://agentproof.hatchable.site/mcp
- OpenAPI: https://agentproof.hatchable.site/openapi.json
- Capabilities: https://agentproof.hatchable.site/api/capabilities
- Pricing: https://agentproof.hatchable.site/api/pricing
- Agent manifest: https://agentproof.hatchable.site/agent.json
- Well-known manifest: https://agentproof.hatchable.site/.well-known/agentproof.json

## x402 flow
1. POST JSON to /api/paid/{tool}.
2. Without PAYMENT-SIGNATURE, AgentProof returns HTTP 402 and PAYMENT-REQUIRED.
3. Sign a compatible x402 v2 USDC payment on Base (eip155:8453).
4. Retry the same request with PAYMENT-SIGNATURE.
5. AgentProof asks its facilitator to verify the payment, runs the evidence tool, settles the payment, stores a durable receipt, and returns PAYMENT-RESPONSE plus JSON.
6. Save receipt.id and receipt.integrity_sha256 with the agent's downstream work.

The pay-to wallet is 0x999C4D4db5a6D884422848dEFC3B5356E678E91A.

## URL watches
watch_url costs 0.25 USDC and creates a 24-hour watch checked hourly. Pass:
```json
{"url":"https://example.com","webhook_url":"https://your-agent.example/webhooks/agentproof"}
```
webhook_url is optional. The response includes a private watch token and webhook secret. When content changes, AgentProof POSTs the event JSON with:
- x-agentproof-event-id
- x-agentproof-signature: sha256=<hex HMAC-SHA256 of the raw request body>

Poll status_url with the returned token for state and recent events.

## Receipt lookup
GET /api/receipts/{receipt_id}

Receipts expose tool, creation time, result, integrity hash and settlement transaction reference when available. Sensitive request details and watch secrets are not exposed by the public receipt lookup.

## Client helpers
- JavaScript: /sdk/agentproof.js
- Python: /sdk/agentproof.py

Both helpers accept a caller-supplied payment signer. AgentProof never needs the buyer's private key.

## Semantics
AgentProof proves what it independently retrieved, when it retrieved it, and the resulting fingerprint. Source presence, term overlap, or multiple matching pages are evidence signals, not a truth determination.