---
title: "Count tokens"
method: POST
path: "/anthropic/v1/messages/count_tokens"
tags: ["Anthropic"]
---

# Count tokens

`POST /anthropic/v1/messages/count_tokens`

## Request

- Base URL: `https://api.neosantara.xyz`
- URL: `https://api.neosantara.xyz/anthropic/v1/messages/count_tokens`
- Auth: HTTP bearer

Count the number of tokens in a message using the Anthropic-compatible API.

## Request body

- object
  - `model` string, required
  - `messages` unknown[], required
    - unknown
  - `system` union
    - string
    - unknown[]
      - unknown
  - `tools` unknown[]
    - unknown
  - `thinking` unknown

## Response `200`

Successful response

- object
  - `input_tokens` integer, required

## Changes

- **2026-11-03** `f87af696a63e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/neosantara/apis/neosantara-ai-api/changes/anthropic/v1/messages/count_tokens/post.md)

---

[API](https://skmtc.dev/neosantara/apis/neosantara-ai-api.md) - [All operations](https://skmtc.dev/neosantara/apis/neosantara-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/neosantara/apis/neosantara-ai-api/revisions/f87af696a63e?raw)
