{
  "openapi": "3.1.0",
  "info": {
    "title": "Context Crush — Deterministic LLM Context Compactor",
    "version": "1.0.0",
    "summary": "Cut WebVTT/SRT transcripts, .eml reply chains, Slack threads, and Jira ADF JSON by 65-90% tokens in <15ms with zero LLM summarization loss.",
    "description": "Zero-hallucination deterministic compaction for WebVTT/SRT meeting transcripts, RFC 5322 .eml & O(N^2) quoted email threads, Slack JSON exports, and Jira v3 Atlassian Document Format (ADF) issues.\n\nReplaces fragile MIME/quoted-printable decoders, rolling live-caption overlap logic, O(N^2) email quote peelers, and recursive Jira ADF AST renderers—saving $0.02-$0.15 in downstream frontier-LLM input tokens for a $0.001-$0.005 edge call.",
    "contact": {
      "name": "API Keg",
      "url": "https://apikeg.com"
    }
  },
  "servers": [
    {
      "url": "https://context-crush.apikeg.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Keg Key (ak_live_...)",
        "description": "Optional per-email monthly subscription API key ($5/$20/$50 tiers at https://apikeg.com/account). Omit this header to pay per request inline via HTTP 402 (x402 USDC)."
      }
    }
  },
  "security": [
    {},
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/compact-transcript": {
      "post": {
        "operationId": "compact_transcript",
        "summary": "Compact Meeting Transcript (WebVTT / SRT / Text)",
        "description": "Parses WebVTT (<v Speaker>, NOTE/STYLE blocks, cue UUIDs), SubRip (.srt), or Zoom/Teams/Otter text transcripts; deduplicates rolling live captions, coalesces speaker turns into Markdown, and computes speaker talk-turn stats. Why call instead of DIY: Eliminates 75-90% of caption cue UUID/timestamp/overlap bloat in <10ms with 100% lossless dialogue retention—costing a fraction of the LLM input tokens saved. Pricing: $0.001 base (up to $0.005 max ($0.001 base + $0.0005 per 50KB of input, capped at $0.005 for payloads up to 2MB), x402 variable settlement). Pass ?dry_run=true on REST to validate schema free.",
        "tags": [
          "context-engineering",
          "developer-tools",
          "productivity",
          "business-ops"
        ],
        "externalDocs": {
          "description": "Compact Meeting Transcript (WebVTT / SRT / Text) Specification & Examples",
          "url": "https://context-crush.apikeg.com/tools/compact-transcript"
        },
        "x-x402": {
          "version": 2,
          "scheme": "upto",
          "priceUsd": "0.001",
          "maxPriceUsd": "0.005",
          "amountAtomicUnits": "5000",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "extensions": {
            "bazaar": {
              "discoverable": true,
              "category": [
                "context-engineering",
                "developer-tools",
                "productivity",
                "business-ops"
              ],
              "info": {
                "input": {
                  "type": "http",
                  "method": "POST",
                  "bodyType": "json",
                  "example": {
                    "format": "auto",
                    "timestampFormat": "auto",
                    "timestampIntervalSec": 0,
                    "removeFillers": true,
                    "transcript": "WEBVTT\n\nNOTE exported by Meet\n\ncue-1\n00:01:12.000 --> 00:01:14.200 align:start\n<v Alice Chen>Um, welcome everyone to</v>\n\ncue-2\n00:01:14.200 --> 00:01:17.500 align:start\n<v Alice Chen>welcome everyone to the Q4 launch review.</v>"
                  }
                },
                "output": {
                  "type": "json",
                  "summary": "Single clean '[01:12] **Alice Chen:** Welcome everyone to the Q4 launch review.' turn + speaker stats + token reduction metrics."
                }
              },
              "schema": {
                "inputSchema": {
                  "type": "object",
                  "properties": {
                    "transcript": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2000000,
                      "description": "Raw meeting transcript in WebVTT (.vtt), SubRip (.srt), or plain-text ([HH:MM:SS] Speaker:) format."
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "auto",
                        "vtt",
                        "srt",
                        "text"
                      ],
                      "default": "auto",
                      "description": "Input transcript format; defaults to automatic detection."
                    },
                    "timestampFormat": {
                      "type": "string",
                      "enum": [
                        "auto",
                        "mm:ss",
                        "hh:mm:ss",
                        "none"
                      ],
                      "default": "auto",
                      "description": "Rendered Markdown timestamp style ('auto' uses [MM:SS] under 1h and [HH:MM:SS] at >=1h)."
                    },
                    "timestampIntervalSec": {
                      "type": "integer",
                      "default": 0,
                      "minimum": 0,
                      "maximum": 3600,
                      "description": "Minimum seconds between emitted speaker-turn timestamps (0 = emit at every speaker switch)."
                    },
                    "removeFillers": {
                      "type": "boolean",
                      "default": false,
                      "description": "Strip vocal disfluencies ('um', 'uh', 'er', 'ah', 'hmm', parenthetical 'you know') while preserving dialogue."
                    }
                  },
                  "required": [
                    "transcript"
                  ],
                  "additionalProperties": false
                },
                "outputSchema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "_meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Deterministic structured tool result payload."
                    },
                    "_meta": {
                      "type": "object",
                      "required": [
                        "requestId",
                        "durationMs",
                        "chargedUsd",
                        "dryRun"
                      ],
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "dry_run",
            "in": "query",
            "required": false,
            "description": "Validate request schema for free ($0.00) without executing or settling payment.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transcript": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000000,
                    "description": "Raw meeting transcript in WebVTT (.vtt), SubRip (.srt), or plain-text ([HH:MM:SS] Speaker:) format."
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "vtt",
                      "srt",
                      "text"
                    ],
                    "default": "auto",
                    "description": "Input transcript format; defaults to automatic detection."
                  },
                  "timestampFormat": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "mm:ss",
                      "hh:mm:ss",
                      "none"
                    ],
                    "default": "auto",
                    "description": "Rendered Markdown timestamp style ('auto' uses [MM:SS] under 1h and [HH:MM:SS] at >=1h)."
                  },
                  "timestampIntervalSec": {
                    "type": "integer",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 3600,
                    "description": "Minimum seconds between emitted speaker-turn timestamps (0 = emit at every speaker switch)."
                  },
                  "removeFillers": {
                    "type": "boolean",
                    "default": false,
                    "description": "Strip vocal disfluencies ('um', 'uh', 'er', 'ah', 'hmm', parenthetical 'you know') while preserving dialogue."
                  }
                },
                "required": [
                  "transcript"
                ],
                "additionalProperties": false
              },
              "example": {
                "format": "auto",
                "timestampFormat": "auto",
                "timestampIntervalSec": 0,
                "removeFillers": true,
                "transcript": "WEBVTT\n\nNOTE exported by Meet\n\ncue-1\n00:01:12.000 --> 00:01:14.200 align:start\n<v Alice Chen>Um, welcome everyone to</v>\n\ncue-2\n00:01:14.200 --> 00:01:17.500 align:start\n<v Alice Chen>welcome everyone to the Q4 launch review.</v>"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful execution result.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "Base64-encoded x402 v2 payment settlement receipt (when paid).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Schema validation error (unbilled, $0.00)."
          },
          "402": {
            "description": "Payment Required. Decode the Base64 PAYMENT-REQUIRED header and retry with PAYMENT-SIGNATURE.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 PaymentRequired JSON object.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compact-email-thread": {
      "post": {
        "operationId": "compact_email_thread",
        "summary": "De-duplicate Email Thread & RFC 5322 .eml",
        "description": "Decodes raw RFC 5322 .eml MIME messages (multipart/alternative, quoted-printable, base64) or pasted reply chains, strips O(N^2) repeated quoted history, mobile signatures, and legal disclaimers, and outputs chronological Markdown. Why call instead of DIY: Avoids writing RFC 2047/quoted-printable/multipart MIME parsers and multi-client Outlook/Gmail quote splitters; collapses 10-reply O(N^2) threads by >80%. Pricing: $0.001 base (up to $0.005 max ($0.001 base + $0.0005 per 50KB of input, capped at $0.005 for payloads up to 2MB), x402 variable settlement). Pass ?dry_run=true on REST to validate schema free.",
        "tags": [
          "context-engineering",
          "developer-tools",
          "productivity",
          "business-ops"
        ],
        "externalDocs": {
          "description": "De-duplicate Email Thread & RFC 5322 .eml Specification & Examples",
          "url": "https://context-crush.apikeg.com/tools/compact-email-thread"
        },
        "x-x402": {
          "version": 2,
          "scheme": "upto",
          "priceUsd": "0.001",
          "maxPriceUsd": "0.005",
          "amountAtomicUnits": "5000",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "extensions": {
            "bazaar": {
              "discoverable": true,
              "category": [
                "context-engineering",
                "developer-tools",
                "productivity",
                "business-ops"
              ],
              "info": {
                "input": {
                  "type": "http",
                  "method": "POST",
                  "bodyType": "json",
                  "example": {
                    "stripSignatures": true,
                    "stripDisclaimers": true,
                    "content": "Approved — let's lock in the annual tier.\n\nSent from my iPhone\n\nOn Tue, Nov 12, 2026 at 2:15 PM Alice Chen <alice@acme.com> wrote:\n> Can you confirm final pricing?\n>\n> CONFIDENTIALITY NOTICE: This email and any attachments are confidential."
                  }
                },
                "output": {
                  "type": "json",
                  "summary": "2 chronological deduplicated messages + participant roster + stripped signature/disclaimer counts."
                }
              },
              "schema": {
                "inputSchema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2000000,
                      "description": "Raw RFC 5322 .eml MIME message (multipart/alternative, quoted-printable, base64) or pasted multi-reply email thread."
                    },
                    "stripSignatures": {
                      "type": "boolean",
                      "default": true,
                      "description": "Strip mobile/client footers ('Sent from my iPhone', 'Get Outlook for iOS') and RFC 3676 '-- ' tails."
                    },
                    "stripDisclaimers": {
                      "type": "boolean",
                      "default": true,
                      "description": "Strip standard corporate confidentiality and legal disclaimer footer blocks."
                    }
                  },
                  "required": [
                    "content"
                  ],
                  "additionalProperties": false
                },
                "outputSchema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "_meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Deterministic structured tool result payload."
                    },
                    "_meta": {
                      "type": "object",
                      "required": [
                        "requestId",
                        "durationMs",
                        "chargedUsd",
                        "dryRun"
                      ],
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "dry_run",
            "in": "query",
            "required": false,
            "description": "Validate request schema for free ($0.00) without executing or settling payment.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000000,
                    "description": "Raw RFC 5322 .eml MIME message (multipart/alternative, quoted-printable, base64) or pasted multi-reply email thread."
                  },
                  "stripSignatures": {
                    "type": "boolean",
                    "default": true,
                    "description": "Strip mobile/client footers ('Sent from my iPhone', 'Get Outlook for iOS') and RFC 3676 '-- ' tails."
                  },
                  "stripDisclaimers": {
                    "type": "boolean",
                    "default": true,
                    "description": "Strip standard corporate confidentiality and legal disclaimer footer blocks."
                  }
                },
                "required": [
                  "content"
                ],
                "additionalProperties": false
              },
              "example": {
                "stripSignatures": true,
                "stripDisclaimers": true,
                "content": "Approved — let's lock in the annual tier.\n\nSent from my iPhone\n\nOn Tue, Nov 12, 2026 at 2:15 PM Alice Chen <alice@acme.com> wrote:\n> Can you confirm final pricing?\n>\n> CONFIDENTIALITY NOTICE: This email and any attachments are confidential."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful execution result.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "Base64-encoded x402 v2 payment settlement receipt (when paid).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Schema validation error (unbilled, $0.00)."
          },
          "402": {
            "description": "Payment Required. Decode the Base64 PAYMENT-REQUIRED header and retry with PAYMENT-SIGNATURE.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 PaymentRequired JSON object.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compact-workspace-export": {
      "post": {
        "operationId": "compact_workspace_export",
        "summary": "Compact Slack Export or Jira v3 ADF JSON",
        "description": "Compacts Slack channel/thread JSON (resolving <@U...> mentions, dropping join/leave noise, grouping thread_ts replies, formatting reactions, stripping Block Kit) or Jira v3 Issue/ADF JSON (rendering headings, tables, code blocks, lists, mentions, comments while dropping avatarUrls and null customfield_* keys). Why call instead of DIY: Turns bloated 100KB+ Jira REST v3 ADF issues and Slack API payloads into crisp 3KB Markdown without losing comments, tables, code blocks, or reactions. Pricing: $0.001 base (up to $0.005 max ($0.001 base + $0.0005 per 50KB of input, capped at $0.005 for payloads up to 2MB), x402 variable settlement). Pass ?dry_run=true on REST to validate schema free.",
        "tags": [
          "context-engineering",
          "developer-tools",
          "productivity",
          "business-ops"
        ],
        "externalDocs": {
          "description": "Compact Slack Export or Jira v3 ADF JSON Specification & Examples",
          "url": "https://context-crush.apikeg.com/tools/compact-workspace-export"
        },
        "x-x402": {
          "version": 2,
          "scheme": "upto",
          "priceUsd": "0.001",
          "maxPriceUsd": "0.005",
          "amountAtomicUnits": "5000",
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "extensions": {
            "bazaar": {
              "discoverable": true,
              "category": [
                "context-engineering",
                "developer-tools",
                "productivity",
                "business-ops"
              ],
              "info": {
                "input": {
                  "type": "http",
                  "method": "POST",
                  "bodyType": "json",
                  "example": {
                    "format": "slack_json",
                    "users": {
                      "U01ALICE": "alice",
                      "U02BOB": "bob"
                    },
                    "includeReactions": true,
                    "content": "[{\"type\":\"message\",\"subtype\":\"channel_join\",\"user\":\"U01ALICE\",\"ts\":\"1731491900.000100\"},{\"type\":\"message\",\"user\":\"U01ALICE\",\"text\":\"Canary deployed — cc <@U02BOB>\",\"ts\":\"1731492000.000200\",\"reactions\":[{\"name\":\"rocket\",\"count\":3}]}]"
                  }
                },
                "output": {
                  "type": "json",
                  "summary": "Clean Markdown timeline with @bob resolved, channel_join noise dropped, and [+3 🚀] badge."
                }
              },
              "schema": {
                "inputSchema": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 2000000,
                      "description": "Raw Slack channel/thread JSON export or Jira Issue / Atlassian Document Format (ADF v3) JSON payload."
                    },
                    "format": {
                      "type": "string",
                      "enum": [
                        "auto",
                        "slack_json",
                        "jira_json"
                      ],
                      "default": "auto",
                      "description": "Workspace JSON format; defaults to automatic Slack vs. Jira ADF detection."
                    },
                    "users": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "description": "Optional Slack user ID to display handle map (e.g. { \"U01ABC\": \"alice\" }) used to resolve <@U...> mentions."
                    },
                    "includeReactions": {
                      "type": "boolean",
                      "default": true,
                      "description": "Render concise Slack reaction badges such as '[+3 👍]'."
                    }
                  },
                  "required": [
                    "content"
                  ],
                  "additionalProperties": false
                },
                "outputSchema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "_meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Deterministic structured tool result payload."
                    },
                    "_meta": {
                      "type": "object",
                      "required": [
                        "requestId",
                        "durationMs",
                        "chargedUsd",
                        "dryRun"
                      ],
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "dry_run",
            "in": "query",
            "required": false,
            "description": "Validate request schema for free ($0.00) without executing or settling payment.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2000000,
                    "description": "Raw Slack channel/thread JSON export or Jira Issue / Atlassian Document Format (ADF v3) JSON payload."
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "slack_json",
                      "jira_json"
                    ],
                    "default": "auto",
                    "description": "Workspace JSON format; defaults to automatic Slack vs. Jira ADF detection."
                  },
                  "users": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "description": "Optional Slack user ID to display handle map (e.g. { \"U01ABC\": \"alice\" }) used to resolve <@U...> mentions."
                  },
                  "includeReactions": {
                    "type": "boolean",
                    "default": true,
                    "description": "Render concise Slack reaction badges such as '[+3 👍]'."
                  }
                },
                "required": [
                  "content"
                ],
                "additionalProperties": false
              },
              "example": {
                "format": "slack_json",
                "users": {
                  "U01ALICE": "alice",
                  "U02BOB": "bob"
                },
                "includeReactions": true,
                "content": "[{\"type\":\"message\",\"subtype\":\"channel_join\",\"user\":\"U01ALICE\",\"ts\":\"1731491900.000100\"},{\"type\":\"message\",\"user\":\"U01ALICE\",\"text\":\"Canary deployed — cc <@U02BOB>\",\"ts\":\"1731492000.000200\",\"reactions\":[{\"name\":\"rocket\",\"count\":3}]}]"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful execution result.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "Base64-encoded x402 v2 payment settlement receipt (when paid).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "durationMs": {
                          "type": "number"
                        },
                        "chargedUsd": {
                          "type": "string"
                        },
                        "dryRun": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Schema validation error (unbilled, $0.00)."
          },
          "402": {
            "description": "Payment Required. Decode the Base64 PAYMENT-REQUIRED header and retry with PAYMENT-SIGNATURE.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 PaymentRequired JSON object.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}