Skip to main content
POST
Count message tokens (estimate)

Authorizations

Authorization
string
header
required

Use a Runcrate API key with the rc_live_* prefix as the bearer token. Create one at https://www.runcrate.ai/dashboard/api-keys.

Body

application/json
model
string
required

A Runcrate model id (e.g. deepseek-ai/DeepSeek-V4.1-Flash). Claude model names such as claude-sonnet-4-5 are not Runcrate ids and answer 404.

messages
object[]
required

Turns with role (user or assistant) and content: a string, or blocks of type text, image (base64 or url source), document (text source), tool_use and tool_result (with is_error). thinking blocks sent back are accepted and not passed to the model.

system

A string or text blocks; cache_control is kept.

max_tokens
integer
Required range: x >= 1
temperature
number
top_p
number
top_k
integer
stop_sequences
string[]
stream
boolean
default:false
tools
object[]

Custom tools with name, description and input_schema.

tool_choice
object

{type: auto | any | tool | none}; tool takes name; disable_parallel_tool_use is honored.

thinking
object

{type: enabled, budget_tokens} sets the reasoning effort: under 4,096 low, under 16,384 medium, else high. output_config.effort takes precedence.

metadata
object

Accepted and never sent to the model.

Response

The estimate.

input_tokens
integer