80trust / 100

Skills Token Count

by Grokzilla x402 Micro Pay in Onchain & crypto

x402 APIPassing, checked 16 min ago

Approximate cl100k/o200k token counts for budget decisions.

POST https://grokzilla.shop/api/skills/token-count

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
162 ms typical, 162 ms slowest 5%
Last check
16 min ago
Next check
in 17 min

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://grokzilla.shop/api/skills/token-count" \
  -H "content-type: application/json" \
  -d '{"encoding":"cl100k_base","text":"hello agent"}'
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%2Fgrokzilla.shop%2Fapi%2Fskills%2Ftoken-count
const res = await pay("https://grokzilla.shop/api/skills/token-count", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"encoding":"cl100k_base","text":"hello agent"}),
});
console.log(await res.json());

Example input

{
  "encoding": "cl100k_base",
  "text": "hello agent"
}

Example output

{
  "approx_tokens": 2,
  "chars": 11,
  "encoding": "cl100k_base",
  "ok": true,
  "skill": "token_count",
  "usd_hint_gpt4o_mini": 3e-7,
  "words": 2
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
16 min agoPassed402282 ms$0.004
4 h agoPassed402162 ms$0.004
9 h agoPassed402146 ms$0.004