naftiko: 1.0.0-alpha2 info: label: Anthropic Token Counting API — Tokens description: 'Anthropic Token Counting API — Tokens. 1 operation. Lead operation: Count Message Tokens. Self-contained Naftiko capability for counting input tokens on a prospective Messages request without creating it.' tags: - Anthropic - Tokens - Counting created: '2026-05-22' modified: '2026-05-22' binds: - namespace: env keys: ANTHROPIC_API_KEY: ANTHROPIC_API_KEY capability: consumes: - type: http namespace: token-counting-tokens baseUri: https://api.anthropic.com description: Anthropic Token Counting API — count input tokens for any Messages request shape (including tools, images, and documents) without creating the message. Free to use; subject to RPM rate limits. headers: anthropic-version: '2023-06-01' resources: - name: v1-messages-count-tokens path: /v1/messages/count_tokens operations: - name: countmessagetokens method: POST description: Anthropic Count Message Tokens outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Messages request body to count. required: true authentication: type: apikey key: x-api-key value: '{{env.ANTHROPIC_API_KEY}}' placement: header exposes: - type: rest namespace: token-counting-tokens-rest port: 8080 description: REST adapter for Token Counting API. resources: - path: /v1/messages/count_tokens name: v1-messages-count-tokens description: REST surface for token counting. operations: - method: POST name: countmessagetokens description: Anthropic Count Message Tokens call: token-counting-tokens.countmessagetokens with: body: rest.body - type: mcp namespace: token-counting-tokens-mcp port: 9090 transport: http description: MCP adapter for Token Counting API. tools: - name: anthropic-count-message-tokens description: Anthropic Count Message Tokens hints: readOnly: true destructive: false idempotent: true call: token-counting-tokens.countmessagetokens with: body: tools.body