{
  "openapi": "3.1.0",
  "info": {
    "title": "Dexmond Commercial API Platform — Full Product Suite",
    "version": "3.3.0",
    "description": "Unified European zero-trust commercial API platform exposing the full Dexmond product portfolio: Dexmond Shield (DLP, Prompt Firewall, Domain Audit, Artifact Forensics), CypherNight MAX-SEC (AES-256-GCM, Ed25519, Archive & Stego Forensics), DEXMOND MIE V1.0 (Static & Deep Malware Inspection), Android ProLab (Static APK Auditor), Agent SQL-Alpha, Project Elysium (LEO Orbital Decay MKS Solver), Agent Law (EU GDPR / IE CRA / EU AI Act), Sentinel 2.0 (Firewall Policy Compiler), IntelliDex & PolyClaw (STRICTLY ANALYSIS-ONLY — zero execution, not financial advice), Orbital & Global Risk Intelligence, Zero-Leak Sovereign AI, and Tier-B Async Worker Operations (Roisin, Orchestrator, R3D Authorized Assessment with DNS TXT verification, Sandbox, Simulation Lab).",
    "contact": {
      "name": "Dexmond Technologies Ltd (CRO 821095)",
      "url": "https://dexmond.com/api-docs.html",
      "email": "support@dexmond.com"
    }
  },
  "servers": [
    {
      "url": "https://dexmond.com/api/v1",
      "description": "Dexmond Production Commercial Gateway"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Customer API key (dx_live_...) created in https://dexmond.com/dashboard.html#developer"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Alternative Authorization: Bearer dx_live_... header"
      }
    },
    "schemas": {
      "CommerceRequest": {
        "type": "object",
        "required": ["service", "operation"],
        "properties": {
          "service": {
            "type": "string",
            "enum": [
              "shield", "intel", "ai",
              "cyphernight", "mie", "prolab", "sqlalpha", "elysium", "law", "sentinel",
              "intellidex", "polyclaw",
              "roisin", "orchestrator", "r3d", "sandbox", "sim",
              "gateway", "catalog", "telemetry", "security", "compute", "agents"
            ]
          },
          "operation": {
            "type": "string",
            "examples": [
              "dlp_scan", "dlp_batch", "prompt_guard", "domain_audit", "artifact_inspect",
              "encrypt", "decrypt", "sign", "verify", "archive_inspect", "stego_detect",
              "scan_static", "hash_reputation", "hash_batch", "deep_scan", "apk_inspect",
              "generate", "audit", "decay_forecast", "gdpr_screen", "policy_compile",
              "analyze", "orbital", "global_risk",
              "shielded_complete", "extract_structured", "security_review",
              "verify_domain", "authorized_assessment", "enrich_company", "triage_inbox",
              "run_workflow", "exec", "run", "echo", "specs"
            ]
          },
          "units": { "type": "integer", "minimum": 1, "default": 1 },
          "input": { "type": "object", "description": "Operation-specific input parameters (or pass top-level fields directly)" }
        }
      },
      "CommerceResponse": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean" },
          "status": { "type": "integer" },
          "request_id": { "type": "string", "format": "uuid" },
          "service": { "type": "string" },
          "billing": {
            "type": "object",
            "properties": {
              "pricing_model": { "type": "string" },
              "units_consumed": { "type": "integer" },
              "credits_charged": { "type": "integer" },
              "included_allowance_used": { "type": "integer" },
              "available_credits": { "type": "integer" }
            }
          },
          "data": { "type": "object" }
        }
      }
    }
  },
  "security": [
    { "ApiKeyHeader": [] },
    { "BearerAuth": [] }
  ],
  "paths": {
    "/commerce.php": {
      "post": {
        "summary": "Execute any metered Dexmond commercial API operation (Tier A Sync & Tier B Async)",
        "operationId": "executeCommercialOperation",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": { "type": "string", "maxLength": 128 },
            "description": "Unique client request ID preventing duplicate charges on network retries."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CommerceRequest" },
              "examples": {
                "shieldDlp": {
                  "summary": "Shield DLP & Secret Scanner (15 cr)",
                  "value": { "service": "shield", "operation": "dlp_scan", "text": "Contact alice@corp.io with key AKIAIOSFODNN7EXAMPLE" }
                },
                "cyphernightEncrypt": {
                  "summary": "CypherNight AES-256-GCM Encrypt (20 cr)",
                  "value": { "service": "cyphernight", "operation": "encrypt", "plaintext": "Confidential payload", "passphrase": "Strong-Passphrase-Example!" }
                },
                "mieStatic": {
                  "summary": "MIE V1.0 Static Malware Inspection (45 cr)",
                  "value": { "service": "mie", "operation": "scan_static", "filename": "script.ps1", "text": "powershell -enc SQBFAFgA" }
                },
                "elysiumDecay": {
                  "summary": "Project Elysium LEO Orbital Decay Forecast (30 cr)",
                  "value": { "service": "elysium", "operation": "decay_forecast", "altitude_km": 410, "mass_kg": 260, "area_m2": 2.2 }
                },
                "intellidexAnalyze": {
                  "summary": "IntelliDex Quantitative Market Analytics — ANALYSIS ONLY (40 cr)",
                  "value": { "service": "intellidex", "operation": "analyze", "symbol": "IDX-DEMO", "prices": [100, 102, 101, 105, 108, 110, 112] }
                },
                "polyclawAnalyze": {
                  "summary": "PolyClaw Probability & Calibration Analytics — ANALYSIS ONLY (40 cr)",
                  "value": { "service": "polyclaw", "operation": "analyze", "outcomes": [{ "name": "Yes", "price": 0.62, "model_probability": 0.68 }, { "name": "No", "price": 0.41, "model_probability": 0.32 }] }
                },
                "r3dVerifyDomain": {
                  "summary": "R3D DNS TXT Ownership Challenge (0 cr)",
                  "value": { "service": "r3d", "operation": "verify_domain", "action": "challenge", "domain": "example.com" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Operation executed and billed atomically", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommerceResponse" } } } },
          "401": { "description": "Missing, invalid, or revoked API key" },
          "402": { "description": "Insufficient prepaid credits" },
          "403": { "description": "Account inactive or plan tier too low" },
          "429": { "description": "Rate limit exceeded" }
        }
      }
    },
    "/jobs.php": {
      "get": {
        "summary": "List Tier-B async jobs & registered outbound webhooks (or inspect ?id=<uuid>)",
        "operationId": "listOrInspectJobs",
        "responses": { "200": { "description": "Customer-scoped jobs & webhooks" } }
      },
      "post": {
        "summary": "Register or delete a signed HTTPS outbound webhook",
        "operationId": "manageWebhooks",
        "responses": { "200": { "description": "Webhook created (signing_secret shown once) or deleted" } }
      }
    },
    "/agent-gateway.php": {
      "get": {
        "summary": "Retrieve Dexmond M2M engineering specifications (accepts dx_live_... commercial keys)",
        "operationId": "getAgentGatewaySpecs",
        "responses": { "200": { "description": "Structured product specs" }, "402": { "description": "Payment Required" } }
      }
    }
  }
}
