{"openapi":"3.1.0","info":{"title":"Spendplane API — Data VPN Firewall & AI Gateway","version":"1.0.0","description":"Pre-egress PII/secret redaction, intelligent model routing, spend caps, and reversible agent privacy across Mobile, Desktop, IDEs, and Production APIs.","contact":{"name":"Spendplane Support","url":"https://spendplane.com","email":"support@spendplane.com"},"termsOfService":"https://spendplane.com/terms"},"servers":[{"url":"https://api.spendplane.com","description":"Spendplane Production API & Gateway"}],"externalDocs":{"description":"Spendplane LLM & Agent Documentation","url":"https://spendplane.com/llms-full.txt"},"paths":{"/v1/openai/chat/completions":{"post":{"operationId":"openaiChatCompletions","summary":"OpenAI-compatible chat completions with pre-egress PII redaction, spend caps, and smart routing","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","example":"gpt-4o-mini"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}}}},"stream":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"OpenAI-compatible completion response"}}}},"/api/v1/planner/catalog":{"get":{"operationId":"getPlannerCatalog","summary":"List project templates, execution modes, and routing presets for Spendplane Planner","responses":{"200":{"description":"Planner catalog JSON"}}}},"/api/v1/planner/market-catalog":{"get":{"operationId":"getPlannerMarketCatalog","summary":"Fetch live LLM and GPU pricing catalog used by Spendplane Planner","responses":{"200":{"description":"Live model and GPU market catalog"}}}},"/api/v1/planner/ide/estimate":{"post":{"operationId":"estimateProjectWorkload","summary":"Estimate build cost, monthly run cost, execution mix (local/budget/premium), and ETA for a repository","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["project"],"properties":{"project":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"file_count":{"type":"integer"},"estimated_loc":{"type":"integer"},"dependencies_count":{"type":"integer"},"frameworks":{"type":"array","items":{"type":"string"}}}},"template_id":{"type":"string"},"mode_id":{"type":"string","enum":["frugal","balanced","max_quality"]}}}}}},"responses":{"200":{"description":"Workload estimate and recommendations"}}}},"/mcp":{"post":{"operationId":"mcpJsonRpc","summary":"Spendplane Remote MCP Server (Streamable HTTP JSON-RPC 2.0) for leak scanning, cost estimation, and reversible agent redaction","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":["string","integer"]},"method":{"type":"string","example":"tools/list"},"params":{"type":"object"}}}}}},"responses":{"200":{"description":"MCP JSON-RPC 2.0 response"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sp_live_...","description":"Spendplane workspace API key (optional for public MCP discovery/simulation and planner preview)."}}}}