Documentation

Count Tokens

Updated: Nov 11, 2026

Method and Path

POST
/v1/messages/count_tokens

Counts the input tokens of a request without generating a response. No task is created and no charge is incurred. The response does not include X-Vod-Task-Id.

Authorization

See API Guide - Authentication.

Header Parameters

See API Guide - Common Request Headers.

HeaderRequiredDescription
anthropic-versionNoAnthropic API version. The official Anthropic SDK sends it automatically.

Request Body

application/json
  1. body
model*string

Model ID, e.g. deepseek-v4-flash.

messages*array<>

List of conversation messages; each item has role and content.

system?|array<>

System prompt, passed separately from messages.

tools?array<>

Tool definitions.

tool_choice?

Tool choice strategy.

thinking?

Thinking / reasoning configuration.

Response Body

Successful response

application/json
  1. response
input_tokens?integer

Number of input tokens in the request.

Example Request
curl -X POST 'https://api.cysuo.com/v1/messages/count_tokens' \  -H 'Content-Type: application/json' \  -d '{  "model": "deepseek-v4-flash",  "messages": [    {      "role": "user",      "content": "Hello, please introduce yourself."    }  ]}'
Example Response200
{  "input_tokens": 0}