16trust / 100
Contar Tokens Pago
by Vextorium in AI models & inference
x402 APIFailing, checked 2 h ago
Count the tokens of a text with OpenAI tokenizers (o200k for GPT-4o/4.1/5, cl100k for GPT-4/3.5) plus estimates for Claude, Llama and Gemini, with characters per token. Budget LLM calls and split contexts.
POST https://api.vextorium.com/contar-tokens-pago
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 0.0%
- Response time
- - typical, - slowest 5%
- Last check
- 2 h ago: Amount "0.003" is not in atomic token units
- Next check
- any minute now
How to call it
# See the payment challenge (nothing is charged)
curl -i -X POST "https://api.vextorium.com/contar-tokens-pago" \
-H "content-type: application/json" \
-d '{"texto":"Artificial intelligence agents are transforming the digital economy. AI agents pay for data with micropayments. The x402 protocol lets agents pay per call without accounts. Many companies already offer pay-per-use APIs for agents. USDC micropayments make this business model viable."}'import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client().register(
"eip155:8453",
new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.vextorium.com%2Fcontar-tokens-pago
const res = await pay("https://api.vextorium.com/contar-tokens-pago", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"texto":"Artificial intelligence agents are transforming the digital economy. AI agents pay for data with micropayments. The x402 protocol lets agents pay per call without accounts. Many companies already offer pay-per-use APIs for agents. USDC micropayments make this business model viable."}),
});
console.log(await res.json());Example input
{
"texto": "Artificial intelligence agents are transforming the digital economy. AI agents pay for data with micropayments. The x402 protocol lets agents pay per call without accounts. Many companies already offer pay-per-use APIs for agents. USDC micropayments make this business model viable."
}Example output
{
"caracteres": 282,
"caracteres_por_token": 5.32,
"codificacion": "o200k_base",
"estimaciones": {
"claude_aprox": 58,
"gemini_aprox": 50,
"llama3_aprox": 54
},
"nota": "Recuento exacto para las codificaciones de OpenAI; el resto son estimaciones (cada modelo tokeniza distinto).",
"palabras": 40,
"tokens": 53,
"tokens_otra_codificacion": {
"cl100k_base": 56
}
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 2 h ago | Amount "0.003" is not in atomic token units | 402 | 77 ms | $0.003 |
| 6 h ago | Amount "0.003" is not in atomic token units | 402 | 80 ms | $0.003 |
| 11 h ago | Amount "0.003" is not in atomic token units | 402 | 91 ms | $0.003 |
| 15 h ago | Amount "0.003" is not in atomic token units | 402 | 108 ms | $0.003 |
| 19 h ago | Amount "0.003" is not in atomic token units | 402 | 89 ms | $0.003 |
| 23 h ago | Amount "0.003" is not in atomic token units | 402 | 88 ms | $0.003 |
| 27 h ago | Amount "0.003" is not in atomic token units | 402 | 74 ms | $0.003 |
| 31 h ago | Amount "0.003" is not in atomic token units | 402 | 82 ms | $0.003 |
| 35 h ago | Amount "0.003" is not in atomic token units | 402 | 226 ms | $0.003 |
| 39 h ago | Amount "0.003" is not in atomic token units | 402 | 203 ms | $0.003 |
| 43 h ago | Amount "0.003" is not in atomic token units | 402 | 85 ms | $0.003 |
| 47 h ago | Amount "0.003" is not in atomic token units | 402 | 178 ms | $0.003 |
| 2 days ago | Amount "0.003" is not in atomic token units | 402 | 80 ms | $0.003 |
| 2 days ago | Amount "0.003" is not in atomic token units | 402 | 78 ms | $0.003 |
| 2 days ago | Amount "0.003" is not in atomic token units | 402 | 84 ms | $0.003 |