{"openapi": "3.1.0", "info": {"title": "NyxSynth (NYX) Managed x402 Gateway & Post-Quantum Settlement API", "version": "1.0.0", "summary": "Post-quantum AI-agent settlement, HTTP 402 (x402) metered inference, MCP tools & live ledger telemetry.", "description": "Official API specification for NyxSynth (NYX) atop the Bioluminescent Coordination Protocol (BCP). Supports SHA3-256 hashed X-NYX-API-KEY gateway authentication, live Gemini/OpenAI/Anthropic/Ollama and deterministic MCP/WASM tool routing, HTTP 402 quota upgrade negotiation, and Stripe HMAC-SHA256 webhooks.", "termsOfService": "https://platform.nyxsynth.com/terms", "contact": {"name": "NyxSynth", "url": "https://nyxsynth.com", "email": "contact@nyxsynth.com"}, "license": {"name": "Proprietary \u2014 All Rights Reserved", "url": "https://platform.nyxsynth.com/terms"}}, "servers": [{"url": "https://platform.nyxsynth.com", "description": "Active NyxSynth Platform Server"}, {"url": "https://platform.nyxsynth.com", "description": "Production Public Testnet Platform"}], "components": {"securitySchemes": {"NyxApiKeyAuth": {"type": "apiKey", "in": "header", "name": "X-NYX-API-KEY", "description": "Tenant API key (`nyx_live_...`), stored SHA3-256 hashed at rest."}, "NyxAdminTokenAuth": {"type": "apiKey", "in": "header", "name": "X-NYX-ADMIN-TOKEN", "description": "Operator admin token required for commercial `/revenue` admin mutations."}}}, "paths": {"/api/platform/state": {"get": {"summary": "Live Cluster, Marketplace, Governance & Platform Telemetry", "tags": ["Platform"], "responses": {"200": {"description": "Current live platform state snapshot"}}}}, "/api/v1/gateway/providers": {"get": {"summary": "List Active Upstream LLM & Built-In Deterministic MCP/WASM Providers", "tags": ["Gateway"], "responses": {"200": {"description": "Public-safe upstream provider capabilities (zero secrets)"}}}}, "/api/v1/gateway/status": {"get": {"summary": "Verify API Key & Inspect Monthly Call Quota", "tags": ["Gateway"], "security": [{"NyxApiKeyAuth": []}], "responses": {"200": {"description": "Authenticated tenant plan, calls_this_month & included_calls"}, "401": {"description": "Missing, invalid, or suspended API key"}}}}, "/api/v1/gateway/infer": {"post": {"summary": "Execute Metered AI Inference or Deterministic MCP/WASM Tool Call", "tags": ["Gateway"], "security": [{"NyxApiKeyAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"listing_id": {"type": "string", "default": "mcp-x402-deep-search", "enum": ["mcp-x402-deep-search", "mcp-x402-wasm-prover", "embed-hadal-v3", "llm-nyxsynth-abyssal-70b"]}, "prompt": {"type": "string", "maxLength": 2000}, "calls_count": {"type": "integer", "minimum": 1, "maximum": 10000, "default": 1}, "provider": {"type": "string", "description": "Optional override: auto | mcp | gemini | openai | anthropic | ollama"}, "model": {"type": "string", "description": "Optional upstream model override"}}}}}}, "responses": {"200": {"description": "Verified AI/MCP completion, SHA3 attestation & on-chain settlement receipt"}, "401": {"description": "Invalid or missing X-NYX-API-KEY"}, "402": {"description": "DEVELOPER_FREE 1,000-call quota reached \u2014 upgrade via POST /api/v1/gateway/upgrade"}}}}, "/api/v1/gateway/upgrade": {"post": {"summary": "Create Self-Service Stripe Checkout Upgrade Session for Active API Key", "tags": ["Gateway"], "security": [{"NyxApiKeyAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["plan_code"], "properties": {"plan_code": {"type": "string", "enum": ["STARTER", "GROWTH", "ENTERPRISE"]}}}}}}, "responses": {"200": {"description": "Upgrade invoice & Stripe Checkout session (auto-upgrades tenant on webhook payment)"}, "400": {"description": "Unsupported plan_code"}, "401": {"description": "Invalid or missing X-NYX-API-KEY"}}}}, "/api/webhooks/stripe": {"post": {"summary": "Stripe HMAC-SHA256 Signed Payment Webhook Receiver", "tags": ["Billing"], "responses": {"200": {"description": "Invoice marked PAID & pending plan upgrade activated atomically"}, "401": {"description": "Invalid Stripe-Signature or expired timestamp"}}}}, "/api/explorer/search": {"get": {"summary": "Universal Ledger Search (Block Height, TX ID, bcp1... Address, Mandate ID)", "tags": ["Explorer"], "parameters": [{"name": "q", "in": "query", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Search result"}}}}, "/api/ops/preflight": {"get": {"summary": "Live Production Pre-Flight Health & Cryptographic Posture Audit", "tags": ["Operations"], "responses": {"200": {"description": "6-check operational health report"}}}}}}