anthropics / anthropics/anthropic-sdk-python

Token counting is not supported in Bedrock yet

Abierto
#1,103 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
3.9k
Forks
853
Merge medio
1 d 11 h
PR fusionados (30 d)
10

Descripción

```python
client = AnthropicBedrock(
aws_access_key=AWS_BEDROCK_ACCESS_KEY,
aws_secret_key=AWS_BEDROCK_SECRET_KEY,
)
client.messages.count_tokens(model="global.anthropic.claude-sonnet-4-5-20250929-v1:0", messages=[{"role": "user", "content": "test"}])
```

**anthropic.AnthropicError: Token counting is not supported in Bedrock yet**

---

The message I get from trying to count tokens using `AnthropicBedrock` is pretty clear. It's not supported.

But docs (https://platform.claude.com/docs/en/api/overview#third-party-platform-apis) says `Token counting` is supported on all 3rd party platform APIs.

That's a bit confusing.

Am I doing something wrong in the sdk?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.