{"openapi":"3.1.0","info":{"title":"Alphonce Client API","version":"1.0.0","description":"Public developer surface for Alphonce. Authenticate with an Alphonce API token (`aph_*`) from Settings → Connected accounts, then use MCP over HTTP. Portfolio, trading, strategies, and research are exposed as MCP tools — not as separate REST resources. See /docs/mcp for the tool catalogue.","contact":{"name":"Alphonce","url":"http://localhost:3000"}},"servers":[{"url":"http://localhost:3000","description":"Production / configured app origin"},{"url":"http://localhost:3000","description":"Local development"}],"tags":[{"name":"Platform","description":"Public health and discovery"},{"name":"MCP","description":"Model Context Protocol over HTTP"}],"components":{"securitySchemes":{"AlphonceToken":{"type":"http","scheme":"bearer","bearerFormat":"aph_*","description":"Alphonce API token from Settings → Connected accounts. Also accepted as ?apikey=."},"AlphonceApiKeyQuery":{"type":"apiKey","in":"query","name":"apikey","description":"Same Alphonce API token via query string."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]},"JsonRpcRequest":{"type":"object","required":["jsonrpc","id","method"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"method":{"type":"string"},"params":{"type":"object"}}}}},"paths":{"/api/status":{"get":{"tags":["Platform"],"operationId":"getStatus","summary":"System status","responses":{"200":{"description":"Status payload","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/openapi":{"get":{"tags":["Platform"],"operationId":"getOpenApi","summary":"OpenAPI document","responses":{"200":{"description":"OpenAPI 3.1 JSON","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/mcp/manifest.json":{"get":{"tags":["Platform"],"operationId":"getMcpManifest","summary":"MCP server manifest","responses":{"200":{"description":"Manifest JSON","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/mcp":{"post":{"tags":["MCP"],"operationId":"mcpTradingPost","summary":"Trading MCP (streamable HTTP)","security":[{"AlphonceToken":[]},{"AlphonceApiKeyQuery":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"JSON-RPC / SSE MCP response"},"401":{"description":"Missing or invalid Alphonce token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan required (Chui / Premium+)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["MCP"],"operationId":"mcpTradingGet","summary":"Trading MCP (SSE)","security":[{"AlphonceToken":[]},{"AlphonceApiKeyQuery":[]}],"parameters":[{"name":"Mcp-Session-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"SSE stream"},"401":{"description":"Unauthorized"}}},"delete":{"tags":["MCP"],"operationId":"mcpTradingDelete","summary":"Close Trading MCP session","security":[{"AlphonceToken":[]},{"AlphonceApiKeyQuery":[]}],"parameters":[{"name":"Mcp-Session-Id","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Session closed"},"401":{"description":"Unauthorized"}}}},"/api/mcp/research":{"post":{"tags":["MCP"],"operationId":"mcpResearchPost","summary":"Research MCP (streamable HTTP)","security":[{"AlphonceToken":[]},{"AlphonceApiKeyQuery":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"JSON-RPC / SSE MCP response"},"401":{"description":"Unauthorized"},"403":{"description":"Plan required"}}},"get":{"tags":["MCP"],"operationId":"mcpResearchGet","summary":"Research MCP (SSE)","security":[{"AlphonceToken":[]},{"AlphonceApiKeyQuery":[]}],"responses":{"200":{"description":"SSE stream"},"401":{"description":"Unauthorized"}}},"delete":{"tags":["MCP"],"operationId":"mcpResearchDelete","summary":"Close Research MCP session","security":[{"AlphonceToken":[]},{"AlphonceApiKeyQuery":[]}],"responses":{"200":{"description":"Session closed"},"401":{"description":"Unauthorized"}}}},"/api/mcp/oauth/authorize":{"get":{"tags":["MCP"],"operationId":"mcpOAuthAuthorize","summary":"OAuth authorize","description":"OAuth 2.0 authorization code + PKCE.","responses":{"302":{"description":"Redirect to login / consent"}}}},"/api/mcp/oauth/token":{"post":{"tags":["MCP"],"operationId":"mcpOAuthToken","summary":"OAuth token exchange","responses":{"200":{"description":"Access token"},"400":{"description":"Invalid grant"}}}}}}