{"uid":"cap_FPZRJlrh1q5Mzh5qg4Zyl","slug":"one-engine-text-token-lines-counter-t9-fe31af08","name":"ONE Engine Text Token Lines Counter (t9)","description":"Low-cost pay-per-call utility APIs for autonomous agents using x402 on Base.","url":"https://one-search.one-engine.workers.dev/v3/text-token/lines/t9?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","description":"Text up to 50000 characters"}}},"responseSchema":{"type":"object","additionalProperties":true},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.018","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.018/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.018","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.018","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_gD_HDIAgXKToMiFn7HywV","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.018","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Counts and returns line-level token information for a given text input up to 50,000 characters.","exampleAgentPrompt":"Count the tokens for each line in this text and give me a breakdown: 'Line one is here.\nLine two follows.\nAnd here is line three.' — I want to see the token count per line.","exampleUseCases":[{"title":"LLM prompt token budgeting by line","prompt":"I'm building a prompt and need to know how many tokens each line uses so I don't exceed my context limit — can you count the tokens per line for this text: 'You are a helpful assistant.\nAnswer concisely.\nDo not repeat yourself.'"},{"title":"Document preprocessing for chunking","prompt":"Before I chunk this document for RAG, I want to see the token count for each line so I can split it intelligently — here's the text: 'Introduction to machine learning.\nSupervised learning uses labeled data.\nUnsupervised learning finds hidden patterns.'"},{"title":"Detecting token-heavy lines in a script","prompt":"Can you check each line of this script and tell me which ones have the most tokens? Here's the content: 'Once upon a time in a land far away, there lived a mighty dragon.\nThe dragon breathed fire.\nvillagers feared it greatly.'"}],"resultDescription":"Returns a JSON object containing line-level token data for the submitted text, including token counts or token sequences broken down by each line of the input.","failureModes":["Text exceeds 50,000 character limit — likely returns a 400 or validation error","Empty text field — may return an error or empty result","Payment failure via x402 — returns 402 Payment Required if USDC not provided","Malformed JSON body — returns 400 Bad Request","Network timeout on Cloudflare Worker — transient 5xx error"],"whenToPreferThis":"Choose this endpoint when you need granular, line-by-line token analysis of a text block, especially for LLM context planning, document chunking, or prompt engineering. It is low-cost ($0.018 USDC per call) and pay-per-use via x402 on Base, making it suitable for agent workflows that need lightweight, on-demand tokenization without a subscription.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:44:11.154Z","isFirstParty":false,"canonicalSlug":"one-engine-text-token-lines-counter-t9-fe31af08"}