# semantic_chunker (`net.2xcel.aus.semantic-chunker`)

> Agent Utility Service (AUS) Semantic Chunker: Token-budgeted text and markdown chunking engine for AI agents and RAG pipelines, preserving sentence boundaries and metadata.

## Metadata & Execution
- **Namespace**: `net.2xcel.aus.semantic-chunker`
- **Canonical HTML Page**: https://aipages.tech/tool/net.2xcel.aus.semantic-chunker
- **JSON Specification**: https://aipages.tech/api/tools/net.2xcel.aus.semantic-chunker
- **Execution Endpoint**: `POST https://aipages.tech/tool/semantic-chunker`
- **Connection Protocol**: `http`
- **Pricing**: $0.002 USDC per call (Base Mainnet Chain ID 8453)
- **Health Status**: `unknown`
- **Capabilities**: semantic-chunking, rag-optimization, token-budgeting, nlp
- **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": {
    "text": {
      "type": "string",
      "description": "Raw text or markdown document to chunk"
    },
    "max_tokens": {
      "type": "integer",
      "default": 500,
      "maximum": 4000,
      "description": "Maximum approximate tokens per chunk (default: 500)"
    },
    "overlap_tokens": {
      "type": "integer",
      "default": 50,
      "description": "Token overlap between consecutive chunks (default: 50)"
    },
    "preserve_sentences": {
      "type": "boolean",
      "default": true,
      "description": "Avoid splitting within sentence boundaries"
    },
    "metadata": {
      "type": "object",
      "description": "Optional metadata object to attach to every generated chunk"
    }
  },
  "required": [
    "text"
  ]
}
```

## Invocation Examples

### 1. Zero-Friction Sandbox Test (No Payment Required)
```bash
curl -X POST "https://aipages.tech/tool/net.2xcel.aus.semantic-chunker" \
  -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/semantic-chunker" \
  -H "Content-Type: application/json" \
  -H "x-payment-receipt: <BASE_USDC_PAYMENT_RECEIPT>" \
  -d '{}'
```
