{"uid":"cap_OUapys7uarXOVPxA1hH-4","slug":"delx-line-count-864085aa","name":"Delx Line Count","description":"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…","url":"https://api.delx.ai/api/v1/x402/line-count","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"Input field: text."},"keep_empty":{"type":"boolean","description":"Input field: keep empty."}}},"responseSchema":{"type":"json","example":{"ok":true,"chars":7,"lines":4,"schema":"delx/util-line-count/v1","nonempty_lines":3,"ends_with_newline":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_HtmjQKW5cpw145--mMOR_","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Counts the number of lines in a given text string and returns a deterministic JSON breakdown, optionally including or excluding empty lines.","exampleAgentPrompt":"Count the lines in this text for me, and break it down by empty vs non-empty lines: 'Hello world\n\nThis is line three\nAnd line four'","exampleUseCases":[{"title":"Preflight line count before chunking","prompt":"Before I split this document into chunks, tell me how many lines it has and how many of those are empty — here's the text: 'Line one\nLine two\n\nLine four\nLine five'"},{"title":"Validate generated output line length","prompt":"I just generated a 50-line poem — can you count the actual lines in this text and confirm how many are non-empty so I can verify it came out right?"},{"title":"Filter empty lines from pasted log","prompt":"I pasted a server log that has a bunch of blank lines mixed in — count just the non-empty lines for me so I know how many real log entries there are."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:57:35.765Z","isFirstParty":false}