{
  "x402Version": 2,
  "id": 32075,
  "slug": "32075",
  "resource": "https://www.mahastrategies.com/api/v1/compress",
  "description": "Compress long documents and RAG inputs into token-budgeted, deduplicated context packs with source-linked provenance. Returns original and compiled token counts, so the saving is verifiable. Net-positive above N = fee / (r x p) tokens: r your reduction, p your input price. Extractive and budget-bound, so check includedPassages before relying on it. Ranks Latin, Cyrillic, Greek, Arabic and CJK; CJK coarser (bigrams). Not for tabular or heavily-structured payloads.",
  "type": "http",
  "serviceName": "Maha Context Compiler",
  "iconUrl": "https://res.cloudinary.com/bdb-prod/image/upload/c_fill,ar_1:1,w_256,h_256,f_auto,q_auto/v1786099228/bazaar-icons/1a820036513dff1d.png",
  "resourceType": "AI Inference",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xec84c1cd6602bbe387bc8e6f0d3c062f2762de28",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "1000",
      "amountUsd": 0.001,
      "maxTimeoutSeconds": 60
    }
  ],
  "outputSchema": {
    "properties": {
      "example": {
        "additionalProperties": false,
        "properties": {
          "clientRequestId": {
            "maxLength": 120,
            "minLength": 8,
            "type": "string"
          },
          "compiledContextStored": {
            "const": false,
            "type": "boolean"
          },
          "context": {
            "type": "string"
          },
          "includedPassages": {
            "type": "array"
          },
          "inputHash": {
            "type": "string"
          },
          "metrics": {
            "type": "object"
          },
          "outputHash": {
            "type": "string"
          },
          "packId": {
            "type": "string"
          },
          "retentionBoundaries": {
            "type": "object"
          },
          "sourceTextStored": {
            "const": false,
            "type": "boolean"
          },
          "sources": {
            "maxItems": 8,
            "minItems": 1,
            "type": "array"
          },
          "task": {
            "type": "string"
          },
          "tokenBudget": {
            "maximum": 16000,
            "minimum": 64,
            "type": "integer"
          },
          "version": {
            "const": "0.1.0",
            "type": "string"
          },
          "warningCodes": {
            "type": "array"
          },
          "warnings": {
            "type": "array"
          }
        },
        "required": [
          "version",
          "packId",
          "clientRequestId",
          "task",
          "tokenBudget",
          "context",
          "metrics",
          "includedPassages",
          "sources",
          "warnings",
          "warningCodes",
          "retentionBoundaries",
          "inputHash",
          "outputHash",
          "sourceTextStored",
          "compiledContextStored"
        ],
        "type": "object"
      },
      "type": {
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "extensions": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "budgetMode": "guaranteed",
            "clientRequestId": "req_rag_release_001",
            "documents": [
              {
                "id": "release-notes",
                "text": "Release may proceed after the security owner attaches credential-rotation evidence. The production canary passed in every region.\n\nRoutine notes cover staffing, dashboards, meeting cadence, maintenance calendars, regional handoffs, historical capacity, and documentation formatting.",
                "title": "Release notes"
              },
              {
                "id": "rollback-runbook",
                "text": "Rollback if API errors exceed 2 percent for five minutes or payment failures breach the alert threshold. Restore the last-known-good deployment before reopening traffic.\n\nRoutine notes cover staffing, dashboards, meeting cadence, maintenance calendars, regional handoffs, historical capacity, and documentation formatting.",
                "title": "Rollback runbook"
              }
            ],
            "provenance": "compact",
            "scoring": "bm25",
            "task": "Find the release condition and rollback trigger while removing duplicate operational background.",
            "tokenBudget": 128
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "clientRequestId": "req_rag_release_001",
            "compiledContextStored": false,
            "context": "# Context Pack\n\nTask: Find the release condition and rollback tr…",
            "includedPassages": [
              {
                "passageHash": "sha256:4d5e66efdcf5f8dba63a89b40af6ce17f3f42948c48b731732e47f5dc…",
                "passageId": "release-notes:1",
                "sourceId": "release-notes",
                "text": "Release may proceed after the security owner attaches credential…"
              }
            ],
            "inputHash": "sha256:288dd5cacd92158f9460346ba6e931f6d0d52f2598bd55e748fc30a18…",
            "metrics": {
              "compiledBytes": 461,
              "compiledEstimatedTokens": 83,
              "duplicatePassagesRemoved": 1,
              "estimatedReductionPercent": 14.4,
              "originalBytes": 606,
              "originalEstimatedTokens": 97,
              "sourceCount": 2,
              "sourceCoveragePercent": 100,
              "tokensSaved": 14
            },
            "outputHash": "sha256:80a337617475688482476a469f9fa7b489ef3e1ad15b4a9756fdc1aa7…",
            "packId": "ctxpack_6a5464df2ce14e9b9e16571c7d814821",
            "retentionBoundaries": {
              "claimVerificationPerformed": false,
              "completenessGuaranteed": false,
              "evidenceRetention": "best_effort",
              "hallucinationPreventionGuaranteed": false,
              "selectionType": "extractive",
              "tokenCountType": "model_neutral_estimate"
            },
            "sourceTextStored": false,
            "sources": [
              {
                "includedEstimatedTokens": 21,
                "includedPassageIds": [
                  "release-notes:1"
                ],
                "originalEstimatedTokens": 44,
                "passageCount": 2,
                "sourceHash": "sha256:288ded29ae161d3d11effd7161edf7c51ef1320e7ba0a8d2feaaed7ab…",
                "sourceId": "release-notes",
                "title": "Release notes"
              }
            ],
            "task": "Find the release condition and rollback trigger while removing d…",
            "tokenBudget": 128,
            "version": "0.1.0",
            "warningCodes": [
              "model_neutral_token_estimates",
              "extractive_selection_not_verification"
            ],
            "warnings": [
              "Token counts are model-neutral estimates, not provider tokenizer…"
            ]
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "budgetMode": {
                    "enum": [
                      "guaranteed",
                      "estimated"
                    ],
                    "type": "string"
                  },
                  "clientRequestId": {
                    "maxLength": 120,
                    "minLength": 8,
                    "type": "string"
                  },
                  "documents": {
                    "maxItems": 8,
                    "minItems": 1,
                    "type": "array"
                  },
                  "provenance": {
                    "enum": [
                      "full",
                      "compact",
                      "none"
                    ],
                    "type": "string"
                  },
                  "scoring": {
                    "enum": [
                      "bm25",
                      "keyword"
                    ],
                    "type": "string"
                  },
                  "task": {
                    "maxLength": 1200,
                    "minLength": 8,
                    "type": "string"
                  },
                  "tokenBudget": {
                    "maximum": 16000,
                    "minimum": 64,
                    "type": "integer"
                  }
                },
                "required": [
                  "clientRequestId",
                  "task",
                  "tokenBudget",
                  "documents"
                ],
                "type": "object"
              },
              "bodyType": {
                "enum": [
                  "json",
                  "form-data",
                  "text"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method",
              "bodyType",
              "body"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "additionalProperties": false,
                "properties": {
                  "clientRequestId": {
                    "maxLength": 120,
                    "minLength": 8,
                    "type": "string"
                  },
                  "compiledContextStored": {
                    "const": false,
                    "type": "boolean"
                  },
                  "context": {
                    "type": "string"
                  },
                  "includedPassages": {
                    "type": "array"
                  },
                  "inputHash": {
                    "type": "string"
                  },
                  "metrics": {
                    "type": "object"
                  },
                  "outputHash": {
                    "type": "string"
                  },
                  "packId": {
                    "type": "string"
                  },
                  "retentionBoundaries": {
                    "type": "object"
                  },
                  "sourceTextStored": {
                    "const": false,
                    "type": "boolean"
                  },
                  "sources": {
                    "maxItems": 8,
                    "minItems": 1,
                    "type": "array"
                  },
                  "task": {
                    "type": "string"
                  },
                  "tokenBudget": {
                    "maximum": 16000,
                    "minimum": 64,
                    "type": "integer"
                  },
                  "version": {
                    "const": "0.1.0",
                    "type": "string"
                  },
                  "warningCodes": {
                    "type": "array"
                  },
                  "warnings": {
                    "type": "array"
                  }
                },
                "required": [
                  "version",
                  "packId",
                  "clientRequestId",
                  "task",
                  "tokenBudget",
                  "context",
                  "metrics",
                  "includedPassages",
                  "sources",
                  "warnings",
                  "warningCodes",
                  "retentionBoundaries",
                  "inputHash",
                  "outputHash",
                  "sourceTextStored",
                  "compiledContextStored"
                ],
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    },
    "declaration-integrity": {
      "canonicalResource": "https://www.mahastrategies.com/api/v1/compress",
      "declarationDigest": "sha256:ff1556f72a25aff5298da49f220e2fb0e24d40064df25dd0fe2539165665af72",
      "metadataVersion": "2026-08-10"
    },
    "maha-offer": {
      "amount": "1000",
      "asset": "USDC",
      "assetDecimals": 6,
      "canonicalResource": "https://www.mahastrategies.com/api/v1/compress",
      "declarationInline": "compact",
      "declarationUrl": "https://www.mahastrategies.com/api/discovery/x402-offers/context-compression",
      "fullSourceTextStored": false,
      "maxRequestBytes": 450000,
      "method": "POST",
      "network": "eip155:8453",
      "offerId": "context-compression",
      "payableInProduction": true,
      "status": "available",
      "verbatimExcerptsRetained": false
    }
  },
  "tags": [
    "ai",
    "context-compression",
    "llm",
    "rag",
    "provenance",
    "bazaar",
    "declaration-integrity",
    "maha-offer"
  ],
  "sourceHost": "www.mahastrategies.com",
  "lastUpdated": "2026-10-08T06:07:23.833Z",
  "quality": {
    "calls30d": 4,
    "uniquePayers30d": 4,
    "lastCalledAt": "2026-10-08T06:07:23.601Z"
  },
  "metadata": {
    "serviceName": "Maha Context Compiler",
    "iconUrl": "https://res.cloudinary.com/bdb-prod/image/upload/c_fill,ar_1:1,w_256,h_256,f_auto,q_auto/v1786099228/bazaar-icons/1a820036513dff1d.png",
    "extensions": {
      "bazaar": {
        "info": {
          "input": {
            "body": {
              "budgetMode": "guaranteed",
              "clientRequestId": "req_rag_release_001",
              "documents": [
                {
                  "id": "release-notes",
                  "text": "Release may proceed after the security owner attaches credential-rotation evidence. The production canary passed in every region.\n\nRoutine notes cover staffing, dashboards, meeting cadence, maintenance calendars, regional handoffs, historical capacity, and documentation formatting.",
                  "title": "Release notes"
                },
                {
                  "id": "rollback-runbook",
                  "text": "Rollback if API errors exceed 2 percent for five minutes or payment failures breach the alert threshold. Restore the last-known-good deployment before reopening traffic.\n\nRoutine notes cover staffing, dashboards, meeting cadence, maintenance calendars, regional handoffs, historical capacity, and documentation formatting.",
                  "title": "Rollback runbook"
                }
              ],
              "provenance": "compact",
              "scoring": "bm25",
              "task": "Find the release condition and rollback trigger while removing duplicate operational background.",
              "tokenBudget": 128
            },
            "bodyType": "json",
            "method": "POST",
            "type": "http"
          },
          "output": {
            "example": {
              "clientRequestId": "req_rag_release_001",
              "compiledContextStored": false,
              "context": "# Context Pack\n\nTask: Find the release condition and rollback tr…",
              "includedPassages": [
                {
                  "passageHash": "sha256:4d5e66efdcf5f8dba63a89b40af6ce17f3f42948c48b731732e47f5dc…",
                  "passageId": "release-notes:1",
                  "sourceId": "release-notes",
                  "text": "Release may proceed after the security owner attaches credential…"
                }
              ],
              "inputHash": "sha256:288dd5cacd92158f9460346ba6e931f6d0d52f2598bd55e748fc30a18…",
              "metrics": {
                "compiledBytes": 461,
                "compiledEstimatedTokens": 83,
                "duplicatePassagesRemoved": 1,
                "estimatedReductionPercent": 14.4,
                "originalBytes": 606,
                "originalEstimatedTokens": 97,
                "sourceCount": 2,
                "sourceCoveragePercent": 100,
                "tokensSaved": 14
              },
              "outputHash": "sha256:80a337617475688482476a469f9fa7b489ef3e1ad15b4a9756fdc1aa7…",
              "packId": "ctxpack_6a5464df2ce14e9b9e16571c7d814821",
              "retentionBoundaries": {
                "claimVerificationPerformed": false,
                "completenessGuaranteed": false,
                "evidenceRetention": "best_effort",
                "hallucinationPreventionGuaranteed": false,
                "selectionType": "extractive",
                "tokenCountType": "model_neutral_estimate"
              },
              "sourceTextStored": false,
              "sources": [
                {
                  "includedEstimatedTokens": 21,
                  "includedPassageIds": [
                    "release-notes:1"
                  ],
                  "originalEstimatedTokens": 44,
                  "passageCount": 2,
                  "sourceHash": "sha256:288ded29ae161d3d11effd7161edf7c51ef1320e7ba0a8d2feaaed7ab…",
                  "sourceId": "release-notes",
                  "title": "Release notes"
                }
              ],
              "task": "Find the release condition and rollback trigger while removing d…",
              "tokenBudget": 128,
              "version": "0.1.0",
              "warningCodes": [
                "model_neutral_token_estimates",
                "extractive_selection_not_verification"
              ],
              "warnings": [
                "Token counts are model-neutral estimates, not provider tokenizer…"
              ]
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "additionalProperties": false,
                  "properties": {
                    "budgetMode": {
                      "enum": [
                        "guaranteed",
                        "estimated"
                      ],
                      "type": "string"
                    },
                    "clientRequestId": {
                      "maxLength": 120,
                      "minLength": 8,
                      "type": "string"
                    },
                    "documents": {
                      "maxItems": 8,
                      "minItems": 1,
                      "type": "array"
                    },
                    "provenance": {
                      "enum": [
                        "full",
                        "compact",
                        "none"
                      ],
                      "type": "string"
                    },
                    "scoring": {
                      "enum": [
                        "bm25",
                        "keyword"
                      ],
                      "type": "string"
                    },
                    "task": {
                      "maxLength": 1200,
                      "minLength": 8,
                      "type": "string"
                    },
                    "tokenBudget": {
                      "maximum": 16000,
                      "minimum": 64,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "clientRequestId",
                    "task",
                    "tokenBudget",
                    "documents"
                  ],
                  "type": "object"
                },
                "bodyType": {
                  "enum": [
                    "json",
                    "form-data",
                    "text"
                  ],
                  "type": "string"
                },
                "method": {
                  "enum": [
                    "POST"
                  ],
                  "type": "string"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "method",
                "bodyType",
                "body"
              ],
              "type": "object"
            },
            "output": {
              "properties": {
                "example": {
                  "additionalProperties": false,
                  "properties": {
                    "clientRequestId": {
                      "maxLength": 120,
                      "minLength": 8,
                      "type": "string"
                    },
                    "compiledContextStored": {
                      "const": false,
                      "type": "boolean"
                    },
                    "context": {
                      "type": "string"
                    },
                    "includedPassages": {
                      "type": "array"
                    },
                    "inputHash": {
                      "type": "string"
                    },
                    "metrics": {
                      "type": "object"
                    },
                    "outputHash": {
                      "type": "string"
                    },
                    "packId": {
                      "type": "string"
                    },
                    "retentionBoundaries": {
                      "type": "object"
                    },
                    "sourceTextStored": {
                      "const": false,
                      "type": "boolean"
                    },
                    "sources": {
                      "maxItems": 8,
                      "minItems": 1,
                      "type": "array"
                    },
                    "task": {
                      "type": "string"
                    },
                    "tokenBudget": {
                      "maximum": 16000,
                      "minimum": 64,
                      "type": "integer"
                    },
                    "version": {
                      "const": "0.1.0",
                      "type": "string"
                    },
                    "warningCodes": {
                      "type": "array"
                    },
                    "warnings": {
                      "type": "array"
                    }
                  },
                  "required": [
                    "version",
                    "packId",
                    "clientRequestId",
                    "task",
                    "tokenBudget",
                    "context",
                    "metrics",
                    "includedPassages",
                    "sources",
                    "warnings",
                    "warningCodes",
                    "retentionBoundaries",
                    "inputHash",
                    "outputHash",
                    "sourceTextStored",
                    "compiledContextStored"
                  ],
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      },
      "declaration-integrity": {
        "canonicalResource": "https://www.mahastrategies.com/api/v1/compress",
        "declarationDigest": "sha256:ff1556f72a25aff5298da49f220e2fb0e24d40064df25dd0fe2539165665af72",
        "metadataVersion": "2026-08-10"
      },
      "maha-offer": {
        "amount": "1000",
        "asset": "USDC",
        "assetDecimals": 6,
        "canonicalResource": "https://www.mahastrategies.com/api/v1/compress",
        "declarationInline": "compact",
        "declarationUrl": "https://www.mahastrategies.com/api/discovery/x402-offers/context-compression",
        "fullSourceTextStored": false,
        "maxRequestBytes": 450000,
        "method": "POST",
        "network": "eip155:8453",
        "offerId": "context-compression",
        "payableInProduction": true,
        "status": "available",
        "verbatimExcerptsRetained": false
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "www.mahastrategies.com",
    "manifest_name": "www.mahastrategies.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "example": {
      "clientRequestId": "string",
      "compiledContextStored": true,
      "context": "string",
      "includedPassages": [
        "value"
      ],
      "inputHash": "string",
      "metrics": {},
      "outputHash": "string",
      "packId": "string",
      "retentionBoundaries": {},
      "sourceTextStored": true,
      "sources": [
        "value"
      ],
      "task": "string",
      "tokenBudget": 0,
      "version": "string",
      "warningCodes": [
        "value"
      ],
      "warnings": [
        "value"
      ]
    },
    "type": "string"
  }
}