{"openapi": "3.1.0", "info": {"title": "Swallow-to-Cash Three-Stage Monetization & Escrow Engine (W4-F01)", "version": "1.0.0", "description": "Swallow any permissive GitHub repo, CLI --help tree, REST/HAR capture, GraphQL schema, SQLite/CSV table, or raw MCP server -> compile into a standalone runnable metered sub-service + remote /mcp + OpenAPI 3.1 + 0%-commission treg hub pack -> enforce SQLite WAL micro-USD escrow, 4D budget locks, SHA-256 Proof-of-Delivery receipts, and $0 rollback on empty/fake-200. Zero prompt, trace, or customer data resale.", "x-task-id": "W4-F01", "x-zero-prompt-resale": true, "x-mcp-tools": ["swallow_inspect", "swallow_compile", "escrow_simulate", "escrow_settle", "escrow_wallet_status", "tools_search", "tools_inspect", "tools_execute", "tools_poll_receipt"]}, "servers": [{"url": "https://swallowcash.fastmesh.dev"}, {"url": "http://127.0.0.1:9021"}], "paths": {"/health": {"get": {"summary": "Service health, SQLite WAL audit, ArchiveCache telemetry, and 6 supported source kinds", "responses": {"200": {"description": "Healthy status payload"}}}}, "/openapi.json": {"get": {"summary": "OpenAPI 3.1.0 specification", "responses": {"200": {"description": "OpenAPI document"}}}}, "/v1/swallow/inspect": {"post": {"summary": "Stage 1: Polymorphically swallow any of 6 source kinds into canonical SwallowIR ($0)", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"source_kind": {"type": "string", "enum": ["auto", "github_repo", "cli_help", "rest_har", "graphql_schema", "tabular_sqlite_csv", "raw_mcp"]}, "license_spdx": {"type": "string"}, "price_micro_usd": {"type": "integer"}}}}}}, "responses": {"200": {"description": "Canonical SwallowIR with SHA-256 digest"}, "403": {"description": "Blocked by SSRF, path traversal, shell injection, license, or credential-theft gate"}, "422": {"description": "Malformed or junk input rejected unbilled ($0)"}}}}, "/v1/pipeline/compile": {"post": {"summary": "Stage 1+2: Compile any swallowed target into a standalone runnable sub-service directory", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "Compiled bundle manifest, file hashes, Creem SKUs, and gateway route"}, "403": {"description": "Security or path boundary rejection"}, "422": {"description": "Invalid input"}}}}, "/v1/escrow/simulate": {"post": {"summary": "Stage 3: Atomic SQLite WAL reserve, 4D budget lock (allow/ask/deny), ArchiveCache, & instant settle/rollback", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "EscrowReceipt with SHA-256 Proof-of-Delivery receipt"}, "202": {"description": "Approval ticket created (decision=ask)"}, "402": {"description": "Insufficient balance ($0 charged)"}, "403": {"description": "4D budget cap or tool allowlist denial ($0 charged)"}, "409": {"description": "Idempotency key payload conflict"}, "429": {"description": "Sliding rate limit exceeded ($0 charged)"}}}}, "/v1/escrow/settle": {"post": {"summary": "Stage 3: Explicitly settle reserved micro-USD or execute $0 auto-rollback on miss/fake-200/error", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "Settled or rolled-back EscrowReceipt"}, "404": {"description": "Reservation not found"}, "409": {"description": "Invalid reservation state"}}}}, "/v1/escrow/wallets/topup": {"post": {"summary": "Credit tenant spendable micro-USD wallet idempotently", "responses": {"200": {"description": "Wallet balance after top-up"}}}}, "/v1/escrow/wallets/{tenant_id}": {"get": {"summary": "Inspect tenant spendable & reserved micro-USD balances and 4D budget policy", "responses": {"200": {"description": "Wallet status"}}}}, "/v1/escrow/policy": {"post": {"summary": "Configure 4D budget lock (per-call max, daily limit, sliding rate, tool allowlist/denylist)", "responses": {"200": {"description": "Stored 4D BudgetPolicySpec"}}}}, "/v1/escrow/approvals/{approval_id}/decide": {"post": {"summary": "Approve or reject a pending 4D budget ask ticket (reject auto-unfreezes funds)", "responses": {"200": {"description": "Updated approval ticket state"}}}}, "/v1/escrow/audit": {"get": {"summary": "Global SQLite WAL integrity & zero-negative-balance audit", "responses": {"200": {"description": "Audit summary"}}}}, "/webhooks/creem": {"post": {"summary": "Creem HMAC-SHA256 verified webhook top-up/clawback with event_id replay idempotency", "responses": {"200": {"description": "Idempotent CreemWebhookReceipt"}, "401": {"description": "Invalid or missing creem-signature"}, "409": {"description": "Tampered replay conflict"}}}}, "/mcp": {"post": {"summary": "Native JSON-RPC 2.0 MCP endpoint (5 direct tools + 4 DualMcpFacade meta-tools)", "responses": {"200": {"description": "JSON-RPC 2.0 response"}}}}}, "x-creem-skus": [{"sku_id": "sku_f01_swallow_launch_99", "tier": "launch", "name": "Swallow-to-Cash Launch Factory Pack ($99 Prepaid)", "price_usd": 99.0, "price_cents": 9900, "credits_micro_usd": 99000000, "billing_type": "onetime", "currency": "USD", "tax_mode": "exclusive", "tax_category": "saas", "description": "One-time fixed non-contingent prepaid factory bundle granting 99,000,000 micro-USD ($99.00). Zero platform commission, zero seat tax, $0 charged on empty or failed calls.", "highlight": false, "checkout_url": "https://creem.io/payment/prod_pending_f01_swallow_launch_99"}, {"sku_id": "sku_f01_swallow_studio_299", "tier": "studio", "name": "Swallow-to-Cash Studio Factory Pack ($299 Prepaid)", "price_usd": 299.0, "price_cents": 29900, "credits_micro_usd": 299000000, "billing_type": "onetime", "currency": "USD", "tax_mode": "exclusive", "tax_category": "saas", "description": "One-time fixed non-contingent prepaid studio bundle granting 299,000,000 micro-USD ($299.00) with cross-tenant verified-hit archive cache and 0% commission treg hub publishing.", "highlight": true, "checkout_url": "https://creem.io/payment/prod_pending_f01_swallow_studio_299"}, {"sku_id": "sku_f01_swallow_foundry_999", "tier": "foundry", "name": "Swallow-to-Cash Foundry Fleet Pack ($999 Prepaid)", "price_usd": 999.0, "price_cents": 99900, "credits_micro_usd": 999000000, "billing_type": "onetime", "currency": "USD", "tax_mode": "exclusive", "tax_category": "saas", "description": "One-time fixed non-contingent high-volume prepaid foundry bundle granting 999,000,000 micro-USD ($999.00) with 4D budget locks, SQLite WAL escrow, and SHA-256 Proof-of-Delivery receipts.", "highlight": false, "checkout_url": "https://creem.io/payment/prod_pending_f01_swallow_foundry_999"}]}