{"uid":"cap_Z66FsMEvx8_Rgk0zTk46t","slug":"pagos-andreax-dev-token-counter-70f0f2c1","name":"pagos.andreax.dev Token Counter","description":"Estima los tokens de un texto (para presupuestar llamadas LLM). Alto volumen. input=texto.","url":"https://pagos.andreax.dev/api/taller/peaje/contar-tokens","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["input"],"properties":{"input":{"type":"string","description":"texto a medir"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"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_r6RK71kJWGxx8R918zofg","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":"Estimates the token count of a text string to help budget LLM API calls before making them","exampleAgentPrompt":"How many tokens is this text: 'The quick brown fox jumps over the lazy dog. In machine learning, tokenization is the process of splitting text into discrete units.'? I need to know before sending it to an LLM.","exampleUseCases":[{"title":"Pre-flight cost check before LLM call","prompt":"Before I send this 2000-word article to the LLM, can you count how many tokens it contains so I can estimate the API cost? Here's the text: 'Artificial intelligence has transformed the way we process information...'"},{"title":"Context window overflow prevention","prompt":"I'm building a RAG pipeline and need to make sure my prompt plus retrieved chunks don't exceed 8192 tokens. Count the tokens in this combined text so I know if I need to trim: 'System: You are a helpful assistant. Context: ...'"},{"title":"Batch content routing by token size","prompt":"I need to decide whether to route this customer support message to the cheap short-context model or the expensive long-context one — count the tokens in this text for me: 'Hi, I've been having ongoing issues with my subscription for the past three months...'"}],"resultDescription":"Returns a numeric token count estimate for the submitted text, enabling the caller to predict LLM inference cost, verify context window fit, or route requests based on size before committing to an LLM call.","failureModes":["Missing 'input' query parameter returns a validation error","Empty string input may return 0 tokens or an error","Very large texts may hit request size limits","Service unavailability returns a non-200 HTTP status","Payment failure via x402 protocol blocks the request"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, cheap ($0.001 USDC) token count estimate before making an LLM call — especially useful in high-volume pipelines where you want to pre-screen text size, route to the right model tier, or budget inference costs without actually running inference. Prefer this over counting tokens client-side if you don't have a local tokenizer available or need a consistent server-side count.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:54:13.610Z","isFirstParty":false}