{"openapi": "3.1.0", "info": {"title": "Rank-Anything (ANY-B02) — Polymorphic SEO+GEO Audit & 50-Page Matrix Compiler", "version": "1.0.0", "description": "Deterministic SEO + AI Search Citation (GEO) auditor and 50-page programmatic asset compiler. Enforces strict SSRF protection, anti-fake-200 rejection ($0 billed on dead links, fake-200, or SSRF blocks), 7d-30d cross-tenant ArchiveCache (100% new-tenant / 10% repeat-tenant), and Zero Prompt & Trace Resale privacy guarantees.", "x-service-name": "rank-anything", "x-pricing-micros": {"audit": 150000, "generate_pack": 1500000}}, "servers": [{"url": "https://rank.fastmesh.dev", "description": "Public HTTPS Origin"}, {"url": "http://127.0.0.1:8922", "description": "Local Upstream Server"}], "paths": {"/health": {"get": {"operationId": "getHealth", "summary": "Service health, uptime, calibration source, and cache/ledger telemetry", "responses": {"200": {"description": "Healthy service status", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HealthResponse"}}}}}}}, "/openapi.json": {"get": {"operationId": "getOpenApiSpec", "summary": "Retrieve this OpenAPI 3.1.0 specification", "responses": {"200": {"description": "OpenAPI 3.1.0 JSON document", "content": {"application/json": {"schema": {"type": "object"}}}}}}}, "/v1/audit": {"post": {"operationId": "auditSite", "summary": "Run live polymorphic SEO+GEO site audit with anti-fake-200 and cross-tenant cache", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AuditRequest"}}}}, "responses": {"200": {"description": "Verified audit result OR unbilled ($0) dead-link / fake-200 diagnostic", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AuditResponse"}}}}, "422": {"description": "Invalid input or SSRF blocked ($0 billed)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AuditResponse"}}}}}}}, "/v1/generate-pack": {"post": {"operationId": "generateGeoPack", "summary": "Compile llms.txt, llms-full.txt, SKILL.md, 1-50 unique HTML+MD pages, sitemap.xml, and playbook", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GeneratePackRequest"}}}}, "responses": {"200": {"description": "Compiled GEO asset pack with SHA-256 receipt (or unbilled $0 failure)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GeneratePackResponse"}}}}, "422": {"description": "Invalid input, invalid page_count, or SSRF blocked ($0 billed)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GeneratePackResponse"}}}}}}}, "/v1/batch-audit": {"post": {"operationId": "batchAuditSites", "summary": "Run concurrent multi-URL SEO+GEO audits via TableWaterfallEngine", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BatchAuditRequest"}}}}, "responses": {"200": {"description": "Batch audit table result with per-row SHA-256 receipts", "content": {"application/json": {"schema": {"type": "object"}}}}, "422": {"description": "Invalid batch request ($0 billed)", "content": {"application/json": {"schema": {"type": "object"}}}}}}}, "/webhooks/creem": {"post": {"operationId": "creemWebhook", "summary": "Creem payment webhook endpoint with HMAC-SHA256 verification and idempotent credit ledger", "parameters": [{"name": "creem-signature", "in": "header", "required": true, "schema": {"type": "string"}, "description": "HMAC-SHA256 hex digest of raw request body signed with CREEM_WEBHOOK_SECRET"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "Webhook verified and idempotently applied", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Invalid HMAC signature"}, "503": {"description": "Webhook secret not configured"}}}}, "/mcp": {"post": {"operationId": "mcpJsonRpc", "summary": "Native MCP JSON-RPC 2.0 endpoint (DualMcpFacade meta-tools + direct Rank-Anything tools)", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/McpJsonRpcRequest"}}}}, "responses": {"200": {"description": "JSON-RPC 2.0 response envelope", "content": {"application/json": {"schema": {"type": "object"}}}}}}}}, "components": {"schemas": {"HealthResponse": {"type": "object", "required": ["ok", "service", "version", "domain", "upstream_port", "uptime_s"], "properties": {"ok": {"type": "boolean"}, "service": {"type": "string"}, "version": {"type": "string"}, "domain": {"type": "string"}, "upstream_port": {"type": "integer"}, "uptime_s": {"type": "number"}, "calibration_source": {"type": "string"}, "cache_stats": {"type": "object"}, "ledger_stats": {"type": "object"}, "mcp_tool_count": {"type": "integer"}}}, "AuditRequest": {"type": "object", "required": ["url"], "properties": {"url": {"type": "string", "format": "uri"}, "tenant_id": {"type": "string", "default": "public"}, "keyword": {"type": "string"}, "keywords": {"type": "array", "items": {"type": "string"}}, "no_cache": {"type": "boolean", "default": false}, "max_age_s": {"type": ["integer", "null"]}}}, "AuditResponse": {"type": "object", "required": ["ok", "status_code", "billed_micros", "charged_micros", "receipt_sha256"], "properties": {"ok": {"type": "boolean"}, "status_code": {"type": "integer"}, "url": {"type": "string"}, "final_url": {"type": "string"}, "domain": {"type": "string"}, "upstream_status": {"type": ["integer", "null"]}, "overall_score": {"type": ["integer", "null"], "minimum": 0, "maximum": 100}, "technical_seo_score": {"type": ["integer", "null"]}, "geo_readiness_score": {"type": ["integer", "null"]}, "grade": {"type": ["string", "null"]}, "archetype": {"type": ["object", "null"]}, "breakdown": {"type": "object"}, "missing_items": {"type": "array", "items": {"type": "string"}}, "gaps": {"type": "array", "items": {"type": "object"}}, "signals": {"type": "object"}, "fake_200_detected": {"type": "boolean"}, "fake_200_reason": {"type": ["string", "null"]}, "cache": {"type": "object"}, "billed_micros": {"type": "integer"}, "charged_micros": {"type": "integer"}, "calibration_source": {"type": "string"}, "receipt_sha256": {"type": "string"}, "error_code": {"type": ["string", "null"]}, "error_detail": {"type": ["string", "null"]}}}, "GeneratePackRequest": {"type": "object", "required": ["url"], "properties": {"url": {"type": "string", "format": "uri"}, "tenant_id": {"type": "string", "default": "public"}, "brand_name": {"type": "string"}, "keywords": {"type": "array", "items": {"type": "string"}}, "competitors": {"type": "array", "items": {"type": "string"}}, "page_count": {"type": "integer", "minimum": 1, "maximum": 50, "default": 50}, "include_pages": {"type": "boolean", "default": true}, "base_url": {"type": "string"}, "skip_live_audit": {"type": "boolean", "default": false}, "custom_topics": {"type": "array", "items": {"type": "object"}}, "extra_facts": {"type": "array", "items": {"type": "string"}}, "output_dir": {"type": "string"}}}, "GeneratePackResponse": {"type": "object", "required": ["ok", "status_code", "page_count", "billed_micros", "charged_micros", "receipt_sha256"], "properties": {"ok": {"type": "boolean"}, "status_code": {"type": "integer"}, "url": {"type": "string"}, "domain": {"type": "string"}, "brand_name": {"type": ["string", "null"]}, "archetype": {"type": ["object", "null"]}, "audit_summary": {"type": ["object", "null"]}, "page_count": {"type": "integer"}, "intents_distribution": {"type": "object"}, "files": {"type": "object"}, "pages": {"type": "array", "items": {"type": "object"}}, "pages_manifest": {"type": "array", "items": {"type": "object"}}, "artifact_hashes": {"type": "object"}, "invariants_verified": {"type": "object"}, "output_dir_written": {"type": ["string", "null"]}, "billed_micros": {"type": "integer"}, "charged_micros": {"type": "integer"}, "receipt_sha256": {"type": "string"}, "error_code": {"type": ["string", "null"]}, "error_detail": {"type": ["string", "null"]}}}, "BatchAuditRequest": {"type": "object", "properties": {"urls": {"type": "array", "items": {"type": "string"}}, "rows": {"type": "array", "items": {"type": "object"}}, "tenant_id": {"type": "string", "default": "public"}, "max_age_s": {"type": ["integer", "null"]}, "export_csv": {"type": "boolean", "default": false}}}, "McpJsonRpcRequest": {"type": "object", "required": ["jsonrpc", "id", "method"], "properties": {"jsonrpc": {"type": "string", "const": "2.0"}, "id": {"type": ["string", "integer"]}, "method": {"type": "string", "enum": ["initialize", "tools/list", "tools/call"]}, "params": {"type": "object"}}}}}}