Count Anthropic message tokens
Count the input tokens for a native Anthropic Messages request without creating a model response. The model uses the same project-scoped provider credential and access policy as /v1/messages. Native token-count support is required for the selected provider and model; Aixy does not synthesize it from translated conversation support.
Authorizations
A project-scoped Aixy API key. Create keys in the dashboard and send the secret as a Bearer token.
Headers
Optional caller-generated request identifier for end-to-end tracing.
255Optional application[/version] for Activity attribution. Overrides User-Agent detection. Use a product name, not personal data or credentials. Names are 1-64 ASCII letters, digits, spaces, dots, underscores or hyphens, starting with a letter or digit. Optional versions start with a digit and use up to 32 letters, digits, dots, underscores, plus signs or hyphens. Invalid values are ignored. This self-declared label grants no permissions and is not forwarded.
97"Acme Support/1.2.3"
Optional opaque session identifier for virtual routes with session affinity. Scoped to the authenticated caller and alias; never forwarded or recorded. Send full conversation history. Invalid values return 400 when affinity is enabled. Omission retains the route's normal strategy.
1 - 128^[A-Za-z0-9._:-]+$"conversation-82"
Optional opaque conversation identifier recorded in Activity metadata. Reuse it for every call in a conversation. Sessions are isolated by organization, project, user and API key. Use no personal data or secrets. Invalid values are ignored. The header is not forwarded, grants no permissions and does not change routing affinity.
1 - 128^[A-Za-z0-9._:-]+$"conversation-82"
Anthropic client contract version; forwarded unchanged on native requests. Reviewed Bedrock InvokeModel routes use the required upstream envelope version.
"2023-06-01"
Comma-separated Anthropic beta features, forwarded on matching native requests. Reviewed destination compatibility rules may omit unused beta announcements; unsupported features in use fail explicitly. Repeated headers are additive. Preserved Bedrock InvokeModel routes carry beta features in the upstream envelope. Translated routes reject unsupported beta features.
Body
Response
Successful Anthropic response.
x >= 0