{
  "openapi": "3.1.0",
  "info": {
    "title": "OmniVenture Agent Context & LLM Optimization Suite",
    "version": "1.0.0",
    "description": "Sub-10ms edge intelligence tools tailored for Claude Desktop, Cursor, LangChain, and autonomous LLM agent loops.\n\n### Included Endpoints:\n1. **Agent Web-to-Markdown Context Compressor** (`POST /v1/m2m/extract/markdown`): Converts web pages and HTML into dense Markdown, cutting LLM context tokens by up to 90%.\n2. **Universal LLM JSON-Repair & Schema Sanitizer** (`POST /v1/m2m/repair/json`): Instantly fixes malformed JSON (code fences, single quotes, trailing commas, Python literals).\n3. **Text Privacy & PII Redactor** (`POST /v1/m2m/sanitize/pii`): Masks emails, phone numbers, payment cards, and SSNs before leaving the trust boundary.\n4. **Cognitive Context Distiller** (`POST /v1/m2m/distill`): Distills dense entities, metrics, and top keywords at zero marginal token cost.",
    "contact": {
      "name": "OmniVenture Autonomous Fleet",
      "email": "dalnaspidal@gmail.com"
    },
    "x-category": "AI & Machine Learning"
  },
  "paths": {
    "/v1/m2m/distill": {
      "post": {
        "tags": [
          "M2M Agnostic Micro-Services"
        ],
        "summary": "Cognitive Context Distiller & Entity Extractor",
        "description": "Distills dense structured entities, numerical metrics, action items, and salient keywords from raw text documents at zero cloud LLM token cost.\n\n### Use when:\n- Compressing lengthy articles, transcripts, reports, or documentation into compact JSON for downstream agent decision steps.\n- Extracting financial figures, percentages, dates, and named entities without incurring expensive cloud LLM prompt fees.\n- Summarizing web search results or documentation before storage in vector databases.\n\n### Do not use when:\n- Input is raw HTML markup (call `POST /v1/m2m/extract/markdown` first to strip boilerplate).\n- Input is already clean structured JSON (call `POST /v1/m2m/transform`).\n\n### Token & Latency Advantage:\n- Compresses 5,000+ words into ~150 structured tokens (>95% context compression).\n- Sub-50ms deterministic local edge execution.\n\n### Pricing:\n- \u00a30.04 GBP / call.",
        "operationId": "distill_endpoint_v1_m2m_distill_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-payment-token",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Payment-Token"
            }
          },
          {
            "name": "x-rapidapi-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-Key"
            }
          },
          {
            "name": "x-rapidapi-proxy-secret",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-Proxy-Secret"
            }
          },
          {
            "name": "x-rapidapi-user",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-User"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/M2MPayloadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m2m/extract/markdown": {
      "post": {
        "tags": [
          "M2M Agnostic Micro-Services"
        ],
        "summary": "Web-to-Markdown Context Compressor & Scraper",
        "description": "Fetches public web URLs or parses raw HTML into clean, token-efficient GitHub Flavored Markdown, stripping boilerplate, scripts, ads, and navigation chrome.\n\n### Use when:\n- Scraper bots or autonomous research agents need to read a web page without burning context on HTML boilerplate.\n- Converting raw web responses into clean markdown for LLM comprehension and RAG embeddings.\n- Extracting document titles, clean headings, lists, and main article text.\n\n### Do not use when:\n- The input is already clean Markdown or plain text.\n\n### Token & Latency Advantage:\n- Reduces raw web page token size by 80% to 95% (e.g. converts 60KB HTML into ~800 clean tokens). Sub-15ms parsing.\n\n### Pricing:\n- \u00a30.02 GBP / call.",
        "operationId": "extract_markdown_endpoint_v1_m2m_extract_markdown_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-payment-token",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Payment-Token"
            }
          },
          {
            "name": "x-rapidapi-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-Key"
            }
          },
          {
            "name": "x-rapidapi-proxy-secret",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-Proxy-Secret"
            }
          },
          {
            "name": "x-rapidapi-user",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-User"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/M2MPayloadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m2m/repair/json": {
      "post": {
        "tags": [
          "M2M Agnostic Micro-Services"
        ],
        "summary": "Universal LLM JSON Repair & Syntax Sanitizer",
        "description": "Repairs malformed or broken JSON emitted by LLMs (stripping markdown code fences, fixing single quotes, removing trailing commas, converting Python literals like True/False/None to JSON booleans/null).\n\n### Use when:\n- An upstream LLM tool-calling output or completion fails to parse with `json.decoder.JSONDecodeError`.\n- LLM output contains Markdown code blocks (```json ... ```), single-quoted keys, unquoted identifiers, or trailing commas.\n- You need guaranteed RFC 8259 valid JSON output without paying tokens to re-prompt the LLM.\n\n### Do not use when:\n- The input is purely conversational prose with no intended JSON structure.\n\n### Token & Latency Advantage:\n- Saves 100% of the cost and 2-5 seconds of latency required to re-prompt an LLM for valid JSON. Sub-5ms deterministic edge repair.\n\n### Pricing:\n- \u00a30.01 GBP / call.",
        "operationId": "repair_json_endpoint_v1_m2m_repair_json_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-payment-token",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Payment-Token"
            }
          },
          {
            "name": "x-rapidapi-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-Key"
            }
          },
          {
            "name": "x-rapidapi-proxy-secret",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-Proxy-Secret"
            }
          },
          {
            "name": "x-rapidapi-user",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-User"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/M2MPayloadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/m2m/sanitize/pii": {
      "post": {
        "tags": [
          "M2M Agnostic Micro-Services"
        ],
        "summary": "Text Privacy, Toxicity & PII Redactor",
        "description": "Detects and masks Personally Identifiable Information (PII) including emails, phone numbers, payment credit cards, and SSNs from prompts before leaving the enterprise trust boundary.\n\n### Use when:\n- Autonomous agent loops sanitize user prompts, customer tickets, or raw logs before sending data to external public LLMs.\n- Enforcing GDPR, HIPAA, and DLP compliance boundaries across multi-agent workflows.\n- Redacting sensitive identifiers from audit logs and long-term memory stores.\n\n### Do not use when:\n- You want to extract or validate email addresses (call `POST /v1/m2m/verify/email`).\n\n### Token & Latency Advantage:\n- Sub-5ms local edge redaction, ensuring zero compliance leakage to external cloud model providers.\n\n### Pricing:\n- \u00a30.02 GBP / call.",
        "operationId": "sanitize_pii_endpoint_v1_m2m_sanitize_pii_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          },
          {
            "name": "x-payment-token",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Payment-Token"
            }
          },
          {
            "name": "x-rapidapi-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-Key"
            }
          },
          {
            "name": "x-rapidapi-proxy-secret",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-Proxy-Secret"
            }
          },
          {
            "name": "x-rapidapi-user",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Rapidapi-User"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/M2MPayloadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DirectiveRequest": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "DirectiveRequest"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "M2MPayloadRequest": {
        "properties": {
          "client_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id",
            "description": "Machine caller identifier or agent loop instance ID for telemetry.",
            "default": "m2m_client"
          },
          "payload": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payload",
            "description": "Arbitrary JSON payload or dictionary to normalize, transform, or cryptographically hash."
          },
          "raw_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Raw Text",
            "description": "Raw unstructured text string for entity distillation, keyword extraction, or compression."
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "Target web URL (e.g. 'https://example.com/doc') to scrape and compress into clean Markdown."
          },
          "raw_html": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Raw Html",
            "description": "Raw HTML markup string to convert into clean, token-efficient Markdown."
          },
          "html": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Html",
            "description": "Alias for raw_html."
          },
          "include_links": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Include Links",
            "description": "When converting HTML/URL to Markdown, whether to retain hyperlinks in [text](url) format.",
            "default": false
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens",
            "description": "Maximum token budget for Markdown extraction or text output.",
            "default": 4000
          },
          "series_a": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Series A",
            "description": "Primary numerical value or array of floats for discrepancy/anomaly comparison."
          },
          "series_b": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Series B",
            "description": "Secondary baseline numerical value or array of floats for discrepancy comparison."
          },
          "threshold_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Threshold Pct",
            "description": "Percentage divergence threshold (e.g. 5.0%) above which a delta is flagged as an anomaly.",
            "default": 5.0
          },
          "expected_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Hash",
            "description": "Optional expected 64-char hexadecimal SHA-256 digest to verify against payload digest."
          },
          "strip_nulls": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Strip Nulls",
            "description": "When transforming JSON, whether to recursively prune keys with null/empty values.",
            "default": true
          },
          "max_keywords": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Keywords",
            "description": "Maximum number of salient keywords to extract in context distillation.",
            "default": 5
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email",
            "description": "Target email address to validate for RFC compliance, DNS MX records, and burner domain status."
          },
          "check_mx": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Check Mx",
            "description": "Whether to perform live DNS MX lookup verification for deliverability scoring.",
            "default": true
          },
          "raw_json": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Raw Json",
            "description": "Malformed or unparsed JSON string emitted by an LLM to repair into RFC 8259 valid JSON."
          },
          "broken_json": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Broken Json",
            "description": "Alias for raw_json: malformed JSON string (with code fences, single quotes, trailing commas)."
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text",
            "description": "Input text string for PII redaction and sensitive data masking."
          },
          "host": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Host",
            "description": "Fully qualified domain name or hostname (e.g. 'api.github.com') to audit SSL/TLS certificates."
          },
          "port": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Port",
            "description": "TLS port number (defaults to 443).",
            "default": 443
          },
          "timeout_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timeout Seconds",
            "description": "Network socket connection timeout in seconds.",
            "default": 3.0
          },
          "user_agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Agent",
            "description": "Raw User-Agent header string to classify into AI bot, crawler, scraper, or browser."
          },
          "mask_character": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mask Character",
            "description": "Optional character used to mask PII tokens (defaults to placeholder tags like [REDACTED_EMAIL])."
          },
          "base_currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Currency",
            "description": "Base currency symbol for FX oracle rates (e.g. 'GBP', 'USD', 'BTC')."
          },
          "data": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data",
            "description": "Data payload or invoice string to encode into SVG QR matrix."
          },
          "ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip",
            "description": "IPv4 or IPv6 address string to evaluate for routing taxonomy, reverse PTR, and private CIDR."
          }
        },
        "type": "object",
        "title": "M2MPayloadRequest"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  },
  "servers": [
    {
      "url": "https://automatically-welcome-dad-extensive.trycloudflare.com",
      "description": "Production Edge Execution Gateway (Sub-15ms Bare-Metal Xeon)"
    },
    {
      "url": "https://omniventure-api.web.app",
      "description": "Permanent Canonical Gateway Authority & Developer Hub"
    }
  ],
  "externalDocs": {
    "description": "OmniVenture Developer Hub & Agent Discovery",
    "url": "https://omniventure-api.web.app"
  }
}