# Delx Line Count

> Delx Line Count 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).

Counts the number of lines in a given text string and returns a deterministic JSON breakdown, optionally including or excluding empty lines.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/line-count
- 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-line-count-864085aa
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OUapys7uarXOVPxA1hH-4

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-line-count-864085aa -d '<json body>'
```

Example prompt: Count the lines in this text for me, and break it down by empty vs non-empty lines: 'Hello world

This is line three
And line four'

## When to prefer this

Use this endpoint when you need a fast, cheap, stateless, deterministic line count with an empty/non-empty breakdown — ideal as a preflight step before text chunking, log parsing, or output validation. Prefer it over implementing custom line-splitting logic when you want a machine-readable JSON result without any local code execution or dependencies.

## Known failure modes

- Empty or missing text field returns an error or zero-line result
- Extremely large text payloads may be rejected or time out
- Payment failure via x402 blocks execution
- Malformed JSON request body returns a 400-level error

## How this service works

Count lines in caller-held text with nonempty breakdown — 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 convert…

## Output

Returns a deterministic JSON object containing the total line count, the count of non-empty lines, the count of empty lines, and optionally a per-line breakdown, based on the provided text input and the keep_empty flag.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Input field: text."
  },
  "keep_empty": {
   "type": "boolean",
   "description": "Input field: keep empty."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "chars": 7,
  "lines": 4,
  "schema": "delx/util-line-count/v1",
  "nonempty_lines": 3,
  "ends_with_newline": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-line-count-864085aa/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)
