{"openapi":"3.1.0","info":{"title":"GraftXchange agent API","version":"1.0.0","description":"Search, verify and compare products across every connected store. Paid per call with x402 micropayments."},"servers":[{"url":"https://graftxchange-api.global-tenant-hosted.workers.dev"}],"components":{"securitySchemes":{"agentKey":{"type":"apiKey","in":"header","name":"x-agent-key"}}},"paths":{"/agent/v1/manifest":{"get":{"summary":"Discover the tools and their prices","responses":{"200":{"description":"Manifest"}}}},"/agent/v1/register":{"post":{"summary":"Register as an agent operator and receive an API key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"operatorName":{"type":"string"},"contactEmail":{"type":"string"},"walletAddress":{"type":"string","description":"Hex-encoded Ed25519 public key (32 bytes)"}},"required":["operatorName","contactEmail","walletAddress"]}}}},"responses":{"201":{"description":"Agent key issued"}}}},"/agent/v1/recovery/request":{"post":{"summary":"Request recovery of a lost agent key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"}},"required":["email"]}}}},"responses":{"200":{"description":"Generic recovery response"}}}},"/agent/v1/recovery/challenge":{"post":{"summary":"Read the wallet challenge from a valid recovery link","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"Recovery challenge"},"400":{"description":"Invalid or expired link"}}}},"/agent/v1/recovery/complete":{"post":{"summary":"Replace an agent key after wallet verification","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"signature":{"type":"string","description":"Hex Ed25519 signature"}},"required":["token","signature"]}}}},"responses":{"200":{"description":"Replacement key issued once"},"400":{"description":"Verification failed"}}}},"/agent/v1/demo/search":{"post":{"summary":"Free capped search, no key required","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"}},"required":["query"]}}}},"responses":{"200":{"description":"Up to five products"}}}},"/agent/v1/tools/search_products":{"post":{"summary":"Search live products across every connected store","description":"Paid tool. Price 5000 micro-USD per call. Call without payment headers to receive an HTTP 402 quote, then re-send with x-payment-nonce and x-payment-signature.","security":[{"agentKey":[]}],"responses":{"200":{"description":"Result rows"},"401":{"description":"Missing or invalid agent key"},"402":{"description":"Payment required — response carries the quote and nonce"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"category":{"type":"string"},"maxPrice":{"type":"number"},"inStockOnly":{"type":"boolean"},"limit":{"type":"integer"}},"required":["query"]}}}}}},"/agent/v1/tools/verify_inventory":{"post":{"summary":"Verify live stock and price for specific SKUs","description":"Paid tool. Price 10000 micro-USD per call. Call without payment headers to receive an HTTP 402 quote, then re-send with x-payment-nonce and x-payment-signature.","security":[{"agentKey":[]}],"responses":{"200":{"description":"Result rows"},"401":{"description":"Missing or invalid agent key"},"402":{"description":"Payment required — response carries the quote and nonce"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"skus":{"type":"array","items":{"type":"string"}}},"required":["skus"]}}}}}},"/agent/v1/tools/compare_products":{"post":{"summary":"Compare offers for one need across stores","description":"Paid tool. Price 20000 micro-USD per call. Call without payment headers to receive an HTTP 402 quote, then re-send with x-payment-nonce and x-payment-signature.","security":[{"agentKey":[]}],"responses":{"200":{"description":"Result rows"},"401":{"description":"Missing or invalid agent key"},"402":{"description":"Payment required — response carries the quote and nonce"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"limit":{"type":"integer"}},"required":["query"]}}}}}},"/mcp":{"post":{"summary":"Model Context Protocol endpoint (Streamable HTTP, JSON-RPC 2.0)","description":"Supports initialize, tools/list and tools/call. Same tools, same paid gate.","responses":{"200":{"description":"JSON-RPC response"}}}}}}