Version: Current
Historical release snapshot. These docs are frozen. Read current docs.
POST /v1/messages/count_tokens
Part of the API reference; this page is generated from the OpenAPI document that the gateway builds from its own route tables.
Provenance
Section titled “Provenance”- Contract version:
1.10.0 - Contract title: acumen gateway API
- Source:
acumen:docs/openapi/acumen-v1.openapi.json
Operations
Section titled “Operations”POST /v1/messages/count_tokens
Section titled “POST /v1/messages/count_tokens”Count tokens (declared; answers as a door in this build)
Declared as a token-count endpoint. In the deployed build it is served by the shared door and answers with a completion object instead of a token count — a known defect tracked in docs/API.md. The OpenAPI entry documents the intended contract: 200 with {input_tokens}; do not rely on the deployed shape until the endpoint owner lands the handler.
- Operation id:
postV1MessagesCountTokens - Scope:
chat - Exposure:
public - Mutating: no
- Auth:
bearerAuth,apiKeyAuth
Request
- Request body (application/json, required):
CountTokensRequest: CountTokensRequest (object)
| Field | Type | Required | Notes |
|---|---|---|---|
messages |
array of object | yes | |
model |
string | yes |
Responses
200: the intended contract: the input token countapplication/json:TokenCount: TokenCount (object)
400: schema_invalidapplication/problem+json:Problem: Problem (object)
401: bad_credentialsapplication/problem+json:Problem: Problem (object)
501: not_implemented (the deployed build answers as a completion)application/problem+json:Problem: Problem (object)