Skip to content
Fourohtwo

saylorinnovations.com/api/text/token-estimate

Estimate the LLM token count of text with a low to high range, a breakdown by words, numbers, symbols and CJK, and whether it fits a given context window

BaseAnswering
GEThttps://saylorinnovations.com/api/text/token-estimate

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://saylorinnovations.com/api/text/token-estimate?text=The+quick+brown+fox+jumps+over+the+lazy+dog.+Call+fn%28x%29+%7B+return+42%3B+%7D&context_tokens=8000");
console.log(await res.json());

Example input

{
  "text": "The quick brown fox jumps over the lazy dog. Call fn(x) { return 42; }",
  "context_tokens": "8000"
}

More from Saylor Innovations Data Desk