# context_compressor (`net.2xcel.aus.context-compressor`)

> Agent Utility Service (AUS) Context Compressor: High-performance semantic token compressor and budget optimizer. Reduces oversized context payloads down to a strict token budget without losing critical entities, code symbols, key-value pairs, or operational facts.

## Metadata & Execution
- **Namespace**: `net.2xcel.aus.context-compressor`
- **Canonical HTML Page**: https://aipages.tech/tool/net.2xcel.aus.context-compressor
- **JSON Specification**: https://aipages.tech/api/tools/net.2xcel.aus.context-compressor
- **Execution Endpoint**: `POST https://aipages.tech/tool/context-compressor`
- **Connection Protocol**: `http`
- **Pricing**: $0.002 USDC per call (Base Mainnet Chain ID 8453)
- **Health Status**: `unknown`
- **Capabilities**: token-compression, context-optimization, semantic-distillation, token-optimization
- **Authentication**: x402 payment protocol (Header: x-payment-receipt; Token: USDC on Base Mainnet; Recipient: 0xE57cB8C73c4000EA04ba0eb607228CbAec7f8e9C)

## Input Parameters (JSON Schema Draft-07)
```json
{
  "type": "object",
  "properties": {
    "content": {
      "type": "string",
      "description": "Raw markdown, long text, error log, or JSON payload to compress"
    },
    "budget_tokens": {
      "type": "number",
      "default": 1500,
      "description": "Target maximum token count for the compressed output"
    },
    "format": {
      "type": "string",
      "enum": [
        "facts",
        "markdown",
        "json",
        "summary"
      ],
      "default": "facts",
      "description": "Output format structure for distilled context"
    },
    "preserve_entities": {
      "type": "boolean",
      "default": true,
      "description": "Prioritize preserving numbers, code identifiers, URLs, and key entities"
    }
  },
  "required": [
    "content"
  ]
}
```

## Invocation Examples

### 1. Zero-Friction Sandbox Test (No Payment Required)
```bash
curl -X POST "https://aipages.tech/tool/net.2xcel.aus.context-compressor" \
  -H "Content-Type: application/json" \
  -H "x-playground-test: true" \
  -H "x-agent-id: markdown-agent" \
  -d '{}'
```

### 2. Production Invocation (x402 Base Mainnet Settlement)
```bash
curl -X POST "https://aipages.tech/tool/context-compressor" \
  -H "Content-Type: application/json" \
  -H "x-payment-receipt: <BASE_USDC_PAYMENT_RECEIPT>" \
  -d '{}'
```

## Related Tools
- [parse_markdown](https://aipages.tech/tool/net.2xcel.aus.parse-markdown): Agent Utility Service (AUS) Web Extraction: Accepts any URL, strips out ads, cookie banners, and DOM bloat, and returns clean, token-optimized Markdown.
