{"openapi":"3.1.0","info":{"title":"Grant Zero-Wrapper API","version":"0.1.0","description":"Consent infrastructure for AI agents. API keys are Bearer gr_live_... strings. Credential-less calls are limited to 20/hour per hashed IP. Every HTML screen carries: Grant never sees your credentials or payment details. It only records what you allowed."},"servers":[{"url":"https://grant-approve.vercel.app"}],"tags":[{"name":"Discovery","description":"Machine-readable contract and MCP setup."},{"name":"Gate","description":"Zero-wrapper agent approval gate."},{"name":"Receipts","description":"Public signed Magic Receipts."}],"paths":{"/openapi.json":{"get":{"tags":["Discovery"],"summary":"This OpenAPI 3.1 document","operationId":"getOpenApi","responses":{"200":{"description":"Success. Public responses never include credentials, raw PII, or scope values.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/openapi.json":{"get":{"tags":["Discovery"],"summary":"Aliased OpenAPI 3.1 document","operationId":"getOpenApiAlias","responses":{"200":{"description":"Success. Public responses never include credentials, raw PII, or scope values.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/mcp":{"get":{"tags":["Discovery"],"summary":"Browser setup card for the MCP endpoint","operationId":"mcpSetup","responses":{"200":{"description":"MCP setup HTML","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["Discovery"],"summary":"MCP JSON-RPC (initialize, tools/list, tools/call)","operationId":"mcpRpc","security":[{"GrantLiveKey":[]},{}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"JSON-RPC result or error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}},"429":{"description":"Hard gate, invalid request, or demo limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantError"}}}}}}},"/v1/gate/webhook":{"post":{"tags":["Gate"],"summary":"Create a human checkpoint (or apply an active rule first)","operationId":"gateWebhook","security":[{"GrantLiveKey":[]},{}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GateRequest"}}}},"responses":{"201":{"description":"Success. Public responses never include credentials, raw PII, or scope values.","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Success. Public responses never include credentials, raw PII, or scope values.","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Hard gate, invalid request, or demo limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantError"}}}},"403":{"description":"Hard gate, invalid request, or demo limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantError"}}}},"429":{"description":"Hard gate, invalid request, or demo limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantError"}}}}}}},"/v1/approvals":{"post":{"tags":["Gate"],"summary":"Unified approval checkpoint for gateways and framework adapters","operationId":"createApproval","security":[{"GrantLiveKey":[]},{}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GateRequest"}}}},"responses":{"201":{"description":"Success. Public responses never include credentials, raw PII, or scope values.","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Success. Public responses never include credentials, raw PII, or scope values.","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Hard gate, invalid request, or demo limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantError"}}}},"403":{"description":"Hard gate, invalid request, or demo limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantError"}}}},"429":{"description":"Hard gate, invalid request, or demo limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantError"}}}}}}},"/v1/approvals/{request_id}":{"get":{"tags":["Gate"],"summary":"Poll one approval and its signed receipt","operationId":"getApproval","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Public responses never include credentials, raw PII, or scope values.","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Hard gate, invalid request, or demo limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantError"}}}}}}},"/v1/receipts/verify":{"post":{"tags":["Receipts"],"summary":"Verify a signed Grant receipt","operationId":"verifyReceipt","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiptVerifyRequest"}}}},"responses":{"200":{"description":"Success. Public responses never include credentials, raw PII, or scope values.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/receipt/{req_id}":{"get":{"tags":["Receipts"],"summary":"Public HMAC-signed Magic Receipt","operationId":"getReceipt","parameters":[{"name":"req_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Magic Receipt HTML","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"Hard gate, invalid request, or demo limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantError"}}}}}}}},"components":{"securitySchemes":{"GrantLiveKey":{"type":"http","scheme":"bearer","bearerFormat":"gr_live_","description":"A live Grant API key. Omit it for the 20/hour demo mode."}},"schemas":{"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","integer","null"]},"method":{"type":"string"},"params":{"type":"object"}},"required":["jsonrpc","method"]},"JsonRpcResponse":{"type":"object","properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","integer","null"]},"result":{"type":"object"},"error":{"type":"object"}}},"GateRequest":{"type":"object","properties":{"agent":{"type":"string"},"action":{"type":"string"},"summary":{"type":"string"},"scope":{"type":"object"},"workspace":{"type":"string"},"callback_url":{"type":"string"},"callback_secret":{"type":"string"}},"required":["agent","action","summary"],"description":"Aliases agent_name/tool_name/reason/why are accepted."},"ReceiptVerifyRequest":{"type":"object","properties":{"signed_receipt":{"type":"string","minLength":1,"maxLength":8000},"request_id":{"type":"string","maxLength":120}},"required":["signed_receipt"],"description":"Only the signed, minimal receipt is checked; no scope values are returned."},"GrantError":{"type":"object","properties":{"detail":{"type":"object","properties":{"error":{"type":"string"},"required_tier":{"type":"string"},"code":{"type":"string"}}}}}}},"x-grant":{"demo_limit_per_hour":20,"callback_max_retries":2,"cors":"Public integration paths send Access-Control-Allow-Origin: *.","privacy":"No credentials, payment details, raw scope values, or raw PII are returned."}}