{"uid":"cap_pIhgZqgA3M_C2K-Z9OjK_","slug":"pennyrail-token-counter-46495bad","name":"PennyRail Token Counter","description":"Machine-readable settlement service","url":"https://pennyrail.vercel.app/api/p/nano/text.token-count--count-tokens","method":"POST","headers":{},"bodySchema":{"type":"object","required":["input"],"properties":{"input":{"type":"object"}}},"responseSchema":{"type":"object","additionalProperties":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_oaVqywxAfzzqWAx1NYkn9","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 tokens in a given text input using a nano-scale paid API endpoint","exampleAgentPrompt":"How many tokens is this text: 'The quick brown fox jumps over the lazy dog. Large language models process text as tokens rather than raw characters.'?","exampleUseCases":[{"title":"Pre-flight LLM prompt sizing","prompt":"Before I send this 3-paragraph draft to GPT-4, can you count how many tokens it contains so I know if it fits in the context window?"},{"title":"API cost estimation for bulk text","prompt":"I have this product description I'm about to embed — can you tell me the token count so I can estimate what it'll cost per call?"},{"title":"Enforcing token limits in user input","prompt":"Check how many tokens are in the user's message: 'Please summarize the entire history of the Roman Empire in exhaustive detail' — I want to know if it exceeds 512 tokens."}],"resultDescription":"Returns a count of tokens present in the submitted text, likely as a numeric value or object containing the count and possibly token-level breakdown details.","failureModes":["Missing 'input' field in request body returns validation error","Empty or null text may return zero or an error","Malformed JSON body causes parse failure","Payment not included or insufficient USDC triggers 402 response","Rate limiting or service unavailability returns 5xx error"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, pay-per-use token counting service without spinning up a local tokenizer library. It is ideal for agent pipelines that need to verify token budgets before LLM calls, estimate costs, or enforce input size limits, especially when running in serverless or constrained environments where installing tokenizer dependencies is impractical.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T07:21:40.465Z","isFirstParty":false}