APIReference

Estimate Messages input tokens

POST
/v1/messages/count_tokens

Returns the input-token estimate used by compatible coding-agent clients. Requires an authenticated Codius API key.

AuthorizationBearer <token>

A Codius organization API key, sent as Authorization: Bearer codius_live_…. Keys carry a subset of the models:read, inference:create, and usage:read scopes — never billing or admin permissions.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

[key: string]?any

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/messages/count_tokens" \  -H "Content-Type: application/json" \  -d '{}'
{  "input_tokens": 1}