# agent402.tools Text Chunker

> agent402.tools Text Chunker is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Splits input text into overlapping chunks by character count or LLM token count for RAG ingestion, returning chunks with their offsets.

## Facts

- Endpoint: POST https://agent402.tools/api/text-chunk
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-text-chunker-eb694dfe
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6UE3gGt8rzVLmrUnyBcTU

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-tools-text-chunker-eb694dfe -d '<json body>'
```

Example prompt: Chunk this 10,000-word article into overlapping segments of 800 tokens each (using the gpt-4o tokenizer) with a 100-token overlap so I can load them into my vector database.

## When to prefer this

Use this endpoint when you need deterministic, model-free text splitting for RAG or embedding pipelines, especially when you require precise token-level chunking using a specific LLM tokenizer (e.g. gpt-4o) or need overlapping windows for better retrieval recall. Prefer over ad-hoc string splitting when token accuracy matters.

## Known failure modes

- Text field missing or empty — API returns 400 error
- Invalid unit value (not 'chars' or 'tokens') — API returns 400 error
- Invalid or unsupported tokenizer model name — API returns 400/422 error
- chunk size or overlap value is non-positive or overlap exceeds chunk size — may return 400 error or degenerate chunks
- Payment not attached or insufficient — API returns 402 Payment Required

## How this service works

Split text into overlapping chunks for RAG ingestion - by characters (default) or by exact LLM tokens. Returns the chunks plus offsets. Deterministic, no model needed.

## Output

An array of text chunks derived from the input, each with its content and character/token offsets indicating its position in the original text. Output is deterministic given the same inputs.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "size": {
   "type": "number",
   "description": "chunk size (default 800)"
  },
  "text": {
   "type": "string",
   "description": "Text to split into chunks (max 500KB)"
  },
  "unit": {
   "type": "string",
   "description": "chars (default) | tokens"
  },
  "model": {
   "type": "string",
   "description": "tokenizer model when unit=tokens (default gpt-4o)"
  },
  "overlap": {
   "type": "number",
   "description": "overlap between chunks (default 0)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "size": 120,
  "unit": "chars",
  "count": 4,
  "chunks": [
   "The x402 protocol lets an agent pay for a single request. A server answers with payment terms, the agent signs a stablec",
   "gent signs a stablecoin authorization, and the request is retried with the payment attached. Payment settles on chain, s"
  ],
  "overlap": 20
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-text-chunker-eb694dfe/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
