---
title: "Token Count (x402)"
method: GET
path: "/x402/v2/token-count"
tags: ["x402"]
---

# Token Count (x402)

`GET /x402/v2/token-count`

## Request

- Base URL: `https://api.strale.io`
- URL: `https://api.strale.io/x402/v2/token-count`
- Auth: none required

Estimate token count and cost for text across LLM models (GPT-4o, Claude, Gemini, Mistral, Llama). Algorithmic — no API calls.

## Query parameters

- `text` string, required
- `model` string: gpt-4o, claude-3-haiku, etc.

## Response `200`

Success

- object
  - `token_count` integer
  - `estimated_cost_usd` number
  - `fits_context_window` boolean
  - `max_context_for_model` integer

## Other responses

- `402`: Payment required (x402 — pay with USDC on Base)

---

[API](https://skmtc.dev/strale/apis/strale-api-2.md) · [All operations](https://skmtc.dev/strale/apis/strale-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/strale/apis/strale-api-2/revisions/a5293878cfc6?raw)
