{"openapi":"3.1.0","info":{"title":"Axis' Iliad API","version":"0.5.2","description":"Axis' Iliad provides AI-powered code analysis, context mapping, and multi-program file generation. Submit a codebase snapshot and AXIS produces tailored configuration files, analysis reports, and generator outputs across 18 programs (86 artifacts).","contact":{"name":"AXIS Platform","url":"https://github.com/no-fate-platform/axis-iliad"}},"servers":[{"url":"http://localhost:4000","description":"Local development"}],"paths":{"/v1/health":{"get":{"summary":"Health check","operationId":"getHealth","tags":["Health"],"responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"503":{"description":"Service is shutting down"}}}},"/v1/health/live":{"get":{"summary":"Liveness probe","operationId":"getLiveness","tags":["Health"],"responses":{"200":{"description":"Service is alive","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["alive"]}}}}}}}}},"/v1/health/ready":{"get":{"summary":"Readiness probe","operationId":"getReadiness","tags":["Health"],"responses":{"200":{"description":"Service is ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadinessResponse"}}}},"503":{"description":"Service is not ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadinessResponse"}}}}}}},"/v1/metrics":{"get":{"summary":"Prometheus-format metrics","operationId":"getMetrics","tags":["Health"],"responses":{"200":{"description":"Metrics in Prometheus text format","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/snapshots":{"post":{"summary":"Create a snapshot from uploaded files","operationId":"createSnapshot","tags":["Snapshots"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSnapshotRequest"}}}},"responses":{"201":{"description":"Snapshot created and processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnapshotResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid or revoked API key"},"413":{"description":"File count or size limit exceeded"},"429":{"description":"Rate limit or quota exceeded"}}}},"/v1/snapshots/{snapshot_id}":{"get":{"summary":"Get snapshot by ID","operationId":"getSnapshot","tags":["Snapshots"],"parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string"},"description":"Snapshot identifier"}],"responses":{"200":{"description":"Snapshot details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnapshotDetail"}}}},"404":{"description":"Snapshot not found"}}},"delete":{"summary":"Delete a snapshot","operationId":"deleteSnapshot","tags":["Snapshots"],"parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string"},"description":"Snapshot identifier"}],"responses":{"200":{"description":"Snapshot deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"snapshot_id":{"type":"string"}}}}}},"404":{"description":"Snapshot not found"}}}},"/v1/snapshots/{snapshot_id}/versions":{"get":{"summary":"List generation versions for a snapshot","operationId":"listVersions","tags":["Versions"],"parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string"},"description":"Snapshot identifier"}],"responses":{"200":{"description":"Version listing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionListResponse"}}}},"404":{"description":"Snapshot not found"}}}},"/v1/snapshots/{snapshot_id}/versions/{version_number}":{"get":{"summary":"Get a specific generation version with files","operationId":"getVersion","tags":["Versions"],"parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string"},"description":"Snapshot identifier"},{"name":"version_number","in":"path","required":true,"schema":{"type":"string"},"description":"Version number (positive integer)"}],"responses":{"200":{"description":"Version details with files","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionDetailResponse"}}}},"400":{"description":"Invalid version number"},"404":{"description":"Version not found"}}}},"/v1/snapshots/{snapshot_id}/diff":{"get":{"summary":"Diff two generation versions","operationId":"diffVersions","tags":["Versions"],"parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string"},"description":"Snapshot identifier"},{"name":"old","in":"query","required":false,"schema":{"type":"string"},"description":"Old version number (positive integer)"},{"name":"new","in":"query","required":false,"schema":{"type":"string"},"description":"New version number (positive integer)"}],"responses":{"200":{"description":"Version diff","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionDiffResponse"}}}},"400":{"description":"Missing or invalid version parameters"},"404":{"description":"Version not found"}}}},"/v1/projects/{project_id}/context":{"get":{"summary":"Get context map and repo profile for latest project snapshot","operationId":"getProjectContext","tags":["Projects"],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"},"description":"Project identifier"}],"responses":{"200":{"description":"Context and repo profile"},"404":{"description":"No snapshots for project"}}}},"/v1/projects/{project_id}/generated-files":{"get":{"summary":"Get all generated files for latest project snapshot","operationId":"getGeneratedFiles","tags":["Projects"],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"},"description":"Project identifier"}],"responses":{"200":{"description":"Generated file listing"},"404":{"description":"No generated files available"}}}},"/v1/projects/{project_id}/generated-files/{file_path}":{"get":{"summary":"Get a specific generated file by path","operationId":"getGeneratedFile","tags":["Projects"],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"},"description":"Project identifier"},{"name":"file_path","in":"path","required":true,"schema":{"type":"string"},"description":"File path within generated outputs"}],"responses":{"200":{"description":"Raw file content"},"400":{"description":"Invalid file path"},"404":{"description":"File not found"}}}},"/v1/projects/{project_id}/export":{"get":{"summary":"Export all generated files as a ZIP archive","operationId":"exportZip","tags":["Projects"],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"},"description":"Project identifier"}],"responses":{"200":{"description":"ZIP archive","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"No generated files"}}}},"/v1/projects/{project_id}":{"delete":{"summary":"Delete a project and all its snapshots","operationId":"deleteProject","tags":["Projects"],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"},"description":"Project identifier"}],"responses":{"200":{"description":"Project deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"project_id":{"type":"string"},"deleted_snapshots":{"type":"integer"}}}}}},"404":{"description":"Project not found"}}}},"/v1/search/export":{"post":{"summary":"Export search program results for a snapshot","operationId":"searchExport","tags":["Search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["snapshot_id"],"properties":{"snapshot_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Search export results"},"404":{"description":"No results"}}}},"/v1/skills/generate":{"post":{"summary":"Generate skills files (AGENTS.md, CLAUDE.md, etc.)","operationId":"skillsGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/debug/analyze":{"post":{"summary":"Run debug analysis program","operationId":"debugAnalyze","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/frontend/audit":{"post":{"summary":"Run frontend audit program","operationId":"frontendAudit","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/seo/analyze":{"post":{"summary":"Run SEO analysis program","operationId":"seoAnalyze","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/optimization/analyze":{"post":{"summary":"Run optimization analysis program","operationId":"optimizationAnalyze","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/theme/generate":{"post":{"summary":"Generate design theme tokens","operationId":"themeGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/brand/generate":{"post":{"summary":"Generate brand guidelines","operationId":"brandGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/superpowers/generate":{"post":{"summary":"Generate superpower pack","operationId":"superpowersGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/marketing/generate":{"post":{"summary":"Generate marketing assets","operationId":"marketingGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/notebook/generate":{"post":{"summary":"Generate notebook/research files","operationId":"notebookGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/obsidian/analyze":{"post":{"summary":"Generate Obsidian vault files","operationId":"obsidianAnalyze","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/mcp/provision":{"post":{"summary":"Provision MCP server config","operationId":"mcpProvision","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/artifacts/generate":{"post":{"summary":"Generate code artifacts","operationId":"artifactsGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/remotion/generate":{"post":{"summary":"Generate Remotion video scripts","operationId":"remotionGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/canvas/generate":{"post":{"summary":"Generate canvas/poster designs","operationId":"canvasGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/algorithmic/generate":{"post":{"summary":"Generate algorithmic art","operationId":"algorithmicGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/agentic-purchasing/generate":{"post":{"summary":"Generate agentic purchasing artifacts","operationId":"agenticPurchasingGenerate","tags":["Programs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramRequest"}}}},"responses":{"200":{"description":"Program output files"},"400":{"description":"Validation error"},"404":{"description":"No context for snapshot"}}}},"/v1/analyze":{"post":{"summary":"Analyze a codebase — one call returns all AI context files with adoption hints","operationId":"analyze","tags":["Analyze"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeRequest"}}}},"responses":{"201":{"description":"Analysis complete — files with content, placement, and adoption_hint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid or revoked API key"},"413":{"description":"File count or size limit exceeded"},"422":{"description":"No source files found"},"429":{"description":"Rate limit or quota exceeded"},"502":{"description":"GitHub upstream error"}}}},"/v1/prepare-for-agentic-purchasing":{"post":{"summary":"Generate agentic purchasing readiness assessment — AP2/UCP/Visa compliance, negotiation playbook, autonomous checkout rules","operationId":"prepareForAgenticPurchasing","tags":["Analyze","Agentic Commerce"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeRequest"}}}},"responses":{"201":{"description":"Purchasing readiness score + compliance artifacts"},"400":{"description":"Validation error"},"401":{"description":"Invalid or revoked API key"},"429":{"description":"Rate limit or quota exceeded"}}}},"/v1/github/analyze":{"post":{"summary":"Create snapshot from a GitHub repository URL","operationId":"githubAnalyze","tags":["GitHub"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubAnalyzeRequest"}}}},"responses":{"201":{"description":"Snapshot created from GitHub repo"},"400":{"description":"Invalid GitHub URL"},"404":{"description":"Repository not found or inaccessible"}}}},"/llms.txt":{"get":{"summary":"Plain-text AI tool instructions (llmstxt.org standard)","operationId":"getLlmsTxt","tags":["Discovery"],"responses":{"200":{"description":"Plain-text AXIS API instructions for AI tools","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/.well-known/skills/index.json":{"get":{"summary":"Agent skills registry (agentskills.io standard)","operationId":"getSkillsIndex","tags":["Discovery"],"responses":{"200":{"description":"AXIS skill definitions for AI coding assistants"}}}},"/v1/docs.md":{"get":{"summary":"Plain-text API reference (Markdown)","operationId":"getDocsMd","tags":["Discovery"],"responses":{"200":{"description":"Markdown plain-text API summary","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/.well-known/axis.json":{"get":{"summary":"Agent discovery manifest — describes how to use AXIS programmatically","operationId":"getWellKnown","tags":["Discovery"],"responses":{"200":{"description":"Machine-readable AXIS capability manifest"}}}},"/.well-known/capabilities.json":{"get":{"summary":"Machine-readable capability manifest with program list and MCP info","operationId":"getCapabilities","tags":["Discovery"],"responses":{"200":{"description":"Capabilities manifest"}}}},"/.well-known/security.txt":{"get":{"summary":"Security vulnerability disclosure policy (RFC 9116)","operationId":"getSecurityTxt","tags":["Discovery"],"responses":{"200":{"description":"RFC 9116 security.txt","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/.well-known/agent.json":{"get":{"summary":"Agent/scanner manifest with capabilities, monetization, and endpoints","operationId":"getAgentJson","tags":["Discovery"],"responses":{"200":{"description":"AgentSEO/MCP scanner manifest"}}}},"/robots.txt":{"get":{"summary":"Robots exclusion protocol with AI/MCP crawler directives","operationId":"getRobotsTxt","tags":["Discovery"],"responses":{"200":{"description":"Robots.txt with per-agent directives","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/sitemap.xml":{"get":{"summary":"XML sitemap listing all public discovery endpoints","operationId":"getSitemapXml","tags":["Discovery"],"responses":{"200":{"description":"XML sitemap","content":{"application/xml":{"schema":{"type":"string"}}}}}}},"/health":{"get":{"summary":"Root-level health alias (redirects to /v1/health detail)","operationId":"getHealthAlias","tags":["Health"],"responses":{"200":{"description":"Basic health status with version and uptime"}}}},"/docs":{"get":{"summary":"Root-level docs alias with links to full documentation","operationId":"getDocsAlias","tags":["Discovery"],"responses":{"200":{"description":"Docs navigation links"}}}},"/openapi.json":{"get":{"summary":"OpenAPI 3.1 specification (root-level alias for /v1/docs)","operationId":"getOpenApiJson","tags":["Discovery"],"responses":{"200":{"description":"Full OpenAPI specification"}}}},"/v1/mcp/tools":{"get":{"summary":"Search AXIS programs and generators by keyword or capability tag","operationId":"searchMcpTools","tags":["MCP"],"parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":"Search keyword (e.g. 'checkout', 'debug', 'mcp')"},{"name":"program","in":"query","schema":{"type":"string"},"description":"Filter by program name"}],"responses":{"200":{"description":"Ranked program and generator matches"}}}},"/v1/mcp/server.json":{"get":{"summary":"MCP registry metadata for mcp-publisher CLI and registry crawlers","operationId":"getMcpServerJson","tags":["MCP"],"responses":{"200":{"description":"MCP server metadata including all tool schemas, endpoint, protocol version, and quickstart"}}}},"/.well-known/mcp.json":{"get":{"summary":"MCP server discovery manifest (alternate well-known path for registry crawlers)","operationId":"getWellKnownMcpJson","tags":["MCP","Discovery"],"responses":{"200":{"description":"Same as /v1/mcp/server.json — MCP server metadata"}}}},"/mcp/docs":{"get":{"summary":"Human-readable MCP integration documentation page","operationId":"getMcpDocs","tags":["MCP","Discovery"],"responses":{"200":{"description":"MCP documentation with tool list, usage examples, and install configs"}}}},"/v1/search/index":{"post":{"summary":"Build search index for a snapshot's file contents","operationId":"searchIndex","tags":["Search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["snapshot_id"],"properties":{"snapshot_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Index built","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchIndexResponse"}}}},"404":{"description":"Snapshot not found"}}}},"/v1/search/query":{"post":{"summary":"Search indexed file contents for a snapshot","operationId":"searchQuery","tags":["Search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchQueryRequest"}}}},"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchQueryResponse"}}}},"400":{"description":"Missing or invalid query"}}}},"/v1/search/{snapshot_id}/stats":{"get":{"summary":"Get search index statistics for a snapshot","operationId":"searchStats","tags":["Search"],"parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string"},"description":"Snapshot identifier"}],"responses":{"200":{"description":"Index stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchStatsResponse"}}}}}}},"/v1/search/{snapshot_id}/symbols":{"get":{"summary":"Get extracted symbols (functions, classes, exports) from a snapshot's search index","operationId":"searchSymbols","tags":["Search"],"parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string"},"description":"Snapshot identifier"}],"responses":{"200":{"description":"Extracted symbols list"}}}},"/mcp":{"post":{"summary":"MCP Streamable HTTP endpoint (2025-03-26) — call AXIS as a native tool from any MCP-capable agent","operationId":"mcpPost","tags":["MCP"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"method":{"type":"string"},"id":{"type":["string","number","null"]},"params":{"type":"object"}}}}}},"responses":{"200":{"description":"JSON-RPC 2.0 response (result or error)"},"202":{"description":"Notification accepted — no body"},"400":{"description":"Parse error or invalid JSON-RPC 2.0 request"}}},"get":{"summary":"MCP SSE endpoint for server-initiated messages (stateless mode: ping + close)","operationId":"mcpGet","tags":["MCP"],"responses":{"200":{"description":"Server-sent events stream","content":{"text/event-stream":{"schema":{"type":"string"}}}}}}},"/v1/programs":{"get":{"summary":"List available programs and their outputs","operationId":"listPrograms","tags":["Programs"],"responses":{"200":{"description":"Program listing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramsListResponse"}}}}}}},"/v1/accounts":{"post":{"summary":"Create a new account","operationId":"createAccount","tags":["Billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountRequest"}}}},"responses":{"201":{"description":"Account created"},"400":{"description":"Validation error"}}}},"/accounts":{"post":{"summary":"Create a new account (alias)","operationId":"createAccountAlias","tags":["Billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountRequest"}}}},"responses":{"201":{"description":"Account created"},"400":{"description":"Validation error"}}}},"/v1/account":{"get":{"summary":"Get current account details (requires API key)","operationId":"getAccount","tags":["Billing"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Account details"},"401":{"description":"Invalid API key"}}}},"/v1/account/keys":{"post":{"summary":"Create a new API key","operationId":"createApiKey","tags":["Billing"],"responses":{"201":{"description":"Key created"}}},"get":{"summary":"List API keys","operationId":"listApiKeys","tags":["Billing"],"responses":{"200":{"description":"Key list"}}}},"/v1/account/keys/{key_id}/revoke":{"post":{"summary":"Revoke an API key","operationId":"revokeApiKey","tags":["Billing"],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string"},"description":"API key identifier"}],"responses":{"200":{"description":"Key revoked"},"404":{"description":"Key not found"}}}},"/v1/account/usage":{"get":{"summary":"Get account usage summary","operationId":"getUsage","tags":["Billing"],"responses":{"200":{"description":"Usage data"}}}},"/v1/account/quota":{"get":{"summary":"Get rate limit and resource quota status","operationId":"getQuota","tags":["Billing"],"responses":{"200":{"description":"Quota and rate-limit info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotaResponse"}}}}}}},"/v1/account/tier":{"post":{"summary":"Update account tier","operationId":"updateTier","tags":["Billing"],"responses":{"200":{"description":"Tier updated"}}}},"/v1/account/programs":{"post":{"summary":"Toggle program entitlements","operationId":"updatePrograms","tags":["Billing"],"responses":{"200":{"description":"Programs updated"}}}},"/v1/plans":{"get":{"summary":"List available plans and features","operationId":"getPlans","tags":["Funnel"],"responses":{"200":{"description":"Plan listing"}}}},"/v1/account/seats":{"post":{"summary":"Invite a team member","operationId":"inviteSeat","tags":["Funnel"],"responses":{"201":{"description":"Seat created"}}},"get":{"summary":"List team seats","operationId":"listSeats","tags":["Funnel"],"responses":{"200":{"description":"Seat list"}}}},"/v1/account/seats/{seat_id}/accept":{"post":{"summary":"Accept a seat invitation","operationId":"acceptSeat","tags":["Funnel"],"parameters":[{"name":"seat_id","in":"path","required":true,"schema":{"type":"string"},"description":"Seat identifier"}],"responses":{"200":{"description":"Seat accepted"}}}},"/v1/account/seats/{seat_id}/revoke":{"post":{"summary":"Revoke a seat","operationId":"revokeSeat","tags":["Funnel"],"parameters":[{"name":"seat_id","in":"path","required":true,"schema":{"type":"string"},"description":"Seat identifier"}],"responses":{"200":{"description":"Seat revoked"}}}},"/v1/account/upgrade-prompt":{"get":{"summary":"Get personalized upgrade prompt","operationId":"getUpgradePrompt","tags":["Funnel"],"responses":{"200":{"description":"Upgrade prompt data"}}}},"/v1/account/upgrade-prompt/dismiss":{"post":{"summary":"Dismiss upgrade prompt","operationId":"dismissUpgradePrompt","tags":["Funnel"],"responses":{"200":{"description":"Dismissed"}}}},"/v1/account/funnel":{"get":{"summary":"Get funnel status for current account","operationId":"getFunnelStatus","tags":["Funnel"],"responses":{"200":{"description":"Funnel status"}}}},"/v1/funnel/metrics":{"get":{"summary":"Get aggregate funnel metrics","operationId":"getFunnelMetrics","tags":["Funnel"],"responses":{"200":{"description":"Funnel metrics"}}}},"/v1/admin/stats":{"get":{"summary":"Get platform-wide statistics","operationId":"adminStats","tags":["Admin"],"responses":{"200":{"description":"Platform stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminStatsResponse"}}}},"401":{"description":"Unauthorized"}}}},"/v1/admin/accounts":{"get":{"summary":"List all accounts (paginated)","operationId":"adminAccounts","tags":["Admin"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max results (1-200, default 50)"},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Pagination offset (default 0)"}],"responses":{"200":{"description":"Account listing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAccountsResponse"}}}},"401":{"description":"Unauthorized"}}}},"/v1/admin/activity":{"get":{"summary":"Get recent platform activity events","operationId":"adminActivity","tags":["Admin"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max results (1-200, default 50)"}],"responses":{"200":{"description":"Activity feed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminActivityResponse"}}}},"401":{"description":"Unauthorized"}}}},"/v1/account/webhooks":{"post":{"summary":"Create a webhook subscription","operationId":"createWebhook","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"responses":{"201":{"description":"Webhook created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"400":{"description":"Validation error"},"401":{"description":"Unauthorized"}}},"get":{"summary":"List webhook subscriptions","operationId":"listWebhooks","tags":["Webhooks"],"responses":{"200":{"description":"Webhook listing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookListResponse"}}}},"401":{"description":"Unauthorized"}}}},"/v1/account/webhooks/{webhook_id}":{"delete":{"summary":"Delete a webhook subscription","operationId":"deleteWebhook","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string"},"description":"Webhook identifier"}],"responses":{"200":{"description":"Webhook deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"webhook_id":{"type":"string"}}}}}},"404":{"description":"Webhook not found"}}}},"/v1/account/webhooks/{webhook_id}/toggle":{"post":{"summary":"Enable or disable a webhook","operationId":"toggleWebhook","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string"},"description":"Webhook identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["active"],"properties":{"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Webhook toggled","content":{"application/json":{"schema":{"type":"object","properties":{"webhook_id":{"type":"string"},"active":{"type":"boolean"}}}}}},"404":{"description":"Webhook not found"}}}},"/v1/account/webhooks/{webhook_id}/deliveries":{"get":{"summary":"List webhook delivery history","operationId":"getWebhookDeliveries","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string"},"description":"Webhook identifier"},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max results (1-100, default 20)"}],"responses":{"200":{"description":"Delivery history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryListResponse"}}}},"404":{"description":"Webhook not found"}}}},"/v1/db/stats":{"get":{"summary":"Get database size and table statistics","operationId":"dbStats","tags":["Database"],"responses":{"200":{"description":"Database stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DbStatsResponse"}}}},"500":{"description":"Database error"}}}},"/v1/db/maintenance":{"post":{"summary":"Run database maintenance (checkpoint, vacuum, purge)","operationId":"dbMaintenance","tags":["Database"],"responses":{"200":{"description":"Maintenance results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DbMaintenanceResponse"}}}},"500":{"description":"Maintenance failed"}}}},"/v1/auth/github":{"get":{"summary":"Start GitHub OAuth flow (redirects to GitHub)","operationId":"githubOAuthStart","tags":["OAuth"],"responses":{"302":{"description":"Redirect to GitHub authorization page"},"503":{"description":"GitHub OAuth not configured"}}}},"/v1/auth/github/callback":{"get":{"summary":"GitHub OAuth callback (exchanges code for token)","operationId":"githubOAuthCallback","tags":["OAuth"],"parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string"},"description":"Authorization code from GitHub"},{"name":"state","in":"query","required":false,"schema":{"type":"string"},"description":"CSRF state parameter"},{"name":"error","in":"query","required":false,"schema":{"type":"string"},"description":"Error code from GitHub if authorization was denied"}],"responses":{"302":{"description":"Redirect to web app with token"},"400":{"description":"Missing code or state parameter"},"502":{"description":"GitHub API error during token exchange"},"503":{"description":"GitHub OAuth not configured"}}}},"/v1/webhooks/stripe":{"post":{"summary":"Stripe webhook receiver (Stripe-Signature verified)","operationId":"stripeWebhook","tags":["Payments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeWebhookPayload"}}}},"responses":{"200":{"description":"Webhook processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAckResponse"}}}},"400":{"description":"Invalid payload"},"401":{"description":"Invalid webhook signature"},"503":{"description":"Webhook secret not configured"}}}},"/v1/checkout":{"post":{"summary":"Create a Stripe checkout session","operationId":"createCheckout","tags":["Payments"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutRequest"}}}},"responses":{"201":{"description":"Checkout URL created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"400":{"description":"Invalid tier"},"401":{"description":"Authentication required"},"409":{"description":"Account already has an active subscription"},"503":{"description":"Stripe not configured"}}}},"/v1/account/subscription":{"get":{"summary":"Get current subscription status","operationId":"getSubscription","tags":["Payments"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Subscription details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"401":{"description":"Authentication required"}}}},"/v1/account/subscription/cancel":{"post":{"summary":"Cancel the active subscription","operationId":"cancelSubscription","tags":["Payments"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Cancellation requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancellationResponse"}}}},"401":{"description":"Authentication required"},"404":{"description":"No active subscription"},"502":{"description":"Stripe API error"},"503":{"description":"Stripe not configured"}}}},"/v1/account/github-token":{"post":{"summary":"Save a GitHub personal access token","operationId":"saveGitHubToken","tags":["GitHub"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveGitHubTokenRequest"}}}},"responses":{"201":{"description":"Token saved"},"400":{"description":"Invalid token"},"401":{"description":"Authentication required"}}},"get":{"summary":"List stored GitHub tokens (masked)","operationId":"listGitHubTokens","tags":["GitHub"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Token listing"},"401":{"description":"Authentication required"}}}},"/v1/account/github-token/{token_id}":{"delete":{"summary":"Delete a stored GitHub token","operationId":"deleteGitHubToken","tags":["GitHub"],"security":[{"apiKey":[]}],"parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string"},"description":"GitHub token identifier"}],"responses":{"200":{"description":"Token deleted"},"401":{"description":"Authentication required"},"404":{"description":"Token not found"}}}},"/v1/billing/history":{"get":{"summary":"Get billing/usage event history","operationId":"billingHistory","tags":["Billing"],"security":[{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max results (default 50)"},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Pagination offset (default 0)"}],"responses":{"200":{"description":"Billing history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingHistoryResponse"}}}},"401":{"description":"Authentication required"}}}},"/v1/billing/proration":{"get":{"summary":"Preview proration for a tier change","operationId":"prorationPreview","tags":["Billing"],"security":[{"apiKey":[]}],"parameters":[{"name":"target_tier","in":"query","required":false,"schema":{"type":"string"},"description":"Target tier to preview (paid | suite)"}],"responses":{"200":{"description":"Proration preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProrationPreviewResponse"}}}},"401":{"description":"Authentication required"}}}},"/v1/account/credits":{"get":{"summary":"Get persistence credit balance and ledger","operationId":"getCredits","tags":["Billing"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Credit balance and ledger","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsResponse"}}}},"401":{"description":"Authentication required"}}},"post":{"summary":"Grant persistence credits to account","operationId":"addCredits","tags":["Billing"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCreditsRequest"}}}},"responses":{"200":{"description":"Credits granted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCreditsResponse"}}}},"400":{"description":"Invalid request"},"401":{"description":"Authentication required"},"403":{"description":"Paid/suite plan required"}}}},"/v1/docs":{"get":{"summary":"Get OpenAPI 3.1 specification","operationId":"getDocs","tags":["Docs"],"responses":{"200":{"description":"OpenAPI specification","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/for-agents":{"get":{"summary":"Agent onboarding manifest — tools, install configs, system prompts, and getting-started guide for autonomous agents","operationId":"getForAgents","tags":["Discovery"],"parameters":[{"name":"intent","in":"query","schema":{"type":"string"},"description":"Optional intent string — tools are sorted by relevance to the intent"}],"responses":{"200":{"description":"Complete agent onboarding payload with tools, install configs, and system prompts"}}}},"/v1/install":{"get":{"summary":"Install configs for every MCP-compatible IDE and agent (Cursor, Windsurf, Claude, VS Code, etc.)","operationId":"getInstallConfigs","tags":["Discovery"],"responses":{"200":{"description":"Platform-keyed install config objects ready to write to disk"}}}},"/v1/install/{platform}":{"get":{"summary":"Platform-specific install config (e.g. cursor, windsurf, claude-desktop, vscode)","operationId":"getInstallPlatform","tags":["Discovery"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string"},"description":"Target platform identifier (cursor, windsurf, claude-desktop, vscode, claude-code)"}],"responses":{"200":{"description":"Platform-specific install configuration"},"404":{"description":"Unknown platform"}}}},"/v1/stats":{"get":{"summary":"Anonymous MCP call counters — today/total calls, top tools, process uptime","operationId":"getStats","tags":["Health"],"responses":{"200":{"description":"Aggregated call statistics and top-tools ranking"}}}},"/":{"get":{"summary":"API landing page — name, version, docs/health/mcp links, endpoint count","operationId":"getRoot","tags":["Discovery"],"responses":{"200":{"description":"API identity and navigation links"}}}},"/probe-intent":{"post":{"summary":"Lightweight intent probe — describe your commerce, compliance, or DevOps need and get tailored AXIS tool recommendations","operationId":"probeIntent","tags":["Discovery"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["intent"],"properties":{"intent":{"type":"string","description":"Natural language description of what the agent needs (e.g. 'PCI-DSS checkout flow', 'debug flaky tests')"}}}}}},"responses":{"200":{"description":"Ranked tool recommendations with relevance scores and next-step instructions"},"400":{"description":"Missing intent field"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"Authorization","description":"API key in Authorization header: `Bearer <api_key>`"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable error message"},"error_code":{"type":"string","description":"Machine-readable error code"},"request_id":{"type":"string","description":"Unique request identifier"}},"required":["error","error_code"]},"HealthResponse":{"type":"object","properties":{"status":{"type":"string","enum":["ok","shutting_down"]},"service":{"type":"string"},"version":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}},"CreateSnapshotRequest":{"type":"object","required":["manifest","files"],"properties":{"manifest":{"$ref":"#/components/schemas/SnapshotManifest"},"files":{"type":"array","items":{"$ref":"#/components/schemas/FileEntry"}},"input_method":{"type":"string","enum":["api_submission","github_url"]}}},"SnapshotManifest":{"type":"object","required":["project_name","project_type","frameworks","goals","requested_outputs"],"properties":{"project_name":{"type":"string"},"project_type":{"type":"string"},"frameworks":{"type":"array","items":{"type":"string"}},"goals":{"type":"array","items":{"type":"string"}},"requested_outputs":{"type":"array","items":{"type":"string"}}}},"FileEntry":{"type":"object","required":["path","content"],"properties":{"path":{"type":"string","description":"File path relative to project root"},"content":{"type":"string","description":"File content (UTF-8)"},"size":{"type":"integer","description":"File size in bytes (computed if omitted)"}}},"SnapshotResponse":{"type":"object","properties":{"snapshot_id":{"type":"string"},"project_id":{"type":"string"},"status":{"type":"string","enum":["processing","ready","failed"]},"context_map":{"type":"object"},"repo_profile":{"type":"object"},"generated_files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"program":{"type":"string"},"description":{"type":"string"}}}}}},"SnapshotDetail":{"type":"object","properties":{"snapshot_id":{"type":"string"},"project_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"input_method":{"type":"string"},"manifest":{"type":"object"},"file_count":{"type":"integer"},"total_size_bytes":{"type":"integer"},"status":{"type":"string"}}},"GitHubAnalyzeRequest":{"type":"object","required":["github_url"],"properties":{"github_url":{"type":"string","format":"uri","description":"GitHub repository URL (https://github.com/owner/repo)"}}},"AnalyzeRequest":{"type":"object","properties":{"github_url":{"type":"string","format":"uri","description":"Public GitHub repo URL. Provide this or files, not both."},"files":{"type":"array","items":{"type":"object","required":["path","content"],"properties":{"path":{"type":"string"},"content":{"type":"string"},"size":{"type":"integer"}}},"description":"Source files array. Provide this or github_url, not both."},"programs":{"type":"array","items":{"type":"string"},"description":"Filter to specific programs. Omit for all entitled programs."},"inline_content":{"type":"boolean","default":true,"description":"Include file content in response (default: true)"},"token":{"type":"string","description":"GitHub personal access token for private repos"}}},"AnalyzeResponse":{"type":"object","properties":{"snapshot_id":{"type":"string"},"project_id":{"type":"string"},"status":{"type":"string","enum":["ready"]},"analysis":{"type":"object","properties":{"project_name":{"type":"string"},"language":{"type":"string"},"frameworks":{"type":"array","items":{"type":"string"}},"file_count":{"type":"integer"},"routes_detected":{"type":"integer"},"domain_models_detected":{"type":"integer"},"separation_score":{"type":"number","minimum":0,"maximum":1}}},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"program":{"type":"string"},"description":{"type":"string"},"placement":{"type":"string"},"adoption_hint":{"type":"string"},"content":{"type":"string","description":"File content (present when inline_content is true)"}}}},"programs_run":{"type":"integer"},"total_files":{"type":"integer"},"next_steps":{"type":"array","items":{"type":"string"},"description":"Top 3 highest-impact things to do with these files right now"},"github":{"type":"object","description":"Present only when github_url was used"}}},"ProgramRequest":{"type":"object","required":["snapshot_id"],"properties":{"snapshot_id":{"type":"string"},"outputs":{"type":"array","items":{"type":"string"},"description":"Custom output file list (overrides defaults)"}}},"SearchQueryRequest":{"type":"object","required":["snapshot_id","query"],"properties":{"snapshot_id":{"type":"string"},"query":{"type":"string","maxLength":500},"limit":{"type":"integer","minimum":1,"maximum":200,"default":50}}},"SearchQueryResponse":{"type":"object","properties":{"snapshot_id":{"type":"string"},"query":{"type":"string"},"total_indexed_lines":{"type":"integer"},"total_indexed_files":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"file_path":{"type":"string"},"line_number":{"type":"integer"},"content":{"type":"string"},"rank":{"type":"integer"}}}}}},"SearchIndexResponse":{"type":"object","properties":{"snapshot_id":{"type":"string"},"indexed_files":{"type":"integer"},"indexed_lines":{"type":"integer"}}},"SearchStatsResponse":{"type":"object","properties":{"snapshot_id":{"type":"string"},"file_count":{"type":"integer"},"line_count":{"type":"integer"}}},"ProgramsListResponse":{"type":"object","properties":{"programs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"outputs":{"type":"array","items":{"type":"string"}},"generator_count":{"type":"integer"}}}},"total_generators":{"type":"integer"}}},"CreateAccountRequest":{"type":"object","required":["name","email"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"}}},"ReadinessResponse":{"type":"object","properties":{"status":{"type":"string","enum":["ready","not_ready"]},"checks":{"type":"object","properties":{"shutting_down":{"type":"boolean"},"database":{"type":"string","enum":["ok","error"]}}}}},"VersionListResponse":{"type":"object","properties":{"snapshot_id":{"type":"string"},"versions":{"type":"array","items":{"type":"object","properties":{"version_id":{"type":"string"},"snapshot_id":{"type":"string"},"version_number":{"type":"integer"},"program":{"type":"string","nullable":true},"file_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}},"count":{"type":"integer"}}},"VersionDetailResponse":{"type":"object","properties":{"version":{"type":"object","properties":{"version_id":{"type":"string"},"snapshot_id":{"type":"string"},"version_number":{"type":"integer"},"program":{"type":"string","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"content":{"type":"string"}}}},"file_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}}},"VersionDiffResponse":{"type":"object","properties":{"diff":{"type":"object","properties":{"old_version":{"type":"integer"},"new_version":{"type":"integer"},"snapshot_id":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"status":{"type":"string","enum":["added","removed","modified","unchanged"]},"old_content":{"type":"string","nullable":true},"new_content":{"type":"string","nullable":true}}}},"summary":{"type":"object","properties":{"added":{"type":"integer"},"removed":{"type":"integer"},"modified":{"type":"integer"},"unchanged":{"type":"integer"}}}}}}},"QuotaResponse":{"type":"object","properties":{"rate_limit":{"type":"object","properties":{"limit":{"type":"integer"},"remaining":{"type":"integer"},"count":{"type":"integer"},"reset_in_seconds":{"type":"number"},"window_ms":{"type":"integer"}}},"authenticated":{"type":"boolean"},"resource_quota":{"type":"object","properties":{"tier":{"type":"string"},"snapshots_this_month":{"type":"integer"},"max_snapshots_per_month":{"type":"integer"},"project_count":{"type":"integer"},"max_projects":{"type":"integer"},"max_files_per_snapshot":{"type":"integer"}}}}},"AdminStatsResponse":{"type":"object","properties":{"total_accounts":{"type":"integer"},"accounts_by_tier":{"type":"object","properties":{"free":{"type":"integer"},"paid":{"type":"integer"},"suite":{"type":"integer"}}},"total_snapshots":{"type":"integer"},"total_projects":{"type":"integer"},"total_usage_records":{"type":"integer"},"total_api_keys":{"type":"integer"},"active_api_keys":{"type":"integer"}}},"AdminAccountsResponse":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"tier":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"snapshot_count":{"type":"integer"},"project_count":{"type":"integer"}}}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}},"AdminActivityResponse":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"event_id":{"type":"string"},"account_id":{"type":"string"},"event_type":{"type":"string"},"stage":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}},"count":{"type":"integer"}}},"CreateWebhookRequest":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri","description":"Webhook delivery URL (https recommended)"},"events":{"type":"array","items":{"type":"string","enum":["snapshot.created","snapshot.deleted","project.deleted","generation.completed"]}},"secret":{"type":"string","description":"Optional HMAC signing secret"}}},"WebhookResponse":{"type":"object","properties":{"webhook":{"type":"object","properties":{"webhook_id":{"type":"string"},"account_id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"secret":{"type":"string","nullable":true},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}},"WebhookListResponse":{"type":"object","properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/WebhookResponse/properties/webhook"}},"count":{"type":"integer"}}},"WebhookDeliveryListResponse":{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"delivery_id":{"type":"string"},"webhook_id":{"type":"string"},"event_type":{"type":"string"},"success":{"type":"boolean"},"status_code":{"type":"integer","nullable":true},"attempt_number":{"type":"integer"},"dead_lettered":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}}},"count":{"type":"integer"}}},"DbStatsResponse":{"type":"object","properties":{"action":{"type":"string"},"success":{"type":"boolean"},"details":{"type":"object","properties":{"size_bytes":{"type":"integer"},"page_size":{"type":"integer"},"page_count":{"type":"integer"},"freelist_pages":{"type":"integer"},"wal_pages":{"type":"integer"},"tables":{"type":"object","additionalProperties":{"type":"integer"}}}}}},"DbMaintenanceResponse":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"success":{"type":"boolean"},"details":{"type":"object"}}}},"success":{"type":"boolean"}}},"StripeWebhookPayload":{"type":"object","required":["type","data"],"properties":{"type":{"type":"string","description":"Stripe event type (e.g. checkout.session.completed)"},"data":{"type":"object","properties":{"object":{"type":"object","description":"Stripe event object"}}}}},"WebhookAckResponse":{"type":"object","properties":{"received":{"type":"boolean"},"event":{"type":"string"},"subscription_id":{"type":"string"},"status":{"type":"string"},"handled":{"type":"boolean"}}},"CreateCheckoutRequest":{"type":"object","required":["tier"],"properties":{"tier":{"type":"string","enum":["paid","suite"],"description":"Target subscription tier"}}},"CheckoutResponse":{"type":"object","properties":{"checkout_url":{"type":"string","format":"uri"},"tier":{"type":"string"},"variant_id":{"type":"string"}}},"SubscriptionResponse":{"type":"object","properties":{"account_id":{"type":"string"},"tier":{"type":"string"},"has_active_subscription":{"type":"boolean"},"active_subscription":{"type":"object","nullable":true,"properties":{"subscription_id":{"type":"string"},"status":{"type":"string"},"price_id":{"type":"string"},"current_period_start":{"type":"string","nullable":true},"current_period_end":{"type":"string","nullable":true},"card_brand":{"type":"string","nullable":true},"card_last_four":{"type":"string","nullable":true},"cancel_at":{"type":"string","nullable":true}}},"subscription_count":{"type":"integer"}}},"CancellationResponse":{"type":"object","properties":{"subscription_id":{"type":"string"},"status":{"type":"string","enum":["cancellation_requested"]},"message":{"type":"string"}}},"SaveGitHubTokenRequest":{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"GitHub personal access token"},"label":{"type":"string","description":"Optional label for the token"}}},"BillingHistoryResponse":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"event_type":{"type":"string"},"stage":{"type":"string"},"metadata":{"type":"object"},"created_at":{"type":"string","format":"date-time"}}}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}},"ProrationPreviewResponse":{"type":"object","properties":{"current_tier":{"type":"string"},"target_tier":{"type":"string"},"current_price":{"type":"number"},"target_price":{"type":"number"},"proration_amount":{"type":"number"},"effective_date":{"type":"string","format":"date-time"}}},"CreditsResponse":{"type":"object","properties":{"account_id":{"type":"string"},"tier":{"type":"string"},"balance":{"type":"integer","description":"Current persistence credit balance"},"credit_costs":{"type":"object","description":"Credit cost per operation type"},"credit_packs":{"type":"array","items":{"type":"object","properties":{"pack_id":{"type":"string"},"credits":{"type":"integer"},"price_cents":{"type":"integer"}}}},"ledger":{"type":"array","items":{"type":"object","properties":{"credit_id":{"type":"string"},"credits_delta":{"type":"integer"},"operation":{"type":"string"},"snapshot_id":{"type":"string"},"balance_after":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}}}},"AddCreditsRequest":{"type":"object","required":["credits"],"properties":{"credits":{"type":"integer","minimum":1,"maximum":10000,"description":"Number of credits to add"},"operation":{"type":"string","default":"purchase","description":"Label for this credit grant (e.g. purchase, suite_monthly_grant)"}}},"AddCreditsResponse":{"type":"object","properties":{"account_id":{"type":"string"},"credits_added":{"type":"integer"},"operation":{"type":"string"},"balance_after":{"type":"integer"}}}}}}