{"openapi":"3.1.0","info":{"title":"Axis' Iliad API","version":"0.5.3","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 21 programs (152 artifacts).","contact":{"name":"AXIS Platform","url":"https://github.com/no-fate-platform/axis-iliad"}},"servers":[{"url":"https://api.iliad.trustfabric.ai","description":"Production"},{"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 (admin only)","operationId":"getMetrics","tags":["Health"],"responses":{"200":{"description":"Metrics in Prometheus text format","content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Admin access required"}}}},"/performance":{"get":{"summary":"Performance overview (uptime, average latency, error rate)","operationId":"getPerformance","tags":["Health"],"responses":{"200":{"description":"Performance snapshot"}}}},"/performance/reputation":{"get":{"summary":"Reputation/trust signal summary for agents evaluating this service","operationId":"getPerformanceReputation","tags":["Health"],"responses":{"200":{"description":"Reputation score and component breakdown"}}}},"/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"},"402":{"description":"Persistence credits required (upgrade plan or purchase credits)"},"404":{"description":"Version not found"}}}},"/v1/projects":{"get":{"summary":"List the account's analyzed projects, newest-analyzed-first","operationId":"listProjects","tags":["Projects"],"security":[{"apiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max projects to return (default 20, capped at 100)"},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Pagination offset (default 0)"}],"responses":{"200":{"description":"Project list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectsListResponse"}}}},"401":{"description":"Authentication required"}}}},"/v1/projects/{project_id}/snapshots":{"get":{"summary":"List every snapshot (analysis run) for a project, newest-first","operationId":"listProjectSnapshots","tags":["Projects"],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"},"description":"Project identifier"}],"responses":{"200":{"description":"Snapshot list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectSnapshotsResponse"}}}},"401":{"description":"Authentication required (project has an owning account)"},"404":{"description":"Project 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}/memory":{"get":{"summary":"List project memory entries (decisions, conventions, evidence, goals)","operationId":"listProjectMemory","tags":["Memory"],"security":[{"apiKey":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"},"description":"Project identifier"},{"name":"kind","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by kind: decision, convention, evidence, or goal"},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max entries to return (default 50, capped at 200)"}],"responses":{"200":{"description":"Memory entries, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryListResponse"}}}},"400":{"description":"Invalid kind or limit"},"401":{"description":"Authentication required"},"403":{"description":"Project has no owning account"},"404":{"description":"Project not found"}}},"post":{"summary":"Append a project memory entry (append-only — no update/delete in v1)","operationId":"addProjectMemory","tags":["Memory"],"security":[{"apiKey":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"},"description":"Project identifier"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMemoryRequest"}}}},"responses":{"201":{"description":"Entry recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryEntryResponse"}}}},"400":{"description":"Invalid kind, content, or source"},"401":{"description":"Authentication required"},"403":{"description":"Project has no owning account"},"404":{"description":"Project not found"},"409":{"description":"Project memory is at its entry cap"}}}},"/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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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/pitch/generate":{"post":{"summary":"Generate the truth-first pitch deck (measured evidence only; docs claims audited, never repeated)","operationId":"pitchGenerate","tags":["Programs"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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"],"security":[{"apiKey":[]}],"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/closer/generate":{"post":{"summary":"Generate shipping and marketplace packaging assets","operationId":"closerGenerate","tags":["Programs"],"security":[{"apiKey":[]}],"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/ask":{"post":{"summary":"Ask a citation-grounded question about a snapshot's code (notebook program)","description":"Retrieves relevant code via full-text search and answers the question using only what was retrieved. Every citation is verified against the actual retrieved rows before being returned — a citation the underlying model proposes but that does not match a real file_path/line_number pair is dropped, never surfaced.","operationId":"notebookAsk","tags":["Programs"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["snapshot_id","question"],"properties":{"snapshot_id":{"type":"string","description":"A snapshot this account owns"},"question":{"type":"string","maxLength":500,"description":"A natural-language question about the snapshot's code"}}}}}},"responses":{"200":{"description":"A grounded answer (or grounded snippets alone, if no LLM is configured)","content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string"},"answer":{"type":"string","nullable":true,"description":"null when no LLM is configured, or no matches were found"},"synthesized":{"type":"boolean"},"citations":{"type":"array","items":{"type":"object","properties":{"file_path":{"type":"string"},"line_number":{"type":"integer"},"content":{"type":"string"}}}},"rejected_citation_count":{"type":"integer","description":"Citations the model proposed that did not match a retrieved row"}}}}}},"400":{"description":"Missing or invalid snapshot_id / question"},"401":{"description":"Authentication required"},"402":{"description":"The notebook program is not enabled for this account"},"404":{"description":"Snapshot not found, or not owned by this account"}}}},"/v1/analyze":{"post":{"summary":"Analyze a codebase — one call returns all AI context files with adoption hints","description":"Analyze any GitHub repo or uploaded codebase and return 152 structured AI artifacts across 21 programs (AGENTS.md, CLAUDE.md, .cursorrules, MCP config, brand guidelines, debug playbooks, etc.). Free callers receive 47 artifacts — every program ships some, and search/skills/debug are free in full. Each program's remaining artifacts require a paid plan or a per-call MPP credit ($3.00 for a full analyze run). If the caller lacks access, the server returns HTTP 402 with a machine-readable payment body containing payment_url, checkout_url, and retry_after_payment instructions. **Agent flow**: (1) Call with API key. (2) If 402 received, present checkout_url to user or use autonomous payment if authorized. (3) After payment, retry the identical request — no extra steps. X-Agent-Mode: lite is RETIRED — it now returns the free artifact set at no charge; use the free tier instead. Pass X-Agent-Budget to negotiate budget. Response headers on every authenticated call: X-Axis-Tier, X-Axis-Quota-Remaining, X-Axis-Credits-Balance, X-Axis-Request-Cost.","operationId":"analyze","tags":["Analyze"],"x-payment":{"model":"stripe_x402","price_usd":"3.00","lite_price_usd":"0.00","free_artifact_count":47,"free_programs_note":"every program ships free artifacts; search/skills/debug are free in full","description":"Returns HTTP 402 only when a caller explicitly requests paid artifacts it cannot pay for; an unpaid caller is otherwise narrowed to the free artifact set rather than rejected. Body contains payment_url (Stripe checkout), checkout_url, and retry_after_payment instructions. Agent should present checkout_url to user or use autonomous payment if authorized, then retry.","budget_header":"X-Agent-Budget: {\"budget_per_run_cents\": 50, \"spending_window\": \"per_call\"}","lite_mode_header":"X-Agent-Mode: lite","retry_pattern":"Re-send original request with same API key after payment — no extra steps."},"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 — authenticate first via POST /v1/accounts then POST /v1/account/keys"},"402":{"description":"Payment Required — free-tier caller requested paid programs. Response body contains payment_url, checkout_url, retry_after_payment, and full x402 negotiation block.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Payment Required"},"price":{"type":"string","example":"3.00"},"currency":{"type":"string","example":"USD"},"payment_url":{"type":"string","description":"AXIS billing page for the caller's account (PAI'D-hosted, not a Stripe-hosted URL)"},"checkout_url":{"type":"string","description":"AXIS billing page, deep-linked to the Pro plan's PAI'D checkout section (PAI'D-hosted, not a direct Stripe checkout URL)"},"retry_after_payment":{"type":"string","description":"Instructions to retry after payment completes"},"x402":{"type":"object","description":"x402-compatible on-chain payment block (USDC)"}}}}}},"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","description":"Full purchasing-readiness audit. Returns score 0-100, AP2/Visa compliance checklist, Compelling Evidence 3.0 dispute evidence requirements, SCA exemption paths, and autonomous checkout rules.Requires Pro tier or a $3.00 MPP credit. HTTP 402 returned for free-tier callers with payment_url and retry instructions. **Agent flow**: (1) Call with API key. (2) If 402, present checkout_url or pay autonomously. (3) Retry after payment.","operationId":"prepareForAgenticPurchasing","tags":["Analyze","Agentic Commerce"],"x-payment":{"model":"stripe_x402","price_usd":"3.00","lite_price_usd":"1.00","description":"Returns HTTP 402 for free-tier callers. Body contains payment_url, checkout_url, and retry_after_payment."},"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"},"402":{"description":"Payment Required — body contains payment_url, checkout_url, and retry_after_payment instructions"},"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"}}}},"/v1/research/scrape":{"post":{"summary":"Scrape a single URL and return markdown content","description":"Proxy to Firecrawl /scrape. Returns markdown, metadata, and structured data. Requires authentication. Pricing: $0.10 standard, $0.05 lite per page.","operationId":"firecrawlScrape","tags":["Web Research"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"URL to scrape"},"only_main_content":{"type":"boolean","default":true,"description":"Extract main content only"}}}}}},"responses":{"200":{"description":"Scrape successful"},"400":{"description":"Invalid URL or request"},"401":{"description":"Authentication required"},"402":{"description":"Payment required"},"502":{"description":"Firecrawl service error"}},"x-payment":{"model":"per_call_with_lite_mode","price_usd":"$0.10","lite_price_usd":"$0.05","budget_header":"X-Agent-Budget","lite_mode_header":"X-Agent-Mode: lite","retry_pattern":"Retry with same body after paying"}}},"/v1/research/crawl":{"post":{"summary":"Crawl a domain and scrape multiple pages","description":"Proxy to Firecrawl /crawl. Crawls up to 100 pages and returns markdown for each. Requires authentication. Pricing: $0.01/page beyond your account's shared 100-page/month free pool (standard and lite) — a crawl fully covered by the free pool costs $0.00; a fully-paid 100-page crawl costs up to $1.00.","operationId":"firecrawlCrawl","tags":["Web Research"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"Domain/URL to crawl"},"limit":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Max pages to crawl"}}}}}},"responses":{"200":{"description":"Crawl successful"},"400":{"description":"Invalid URL or request"},"401":{"description":"Authentication required"},"402":{"description":"Payment required"},"502":{"description":"Firecrawl service error"}},"x-payment":{"model":"per_page_beyond_free_pool","price_usd":"$0.01/page","lite_price_usd":"$0.01/page","budget_header":"X-Agent-Budget","lite_mode_header":"X-Agent-Mode: lite","retry_pattern":"Retry with same body after paying"}}},"/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"}}}},"/.well-known/agent-skills/index.json":{"get":{"summary":"Agent skills registry — RFC-path alias of /.well-known/skills/index.json (cloudflare/agent-skills-discovery-rfc)","operationId":"getAgentSkillsIndex","tags":["Discovery"],"responses":{"200":{"description":"AXIS skill definitions for AI coding assistants"}}}},"/.well-known/axis-estate.json":{"get":{"summary":"Canonical AXIS estate manifest — every sibling property (PAI'D, Foundry, Launch, TrustFabric) with MCP endpoints, payment rails, and discovery URLs","operationId":"getAxisEstate","tags":["Discovery"],"responses":{"200":{"description":"Machine-readable estate registry (versioned, additive-only)"}}}},"/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"}}}}}}},"/v1/error-codes":{"get":{"summary":"Generated error-code catalog with retry guidance","operationId":"getErrorCodes","tags":["Discovery"],"responses":{"200":{"description":"Every REST ErrorCode.* value plus the MCP tool-call error categories, each with HTTP status(es), retryable guidance, and a description","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/changelog":{"get":{"summary":"Repo CHANGELOG.md, verbatim","operationId":"getChangelog","tags":["Discovery"],"responses":{"200":{"description":"The project's CHANGELOG.md, unmodified","content":{"text/markdown":{"schema":{"type":"string"}}}}}}},"/begin.yaml":{"get":{"summary":"AXIS's own begin-loop head, verbatim (H4.4 — AXIS dogfoods the loop it generates)","operationId":"getBeginYaml","tags":["Discovery"],"responses":{"200":{"description":"AXIS's root begin.yaml, unmodified","content":{"application/yaml":{"schema":{"type":"string"}}}}}}},"/continuation.yaml":{"get":{"summary":"AXIS's own begin-loop state, verbatim (H4.4 — AXIS dogfoods the loop it generates)","operationId":"getContinuationYaml","tags":["Discovery"],"responses":{"200":{"description":"AXIS's root continuation.yaml, unmodified","content":{"application/yaml":{"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"}}}},"/.well-known/agent-card.json":{"get":{"summary":"MCP-focused agent discovery card (name, skills, capabilities) -- not an A2A protocol conformance claim","operationId":"getAgentCard","tags":["Discovery"],"responses":{"200":{"description":"Agent card: name, skills[], capabilities, authentication, cross-links to the other discovery surfaces"}}}},"/agents.json":{"get":{"summary":"Root-level alias for /.well-known/agent.json","operationId":"getAgentsJsonAlias","tags":["Discovery"],"responses":{"200":{"description":"Same as /.well-known/agent.json — AgentSEO/MCP scanner manifest"}}}},"/.well-known/glama.json":{"get":{"summary":"Glama MCP directory listing manifest","operationId":"getGlamaJson","tags":["Discovery"],"responses":{"200":{"description":"Glama-format server manifest"}}}},"/.well-known/ai-plugin.json":{"get":{"summary":"OpenAI/ChatGPT plugin manifest (legacy plugin discovery format)","operationId":"getAiPluginJson","tags":["Discovery"],"responses":{"200":{"description":"AI plugin manifest"}}}},"/.well-known/x402":{"get":{"summary":"x402 payment discovery aid (not the foundation's canonical mechanism -- see the endpoint's own note field)","operationId":"getX402WellKnown","tags":["Discovery"],"responses":{"200":{"description":"x402 discovery aid: ping_payment demo, programs, utilities, real derived prices, wire protocol note"}}}},"/.well-known/x402.json":{"get":{"summary":"Same as /.well-known/x402 (extension alias for crawlers that expect .json)","operationId":"getX402WellKnownJson","tags":["Discovery"],"responses":{"200":{"description":"Same as /.well-known/x402"}}}},"/.well-known/oauth-authorization-server":{"get":{"summary":"OAuth 2.0 Authorization Server Metadata (RFC 8414)","operationId":"getOAuthAuthorizationServerMetadata","tags":["Discovery","OAuth"],"responses":{"200":{"description":"Authorization server metadata document"}}}},"/.well-known/oauth-protected-resource":{"get":{"summary":"OAuth 2.0 Protected Resource Metadata (RFC 9728)","operationId":"getOAuthProtectedResourceMetadata","tags":["Discovery","OAuth"],"responses":{"200":{"description":"Protected resource metadata document"}}}},"/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"}}}},"/pricing":{"get":{"summary":"Pricing landing metadata for crawlers/agents","operationId":"getPricingLanding","tags":["Discovery"],"responses":{"200":{"description":"Pricing summary with links to /v1/plans and the web pricing page"}}}},"/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/mcp/hosted/{repo}":{"post":{"summary":"Per-account hosted MCP endpoint for a watched repo — read-only (filesystem tools + resources), re-synced on every push","operationId":"mcpHostedPost","tags":["MCP"],"parameters":[{"name":"repo","in":"path","required":true,"schema":{"type":"string"},"description":"owner/repo of a repo this account has an active mcp subscription for"}],"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"},"401":{"description":"No Authorization header / invalid API key"},"404":{"description":"This account has no mcp subscription for the given repo"},"503":{"description":"Subscribed but not yet synced — wait for the first push"}}}},"/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"}}},"get":{"summary":"Method-not-allowed guidance (account creation is POST-only)","operationId":"getAccountsInfo","tags":["Account"],"responses":{"405":{"description":"Method not allowed — use POST /v1/accounts"}}}},"/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"}}},"get":{"summary":"Method-not-allowed guidance (account creation is POST-only)","operationId":"getAccountsAliasInfo","tags":["Account"],"responses":{"405":{"description":"Method not allowed — use POST /accounts"}}}},"/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"}}},"patch":{"summary":"Update account name and/or email (WO-A5)","operationId":"patchAccount","tags":["Billing"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Account updated"},"400":{"description":"Missing or invalid name/email"},"401":{"description":"Invalid API key"},"409":{"description":"Another account already owns this email"}}},"delete":{"summary":"Delete the authenticated account (WO-A5) — hard-deletes access surfaces and generated content, retains financial/audit records against an anonymized account shell","operationId":"deleteAccount","tags":["Billing"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Account deleted"},"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/entitlements":{"get":{"summary":"List the caller's own hub-and-spoke product entitlements","operationId":"listEntitlements","tags":["Billing"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Entitlement list"},"401":{"description":"Authentication required"}}}},"/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/usage/timeseries":{"get":{"summary":"Get day-bucketed usage (runs, per-program breakdown, credits spent) for usage graphs","operationId":"getUsageTimeseries","tags":["Billing"],"security":[{"apiKey":[]}],"parameters":[{"name":"bucket","in":"query","required":false,"schema":{"type":"string"},"description":"Bucket granularity — only 'day' is supported (default day)"},{"name":"since_days","in":"query","required":false,"schema":{"type":"string"},"description":"Window size in days (default 30, capped at 365)"}],"responses":{"200":{"description":"Day-bucketed usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageTimeseriesResponse"}}}},"400":{"description":"Unsupported bucket granularity"},"401":{"description":"Authentication required"}}}},"/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 across all accounts (admin only)","operationId":"getFunnelMetrics","tags":["Funnel"],"responses":{"200":{"description":"Funnel metrics"},"401":{"description":"Unauthorized"},"403":{"description":"Admin access required"}}}},"/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":"Admin: get database size and table statistics","operationId":"dbStats","tags":["Database"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Database stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DbStatsResponse"}}}},"401":{"description":"Authentication required"},"403":{"description":"Admin access required"},"500":{"description":"Database error"}}}},"/v1/db/maintenance":{"post":{"summary":"Admin: run database maintenance (ANALYZE)","operationId":"dbMaintenance","tags":["Database"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Maintenance results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DbMaintenanceResponse"}}}},"401":{"description":"Authentication required"},"403":{"description":"Admin access required"},"500":{"description":"Maintenance failed"}}}},"/v1/revops/prospects":{"post":{"summary":"Admin: ingest a prospect (dedups on website)","operationId":"revopsCreateProspect","tags":["RevOps"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Prospect (existing one returned when the website already exists)"},"400":{"description":"legal_name and source_id are required"},"401":{"description":"Authentication required"},"403":{"description":"Admin access required"}}}},"/v1/revops/prospects/{prospect_id}":{"get":{"summary":"Admin: get a prospect with derived stage, score and next action","operationId":"revopsGetProspect","tags":["RevOps"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Prospect, events, derived state and next action"},"401":{"description":"Authentication required"},"403":{"description":"Admin access required"},"404":{"description":"Prospect not found"}}},"patch":{"summary":"Admin: merge enrichment facts into a prospect","operationId":"revopsEnrichProspect","tags":["RevOps"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Updated prospect"},"400":{"description":"facts object is required"},"401":{"description":"Authentication required"},"403":{"description":"Admin access required"},"404":{"description":"Prospect not found"}}}},"/v1/revops/prospects/{prospect_id}/events":{"post":{"summary":"Admin: append a pipeline fact (stage advances on its own)","operationId":"revopsAppendEvent","tags":["RevOps"],"security":[{"apiKey":[]}],"responses":{"201":{"description":"Event, plus the resulting derived state and next action"},"400":{"description":"Unsupported event type"},"401":{"description":"Authentication required"},"403":{"description":"Admin access required"},"404":{"description":"Prospect not found"}}}},"/v1/revops/prospects/{prospect_id}/scan":{"post":{"summary":"Admin: enrich a prospect from its own public website (robots-respecting)","operationId":"revopsScanProspect","tags":["RevOps"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"ok:true with facts learned, signals recorded and derived state; ok:false with a policy code (ROBOTS_DISALLOWED, PRIVATE_HOST, NOT_HTTPS, FETCH_FAILED, NOT_HTML) when the fetch was declined"},"400":{"description":"Prospect has no website to scan"},"401":{"description":"Authentication required"},"403":{"description":"Admin access required"},"404":{"description":"Prospect not found"}}}},"/v1/revops/today":{"get":{"summary":"Admin: today's ranked work queue (what to do next)","operationId":"revopsTodayQueue","tags":["RevOps"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Due actions, ranked; `truncated` flags an incomplete load"},"401":{"description":"Authentication required"},"403":{"description":"Admin access required"}}}},"/v1/revops/funnel":{"get":{"summary":"Admin: funnel counts by stage, plus a rendered summary","operationId":"revopsFunnel","tags":["RevOps"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Cumulative reached/current counts, terminals, hot and due-today"},"401":{"description":"Authentication required"},"403":{"description":"Admin access required"}}}},"/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/auth/google":{"get":{"summary":"Start Google OAuth flow (redirects to Google)","operationId":"googleOAuthStart","tags":["OAuth"],"responses":{"302":{"description":"Redirect to Google authorization page"},"503":{"description":"Google OAuth not configured"}}}},"/v1/auth/google/callback":{"get":{"summary":"Google OAuth callback (exchanges code for token)","operationId":"googleOAuthCallback","tags":["OAuth"],"parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string"},"description":"Authorization code from Google"},{"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 Google if authorization was denied"}],"responses":{"302":{"description":"Redirect to web app with token"},"400":{"description":"Missing code or state parameter"},"502":{"description":"Google API error during token exchange"},"503":{"description":"Google OAuth not configured"}}}},"/oauth/authorize":{"get":{"summary":"OAuth 2.0 authorization endpoint (issues an auth code, redirects to redirect_uri)","operationId":"oauthAuthorize","tags":["OAuth"],"parameters":[{"name":"client_id","in":"query","required":false,"schema":{"type":"string"},"description":"Registered OAuth client id"},{"name":"redirect_uri","in":"query","required":false,"schema":{"type":"string"},"description":"Must exactly match a URI registered for this client"},{"name":"response_type","in":"query","required":false,"schema":{"type":"string"},"description":"Must be 'code'"},{"name":"scope","in":"query","required":false,"schema":{"type":"string"},"description":"Requested scope (default mcp:read)"},{"name":"state","in":"query","required":false,"schema":{"type":"string"},"description":"Opaque value echoed back to redirect_uri for CSRF protection"}],"responses":{"302":{"description":"Redirect to redirect_uri with a code (and state, if provided)"},"400":{"description":"Invalid request, unknown client_id, or unregistered redirect_uri"}}}},"/oauth/token":{"post":{"summary":"OAuth 2.0 token endpoint (exchanges an authorization code for an access token)","operationId":"oauthToken","tags":["OAuth"],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["grant_type","code","client_id","client_secret"],"properties":{"grant_type":{"type":"string","enum":["authorization_code"]},"code":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"}}}}}},"responses":{"200":{"description":"RS256-signed JWT access token (Bearer, 1h expiry)"},"400":{"description":"Invalid grant_type or missing fields"},"401":{"description":"Invalid client_id/client_secret"}}}},"/oauth/jwks":{"get":{"summary":"JSON Web Key Set for verifying tokens issued by /oauth/token","operationId":"oauthJwks","tags":["OAuth"],"responses":{"200":{"description":"JWKS document (RFC 7517)"}}}},"/oauth/introspect":{"post":{"summary":"OAuth 2.0 token introspection (RFC 7662)","operationId":"oauthIntrospect","tags":["OAuth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}}}}},"responses":{"200":{"description":"{ active: true, sub, client_id, scope, ... } or { active: false }"},"400":{"description":"Missing token"}}}},"/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/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/analytics/summary":{"get":{"summary":"Per-account analytics summary","operationId":"getAccountAnalyticsSummary","tags":["Account"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Analytics summary"},"401":{"description":"Authentication required"}}}},"/v1/account/analytics/events":{"post":{"summary":"Record an analytics event for the account","operationId":"recordAccountAnalyticsEvent","tags":["Account"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Event recorded"},"401":{"description":"Authentication required"}}}},"/v1/credits/packs":{"get":{"summary":"List purchasable credit packs","operationId":"listCreditPacks","tags":["Billing"],"responses":{"200":{"description":"Credit pack catalog"}}}},"/v1/credits/purchases":{"get":{"summary":"List the account's credit purchases","operationId":"listCreditPurchases","tags":["Billing"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Purchase history"},"401":{"description":"Authentication required"}}}},"/v1/credits/topup":{"post":{"summary":"Purchase a one-time credit top-up","operationId":"topupCredits","tags":["Billing"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Top-up initiated"},"401":{"description":"Authentication required"},"402":{"description":"Payment required"}}}},"/v1/admin/mcp-usage":{"get":{"summary":"Admin: MCP tool usage metrics","operationId":"getAdminMcpUsage","tags":["Admin"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"MCP usage metrics"},"403":{"description":"Admin access required"}}}},"/v1/admin/rest-usage":{"get":{"summary":"Admin: REST program usage metrics (cross-account)","operationId":"getAdminRestUsage","tags":["Admin"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"REST program usage metrics"},"403":{"description":"Admin access required"}}}},"/v1/pitch/render":{"post":{"summary":"Render a snapshot's generated pitch deck to a real .pptx file (clean investor deck or annotated diligence copy)","operationId":"pitchRender","tags":["Programs"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["snapshot_id"],"properties":{"snapshot_id":{"type":"string","description":"Snapshot whose generated pitch-deck.json to render"},"variant":{"type":"string","enum":["clean","annotated"],"description":"Which of the two documents to render: \"clean\" (default) is the investor deck — no speaker notes, no provenance annotations; \"annotated\" is the diligence copy with speaker notes and per-slide provenance footers"},"artifact":{"type":"string","enum":["generated","composed"],"description":"Which stored deck to render: \"generated\" (default, the deterministic deck) or \"composed\" (the inference-filled sibling written by POST /v1/pitch/compose)"},"render_backgrounds":{"type":"boolean","description":"Opt-in, best-effort AI slide backgrounds (one xAI call per distinct slide art key; slides fall back to a solid background on any failure)"}}}}}},"responses":{"200":{"description":"PowerPoint (.pptx) binary of the rendered deck; X-Axis-Variant echoes which document was produced"},"400":{"description":"Missing/invalid snapshot_id, or variant not one of clean|annotated"},"402":{"description":"The pitch program is not enabled on this account"},"404":{"description":"Snapshot not found, or it has no pitch-deck.json artifact"},"500":{"description":"Stored pitch-deck.json is malformed or has no slides"}}}},"/v1/pitch/compose":{"post":{"summary":"Fill the generated pitch deck's owner-input slots with citation-oracle-verified inference from the snapshot's own documents (draft-over-ask)","operationId":"pitchCompose","tags":["Programs"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["snapshot_id"],"properties":{"snapshot_id":{"type":"string","description":"Snapshot whose generated pitch-deck.json to compose from"}}}}}},"responses":{"200":{"description":"Compose report. composed:true persists pitch-deck-composed.json (render via /v1/pitch/render with artifact:\"composed\"); composed:false with a labeled reason when no local model is configured — nothing is fabricated"},"400":{"description":"Missing or invalid snapshot_id"},"402":{"description":"The pitch program is not enabled on this account"},"404":{"description":"Snapshot not found, or it has no pitch-deck.json artifact"},"410":{"description":"Source content was discarded after web logout — the citation oracle has nothing to verify against"},"500":{"description":"Stored pitch-deck.json is malformed"}}}},"/v1/admin/session":{"post":{"summary":"Admin: exchange the owner ADMIN_API_KEY for an HttpOnly admin-elevation cookie","operationId":"createAdminSession","tags":["Admin"],"responses":{"200":{"description":"Admin session established"},"403":{"description":"Invalid admin key"}}},"delete":{"summary":"Admin: clear the admin-elevation cookie","operationId":"clearAdminSession","tags":["Admin"],"responses":{"200":{"description":"Admin session cleared"}}}},"/v1/admin/revenue":{"get":{"summary":"Admin: revenue metrics","operationId":"getAdminRevenue","tags":["Admin"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Revenue metrics"},"403":{"description":"Admin access required"}}}},"/v1/admin/entitlements/grant":{"post":{"summary":"Admin: grant one account access to one hub-and-spoke product","operationId":"adminGrantEntitlement","tags":["Admin"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Entitlement granted"},"400":{"description":"Missing or invalid account_id/product_id"},"403":{"description":"Admin access required"}}}},"/v1/auth/session":{"post":{"summary":"Establish an HttpOnly session cookie from an API key","operationId":"authSession","tags":["Auth"],"responses":{"200":{"description":"Session established"},"401":{"description":"Invalid credentials"}}}},"/v1/auth/exchange":{"post":{"summary":"Exchange an OAuth code for a session","operationId":"authExchange","tags":["Auth"],"responses":{"200":{"description":"Session established"},"400":{"description":"Invalid exchange"}}}},"/v1/auth/logout":{"post":{"summary":"Clear the session cookie","operationId":"authLogout","tags":["Auth"],"responses":{"200":{"description":"Logged out"}}}},"/v1/github/webhook":{"post":{"summary":"GitHub push webhook (re-analysis trigger)","operationId":"githubWebhook","tags":["GitHub"],"responses":{"202":{"description":"Accepted for processing"},"401":{"description":"Invalid signature"}}}},"/v1/github/architecture-drift":{"post":{"summary":"GitHub push webhook that opens a living-architecture drift PR","operationId":"githubArchitectureDrift","tags":["GitHub"],"responses":{"202":{"description":"Accepted for processing"},"401":{"description":"Invalid signature"}}}},"/v1/deploy/generate":{"post":{"summary":"Generate deployment configuration artifacts","operationId":"generateDeploy","tags":["Programs"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Deployment artifacts"}}}},"/portal/api/subscribe":{"post":{"summary":"Create a PAI'D hosted checkout session (returns a redirect URL)","description":"Creates a PAI'D HOSTED checkout session for the Starter plan and returns its checkout_url. The client redirects the buyer to that URL — PAI'D hosts the payment page (there is no inline Stripe Elements / client_secret flow). Tier activation is webhook-driven after the payment completes.","operationId":"paidSubscribe","tags":["Payments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["plan","email"],"properties":{"plan":{"type":"string","enum":["monthly","annual"],"description":"Billing cycle"},"email":{"type":"string","format":"email"},"idempotency_key":{"type":"string"}}}}}},"responses":{"200":{"description":"Hosted checkout session created","content":{"application/json":{"schema":{"type":"object","properties":{"checkout_url":{"type":"string","description":"PAI'D's hosted checkout page — redirect the buyer here"},"session_id":{"type":"string"},"status":{"type":"string"}}}}}},"400":{"description":"Invalid plan or email"},"404":{"description":"No account found for that email"},"502":{"description":"Payment processor rejected request"},"503":{"description":"Payment processor not configured (PAI'D env missing)"}}}},"/portal/api/paid/config":{"get":{"summary":"PAI'D checkout configuration probe (public, no auth)","description":"Reports whether the PAI'D payment rail can create a hosted checkout session: true when PAID_API_BASE_URL + PAID_MERCHANT_ID + PAID_API_KEY are set. No Stripe publishable key is needed (PAI'D hosts the page). No secret is ever exposed in the response.","operationId":"paidConfig","tags":["Payments"],"responses":{"200":{"description":"Configuration status","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"}}}}}}}}},"/portal/api/paid/webhook":{"post":{"summary":"PAI'D webhook receiver (Webhook-Signature verified)","operationId":"paidWebhook","tags":["Payments"],"responses":{"200":{"description":"Webhook processed"},"400":{"description":"Invalid payload"},"401":{"description":"Invalid webhook signature"},"503":{"description":"Webhook signing key 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/account/sentry-token":{"post":{"summary":"Save a Sentry connection (token + org/project + watched-repo mapping)","operationId":"saveSentryConnection","tags":["Debug"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveSentryConnectionRequest"}}}},"responses":{"201":{"description":"Connection saved"},"400":{"description":"Invalid connection fields"},"401":{"description":"Authentication required"}}},"get":{"summary":"List stored Sentry connections (masked)","operationId":"listSentryConnections","tags":["Debug"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Connection listing"},"401":{"description":"Authentication required"}}}},"/v1/account/sentry-token/{token_id}":{"delete":{"summary":"Delete a stored Sentry connection","operationId":"deleteSentryConnection","tags":["Debug"],"security":[{"apiKey":[]}],"parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string"},"description":"Sentry connection identifier"}],"responses":{"200":{"description":"Connection deleted"},"401":{"description":"Authentication required"},"404":{"description":"Connection not found"}}}},"/v1/sentry/webhook":{"post":{"summary":"Sentry incident webhook (postmortem-draft trigger)","operationId":"sentryWebhook","tags":["Debug"],"responses":{"200":{"description":"Processed (handled flag + enqueued count)"},"400":{"description":"Invalid JSON body"},"401":{"description":"Signature verification failed"}}}},"/v1/account/provider-key":{"post":{"summary":"Save an LLM provider API key (openai | anthropic) for a watched repo","operationId":"saveProviderCredential","tags":["Optimization"],"security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveProviderCredentialRequest"}}}},"responses":{"201":{"description":"Credential saved"},"400":{"description":"Invalid credential fields"},"401":{"description":"Authentication required"}}},"get":{"summary":"List stored provider credentials (masked)","operationId":"listProviderCredentials","tags":["Optimization"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Credential listing"},"401":{"description":"Authentication required"}}}},"/v1/account/provider-key/{credential_id}":{"delete":{"summary":"Delete a stored provider credential","operationId":"deleteProviderCredential","tags":["Optimization"],"security":[{"apiKey":[]}],"parameters":[{"name":"credential_id","in":"path","required":true,"schema":{"type":"string"},"description":"Provider credential identifier"}],"responses":{"200":{"description":"Credential deleted"},"401":{"description":"Authentication required"},"404":{"description":"Credential 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 the one-time cost of switching tiers","operationId":"prorationPreview","tags":["Billing"],"security":[{"apiKey":[]}],"parameters":[{"name":"tier","in":"query","required":false,"schema":{"type":"string"},"description":"Target tier to preview (free | paid | suite)"}],"responses":{"200":{"description":"Tier-switch cost preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProrationPreviewResponse"}}}},"400":{"description":"Missing or invalid tier query parameter"},"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/account/fleet":{"get":{"summary":"Cross-project fleet report (portfolio health + org CLAUDE.md) for accounts with >=2 analyzed projects","operationId":"getAccountFleet","tags":["Fleet"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Fleet status and, when ready, the fleet-report.md/fleet-CLAUDE.md artifacts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FleetResponse"}}}},"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":"Public stats — process start time and today's UTC date (no usage numbers; the counters are admin-only at GET /v1/admin/stats)","operationId":"getStats","tags":["Health"],"responses":{"200":{"description":"Non-usage process facts","content":{"application/json":{"schema":{"type":"object","properties":{"process_started_at":{"type":"string","format":"date-time"},"date":{"type":"string","format":"date"}},"required":["process_started_at","date"]}}}}}}},"/":{"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"}}}},"/v1/feedback":{"post":{"summary":"Submit customer feedback or a support ticket — public, no auth. Agents are first-class reporters: file a structured report when a tool call misbehaves.","operationId":"submitFeedback","tags":["Discovery"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","minLength":10,"maxLength":5000,"description":"What happened — what you expected and what actually occurred. Exact error text is the most useful thing you can include."},"category":{"type":"string","enum":["bug","feature","question","praise","other"],"description":"Defaults to 'other' when omitted — never inferred from the message."},"email":{"type":"string","description":"Optional reply address. Omit to report anonymously; the ticket is still delivered, it just can't be answered."},"rating":{"type":"integer","minimum":1,"maximum":5,"description":"Optional 1-5 experience rating."},"page":{"type":"string","description":"Optional context — the page or surface the report is about."}}}}}},"responses":{"200":{"description":"Ticket delivered to the support inbox. Returns ticket_id for follow-up."},"400":{"description":"Validation failed — the response names the offending field."},"429":{"description":"Too many submissions from this network (5/hour). Response carries the direct support address as an alternative."},"502":{"description":"Email provider rejected or was unreachable — the ticket was NOT delivered; use the fallback_email in the response."},"503":{"description":"Email delivery is not configured on this server — the ticket was NOT delivered; use the fallback_email in the response."}}}}},"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"}}},"ProjectsListResponse":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"project_id":{"type":"string"},"name":{"type":"string"},"github_url":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"latest_snapshot":{"type":"object","nullable":true,"properties":{"snapshot_id":{"type":"string"},"status":{"type":"string","enum":["processing","ready","failed"]},"created_at":{"type":"string","format":"date-time"},"file_count":{"type":"integer"},"compliance_grade":{"type":"object"}}},"snapshot_count":{"type":"integer"}}}},"total":{"type":"integer"}}},"ProjectSnapshotsResponse":{"type":"object","properties":{"project_id":{"type":"string"},"snapshots":{"type":"array","items":{"type":"object","properties":{"snapshot_id":{"type":"string"},"status":{"type":"string","enum":["processing","ready","failed"]},"created_at":{"type":"string","format":"date-time"},"file_count":{"type":"integer"},"compliance_grade":{"type":"object"}}}},"count":{"type":"integer"}}},"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"}}}}},"UsageTimeseriesResponse":{"type":"object","properties":{"buckets":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"UTC calendar date, YYYY-MM-DD"},"runs":{"type":"integer"},"by_program":{"type":"object","additionalProperties":{"type":"integer"}},"credits_spent":{"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"},"live_counters":{"type":"object","description":"The live usage counters (admin only; the public GET /v1/stats carries none since 2026-10-13). MCP counts are this process's, reset on restart; the restart-durable ledger is GET /v1/admin/mcp-usage.","properties":{"mcp_calls_today":{"type":"integer"},"mcp_calls_total":{"type":"integer"},"protocol_calls":{"type":"integer"},"x402_challenges_issued":{"type":"integer"},"paid_settlements":{"type":"integer","description":"Real settled payments plus the $0.01 ping_payment probe's settlements"},"paid_settlements_cents":{"type":"integer","description":"Real settled cash only"},"top_tools":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"count":{"type":"integer"}}}},"process_started_at":{"type":"string","format":"date-time"},"date":{"type":"string","format":"date"}}}}},"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"}}},"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"}}},"SaveSentryConnectionRequest":{"type":"object","required":["token","org_slug","project_slug","repo_full_name"],"properties":{"token":{"type":"string","description":"Sentry auth token with event:read scope — used for plain-REST issue/event hydration, never echoed back"},"org_slug":{"type":"string","description":"Sentry organization slug the token reads"},"project_slug":{"type":"string","description":"Sentry project slug whose incidents map to the watched repo"},"repo_full_name":{"type":"string","description":"owner/repo — the watched repository this Sentry project's incidents belong to"},"webhook_secret":{"type":"string","description":"Optional: your Sentry integration's webhook signing secret. Without it, incidents cannot trigger POST /v1/sentry/webhook (fail closed) — the token stays usable for outbound reads only"},"label":{"type":"string","description":"Optional label for the connection"}}},"SaveProviderCredentialRequest":{"type":"object","required":["provider","key","repo_full_name"],"properties":{"provider":{"type":"string","enum":["openai","anthropic"],"description":"Which LLM provider this key belongs to"},"key":{"type":"string","description":"A usage/cost-read-capable API key for the given provider — used for plain-REST usage pulls, never echoed back"},"repo_full_name":{"type":"string","description":"owner/repo — the watched repository this key's real usage will be reconciled against"},"label":{"type":"string","description":"Optional label for the credential"},"metadata":{"type":"object","description":"Optional provider-specific extra fields (e.g. an OpenAI organization id)"}}},"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","description":"PAI'D is one-time-charge only — there is no billing period to prorate within. proration_amount is the full one-time price of to_tier (no credit for time remaining on from_tier).","properties":{"current_tier":{"type":"string"},"target_tier":{"type":"string"},"from_tier":{"type":"string"},"to_tier":{"type":"string"},"proration_amount":{"type":"number","description":"Full one-time price of to_tier, in cents."},"direction":{"type":"string","enum":["upgrade","downgrade","none"]}}},"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"}}},"FleetFile":{"type":"object","properties":{"path":{"type":"string"},"content":{"type":"string"},"content_type":{"type":"string"},"program":{"type":"string"},"description":{"type":"string"}}},"FleetResponse":{"type":"object","properties":{"ready":{"type":"boolean"},"project_count":{"type":"integer"},"eligible_projects":{"type":"integer"},"reason":{"type":"string","description":"Present only when ready is false"},"projects":{"type":"array","items":{"type":"string"},"description":"Present only when ready is true"},"files":{"type":"array","items":{"$ref":"#/components/schemas/FleetFile"},"description":"Present only when ready is true"}}},"MemoryEntry":{"type":"object","properties":{"id":{"type":"string"},"project_id":{"type":"string"},"account_id":{"type":"string"},"kind":{"type":"string","enum":["decision","convention","evidence","goal"]},"content":{"type":"string"},"source":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"AddMemoryRequest":{"type":"object","required":["kind","content"],"properties":{"kind":{"type":"string","enum":["decision","convention","evidence","goal"]},"content":{"type":"string","maxLength":4000},"source":{"type":"string","maxLength":500}}},"MemoryListResponse":{"type":"object","properties":{"project_id":{"type":"string"},"entries":{"type":"array","items":{"$ref":"#/components/schemas/MemoryEntry"}},"count":{"type":"integer"},"total":{"type":"integer"}}},"MemoryEntryResponse":{"type":"object","properties":{"entry":{"$ref":"#/components/schemas/MemoryEntry"},"total":{"type":"integer"}}}}}}