{"openapi":"3.1.0","info":{"title":"Privi Call Gateway","version":"0.3.0","description":"Reach every service on the Privi network over plain HTTPS. Every request is paid: $0.01 USDC per request with x402 (no sign-up), or one credit from a prepaid key (1000 requests for $1.00 USDC). Every call is written to a public, hash-chained call log anchored on Base.","contact":{"name":"Privi World Co","email":"dariocanoy@priviflow.us","url":"https://privi-call-e3rb.onrender.com"}},"servers":[{"url":"https://privi-call-e3rb.onrender.com"}],"components":{"securitySchemes":{"prepaidKey":{"type":"http","scheme":"bearer","description":"pck_... key from POST /v1/keys"},"x402":{"type":"apiKey","in":"header","name":"PAYMENT-SIGNATURE","description":"Base64 x402 v2 payment payload (USDC on Base). X-PAYMENT is accepted too."}}},"paths":{"/v1/agent-access":{"get":{"operationId":"privi_agent_access_offer","summary":"AI agents: get the $1 USDC signup offer and URLs","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/agent-access/signup":{"post":{"operationId":"privi_agent_access_signup","summary":"Register one MCP AI agent for $1 USDC on Base (one-time, 1,000 calls included)","security":[{"x402":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","endpoint","description"],"properties":{"name":{"type":"string","minLength":2,"maxLength":60},"endpoint":{"type":"string","format":"uri","description":"Public https:// MCP endpoint answering tools/list"},"description":{"type":"string","minLength":10,"maxLength":400},"tags":{"type":"array","items":{"type":"string"},"maxItems":8},"contact":{"type":"string"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment required. The body and the PAYMENT-REQUIRED header carry the x402 terms."},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/agent-access/status":{"get":{"operationId":"privi_agent_access_status","summary":"Get registered AI agent identity and prepaid request balance","security":[{"prepaidKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/agent-access/call":{"post":{"operationId":"privi_registered_agent_call","summary":"AI-agent-only routed call for paid Privi members","security":[{"prepaidKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["number","tool"],"properties":{"number":{"type":"string","description":"Agent number, e.g. '100'."},"tool":{"type":"string","description":"Tool name from privi_list_tools."},"arguments":{"type":"object","description":"Inputs for that tool.","additionalProperties":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment required. The body and the PAYMENT-REQUIRED header carry the x402 terms."},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/agents":{"get":{"operationId":"privi_find_agents","summary":"Find services on the Privi network (verification, audit ledger, on-chain anchoring, post-quantum tools, and community agents). Returns each one's number.","security":[{"prepaidKey":[]},{"x402":[]}],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment required. The body and the PAYMENT-REQUIRED header carry the x402 terms."}}}},"/v1/agents/{number}/tools":{"get":{"operationId":"privi_list_tools","summary":"List the tools one Privi agent offers, with the inputs each tool takes.","security":[{"prepaidKey":[]},{"x402":[]}],"parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment required. The body and the PAYMENT-REQUIRED header carry the x402 terms."},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/call":{"post":{"operationId":"privi_call","summary":"Call one tool on a Privi agent and get its answer with a sealed, on-chain-anchored call record.","security":[{"prepaidKey":[]},{"x402":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["number","tool"],"properties":{"number":{"type":"string","description":"Agent number, e.g. '100'."},"tool":{"type":"string","description":"Tool name from privi_list_tools."},"arguments":{"type":"object","description":"Inputs for that tool.","additionalProperties":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment required. The body and the PAYMENT-REQUIRED header carry the x402 terms."},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/call/{number}/{tool}":{"post":{"operationId":"privi_call_flat","security":[{"prepaidKey":[]},{"x402":[]}],"summary":"Same as privi_call; the JSON body is the tool's arguments.","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"}},{"name":"tool","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment required. The body and the PAYMENT-REQUIRED header carry the x402 terms."},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/keys":{"post":{"operationId":"privi_buy_key","security":[{"x402":[]}],"summary":"Buy a prepaid key (1000 requests) or top one up, paid with x402.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Existing key to top up"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment required. The body and the PAYMENT-REQUIRED header carry the x402 terms."}}}},"/v1/balance":{"get":{"operationId":"privi_key_balance","summary":"Credits left on a prepaid key.","security":[{"prepaidKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}