Count input tokens

POST https://api.inoneapi.com/v1/messages/count_tokens

Estimate input tokens using Messages input for a supported model/mapping. This is not a universal offline tokenizer or a final billing quote. Key, budget, rate and model checks still apply.

curl  https://api.inoneapi.com/v1/messages/count_tokens \
  -H "x-api-key: $INONEAPI_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"YOUR_MODEL_ID","messages":[{"role":"user","content":"Hello"}]}'

Use the exact catalog ID. Include system, tools and file blocks consistently with the real request when supported. Native counting depends on the upstream; fallback counting does not replace recorded final usage. File references follow Messages.

{ "input_tokens": 12 }

The number is illustrative. Errors follow the Anthropic shape; see Errors.

Count input tokens · Documentation · InOneAPI