{"openapi":"3.1.0","info":{"title":"GradeClap Agent & ZDR Reading API","version":"0.2.0","description":"Stateless Zero-Data-Retention AI reading, scoped agent keys (gca1...), and Cloud MCP for GradeClap. Full student scans and rosters stay on the teacher's computer via @gradeclap/mcp; only anonymous crops reach this API."},"servers":[{"url":"https://api.gradeclap.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Scoped Agent Key (gca1.<slug>.<id>.<secret>) created in /kiosk, or a 12-hour session token."}}},"paths":{"/api/balance":{"get":{"operationId":"getBalance","summary":"Check remaining pool credits, teacher cap, and scoped agent-key cap.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Current balance and route credit rates."}}}},"/api/read":{"post":{"operationId":"postRead","summary":"Read an anonymous short-answer contact sheet, rubric page, or marking-scheme page over 0-day ZDR.","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"Optional idempotency key; identical retries within 24h return the settled reading for 0 extra credits."}],"responses":{"200":{"description":"ZDR AI reader output and settled credit count."},"409":{"description":"Idempotency-Key reused with a different request payload."}}}},"/api/agent-keys":{"get":{"operationId":"listAgentKeys","summary":"List scoped AI agent keys for the signed-in teacher (session token only).","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Agent keys."}}},"post":{"operationId":"createAgentKey","summary":"Create a scoped gca1... AI agent key with a credit limit (session token only).","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"One-time token and metadata."}}}},"/api/agent-keys/revoke":{"post":{"operationId":"revokeAgentKey","summary":"Revoke a scoped AI agent key immediately.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Revoked."}}}},"/mcp":{"post":{"operationId":"postMcp","summary":"Model Context Protocol (MCP Streamable HTTP JSON-RPC 2.0) endpoint for zero-PII cloud tools.","responses":{"200":{"description":"JSON-RPC 2.0 response."},"202":{"description":"Notification accepted."}}}}}}