You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* chore: regenerate SDK client core from gateway OpenAPI spec
* feat: wrap /v1/messages/count_tokens (regenerate core + ergonomic method)
The gateway spec gained POST /v1/messages/count_tokens, which the
endpoint-coverage drift gate flagged as unaccounted-for (CI red on main).
This regenerates the client core to include the count_tokens operation
(absorbs the open codegen PR) and adds a hand-written count_tokens()
ergonomic method to the sync and async shells, mirroring message(). It
returns a typed CountTokensResponse and omits max_tokens, since the
endpoint only counts input tokens. The endpoint is listed under
[covered] in sdk-endpoints.txt and covered by sync + async unit tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: khaledosman <2937633+khaledosman@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Anthropic ``/v1/messages/count_tokens``-compatible endpoint. Returns ``{\"input_tokens\": N}`` without contacting an upstream provider: counting is local, so there is no budget reservation, pricing, or usage logging. Authentication mirrors :func:`create_message` — platform mode resolves the caller's token against the platform, standalone mode validates the API key — so the endpoint is not an open token-counting oracle.
61
+
62
+
:param count_tokens_request: (required)
63
+
:type count_tokens_request: CountTokensRequest
64
+
:param _request_timeout: timeout setting for this request. If one
Anthropic ``/v1/messages/count_tokens``-compatible endpoint. Returns ``{\"input_tokens\": N}`` without contacting an upstream provider: counting is local, so there is no budget reservation, pricing, or usage logging. Authentication mirrors :func:`create_message` — platform mode resolves the caller's token against the platform, standalone mode validates the API key — so the endpoint is not an open token-counting oracle.
129
+
130
+
:param count_tokens_request: (required)
131
+
:type count_tokens_request: CountTokensRequest
132
+
:param _request_timeout: timeout setting for this request. If one
Anthropic ``/v1/messages/count_tokens``-compatible endpoint. Returns ``{\"input_tokens\": N}`` without contacting an upstream provider: counting is local, so there is no budget reservation, pricing, or usage logging. Authentication mirrors :func:`create_message` — platform mode resolves the caller's token against the platform, standalone mode validates the API key — so the endpoint is not an open token-counting oracle.
197
+
198
+
:param count_tokens_request: (required)
199
+
:type count_tokens_request: CountTokensRequest
200
+
:param _request_timeout: timeout setting for this request. If one
0 commit comments