Developer API
Integrate token counting directly into your apps. No API key. No signup. Rate-limited to 100 requests/hour per IP.
https://tokenia.live/api/v1Count tokens and estimate costs for a given text across all providers (or a specific one).
{ "text": "Your prompt text here", // required "provider": "openai", // optional: openai|anthropic|google|meta|mistral|deepseek "model": "gpt-4o" // optional: filter to specific model }
{ "tokens": 1250, "chars": 5000, "words": 820, "results": [ { "provider": "openai", "model": "gpt-4o", "modelId": "gpt-4o", "tokens": 1250, "inputCostPer1M": 2.50, "outputCostPer1M": 10.00, "inputCost": 0.000003125, "outputCost": 0.00001250, "totalCost": 0.00001563, "precision": "estimated" } ], "rateLimit": { "remaining": 99, "resetIn": "3600s" } }
# Basic token count curl -X POST https://tokenia.live/api/v1/count \ -H "Content-Type: application/json" \ -d '{"text": "Hello, world! This is a test prompt."}' # Filter by provider curl -X POST https://tokenia.live/api/v1/count \ -H "Content-Type: application/json" \ -d '{"text": "Your prompt here", "provider": "anthropic"}'
| Tier | Requests/hour | Auth |
|---|---|---|
| Free (public) | 100 | None |
Rate-limited by IP. Headers: X-RateLimit-Remaining and X-RateLimit-Reset.
Need higher limits? Contact us โ we'll work something out.