Skip to content
Version: Current

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.

  • Contract version: 1.10.0
  • Contract title: acumen gateway API
  • Source: acumen:docs/openapi/acumen-v1.openapi.json

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 count
    • application/json: TokenCount: TokenCount (object)
  • 400: schema_invalid
    • application/problem+json: Problem: Problem (object)
  • 401: bad_credentials
    • application/problem+json: Problem: Problem (object)
  • 501: not_implemented (the deployed build answers as a completion)
    • application/problem+json: Problem: Problem (object)