# Web2Markdown Text Truncate API

> Web2Markdown Text Truncate API is a paid API for AI agents from lin-desk-x402.lindesk.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-11).

Truncates a text string to a specified character limit, optionally appending an ellipsis, returning character counts and elapsed time.

## Facts

- Endpoint: GET https://lin-desk-x402.lindesk.workers.dev/v1/texttools/truncate?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/web2markdown-text-truncate-api-30f4cf0d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tCKqS-b_vbR033w2AO6Kp

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 web2markdown-text-truncate-api-30f4cf0d
```

Example prompt: Truncate this text to 500 characters and add an ellipsis at the end: 'Artificial intelligence is transforming industries worldwide, from healthcare to finance, enabling automation of complex tasks that previously required human expertise...'

## When to prefer this

Choose this endpoint when you need a fast, stateless, pay-per-call text truncation with precise character counting and optional ellipsis — especially when integrating into AI agent pipelines that need to stay within character budgets without standing up your own string-processing logic or managing API keys.

## Known failure modes

- Missing required 'input' query parameter returns an error
- Input text exceeding 100 KiB limit may be rejected
- Invalid max_chars value (non-integer string) may cause a validation error
- Payment failure via x402 protocol results in 402 response before processing
- Network timeout on the Cloudflare Worker edge

## How this service works

Pay-per-call API for AI agents: turn any public web page or PDF into clean, LLM-ready Markdown. $0.002 per call in USDC on Base via x402. No API key, no signup.

## Output

A JSON object with the operation name ('truncate'), a meta object containing chars_in (original character count), chars_out (truncated character count), and elapsed_ms (processing time in milliseconds), plus a result field with the truncated string (with optional ellipsis appended).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "input"
     ],
     "properties": {
      "input": {
       "type": "string",
       "description": "Input text; max 100 KiB"
      },
      "ellipsis": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string",
       "description": "Default true"
      },
      "max_chars": {
       "type": "string",
       "pattern": "^-?\\d+$"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "op": {
       "type": "string"
      },
      "meta": {
       "type": "object",
       "properties": {
        "chars_in": {
         "type": "integer"
        },
        "chars_out": {
         "type": "integer"
        },
        "elapsed_ms": {
         "type": "integer"
        }
       }
      },
      "result": {}
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "op": "truncate",
  "meta": {
   "chars_in": 43,
   "chars_out": 20,
   "elapsed_ms": 0
  },
  "result": "The quick brown fox…"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/web2markdown-text-truncate-api-30f4cf0d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from lin-desk-x402.lindesk.workers.dev](https://www.zero.xyz/host/lin-desk-x402.lindesk.workers.dev/llms.txt)
