# Delx Commerce Line Count API

> Delx Commerce Line Count API is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Counts lines, characters, non-empty lines, and detects newline endings in a given text string

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/line-count?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-line-count-api-0aed3601
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8XVypvb8lVgNioBXuxrcB

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-commerce-line-count-api-0aed3601 -d '<json body>'
```

Example prompt: Count the lines and characters in this text, and tell me how many are non-empty — include empty lines in the count: 'Hello world\n\nThis is a test\nDone'

## When to prefer this

Choose this endpoint when you need a cheap, verifiable, pay-per-call utility to count lines and characters in text without any setup or subscription. Ideal for AI agents that need to audit text structure, validate file formatting conventions (e.g., trailing newlines), or preprocess content before downstream operations. At $0.001 USDC per call with no signup required, it suits high-frequency agent workflows that need deterministic text metrics.

## Known failure modes

- Missing or empty text field returns error
- Non-string text input may cause validation failure
- Extremely large text strings may time out or be rejected
- Malformed JSON request body returns 400-level error

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object with: ok (boolean success flag), chars (total character count), lines (total line count), nonempty_lines (count of lines with content), ends_with_newline (boolean), and a schema identifier string.

## 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-commerce-line-count-api-0aed3601/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from commerce.delx.ai](https://www.zero.xyz/host/commerce.delx.ai/llms.txt)
