# Delx String Trunc

> Delx String Trunc is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Truncates a string to a specified maximum character length, optionally appending an ellipsis suffix

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/string-trunc
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-string-trunc-835f7c87
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__a1qVLL2yJ8CPFuZgxZWe

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 delx-string-trunc-835f7c87 -d '<json body>'
```

Example prompt: Truncate this product description to 80 characters and add '...' at the end if it gets cut: 'Our premium hand-crafted artisan coffee beans are sourced directly from sustainable farms in Colombia and Ethiopia.'

## When to prefer this

Choose this endpoint when you need a deterministic, stateless, zero-dependency string truncation in an agent pipeline — especially during preflight formatting steps, payload preparation, or when enforcing character limits on dynamic text before display, storage, or transport. Prefer it over in-code string slicing when you want a consistent, billable, auditable micro-utility call with JSON output that integrates cleanly into x402-based agentic workflows.

## Known failure modes

- Missing required fields (text or max_chars) return a validation error
- max_chars of zero or negative may return an error or empty string
- Payment failure via x402 protocol returns a 402 status with payment details
- Malformed JSON body returns a 400 error
- Very large input strings may hit request size limits

## How this service works

Truncate a string to max_chars with optional ellipsis — first-party local utility for agent preflight and proven micro-utils expansion. Returns deterministic machine-readable JSON for $0.001 USDC via x402 on Base. Execution is first-party, local-only, stateless, and memory-only with no paid upstream, no input retention, no web search, no live RPC, and no mediagen. Results are advisory; the caller owns authorization, budgets, and production controls. Sibling of Delx routes that already converted…

## Output

A deterministic JSON object containing the truncated string result — the input text clipped at max_chars characters, with the optional ellipsis appended if truncation occurred. The response is machine-readable, stateless, and consistent for identical inputs.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Input field: text."
  },
  "ellipsis": {
   "type": "string",
   "description": "Input field: ellipsis."
  },
  "max_chars": {
   "type": "integer",
   "description": "Input field: max chars."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "result": "abcdefghi…",
  "schema": "delx/util-string-trunc/v1",
  "max_chars": 10,
  "truncated": true,
  "original_chars": 26
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-string-trunc-835f7c87/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
