Token Counter & LLM Cost
Count a text's tokens and estimate the cost of one call on popular LLMs (or the models you list), input plus an expected number of output tokens, and whether it fits each context window.
- Price per call
- $0.002
- Chain
- Base
- Method
- GET
- Paid calls · 30 days
- 3
Call it from code
This API is run by its own provider and paid directly through x402. We list it so you can find it; we don't route or hold the payment.
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
const client = new x402Client();
registerExactEvmScheme(client, { signer: agentAccount });
const pay = wrapFetchWithPayment(fetch, client);
const res = await pay("https://bess-x402.onrender.com/v1/ai/token-cost", { method: "GET" });
console.log(await res.json());https://bess-x402.onrender.com/v1/ai/token-cost