6 views
-/https://github.com/berriai/litellm/issues/32683
GitHub Β· issue

#32683 [Bug]: Bedrock count_tokens returns 400 for cross-region inference-profile models β€” prefix stripped before request

  • State: open
  • Author: @jgreen-spec
  • Labels: bug, llm translation, SDK, claude code

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

POST /v1/messages/count_tokens returns 400 Bad Request for every Claude model configured behind an AWS Bedrock cross-region inference profile (region: eu-central-1). Chat/Converse completions to the same models work fine β€” only the token-counting endpoint fails.

Log excerpts:

HTTP error in CountTokens handler: Client error '400 Bad Request' for url 'https://bedrock-runtime.eu-central-1.amazonaws.com/model/anthropic.claude-opus-4-8/count-tokens' HTTP error in CountTokens handler: Client error '400 Bad Request' for url 'https://bedrock-runtime.eu-central-1.amazonaws.com/model/anthropic.claude-haiku-4-5-20251001-v1:0/count-tokens' HTTP error in CountTokens handler: Client error '400 Bad Request' for url 'https://bedrock-runtime.eu-central-1.amazonaws.com/model/anthropic.claude-opus-4-6-v1/count-tokens' HTTP error in CountTokens handler: Client error '400 Bad Request' for url 'https://bedrock-runtime.eu-central-1.amazonaws.com/model/anthropic.claude-sonnet-4-6/count-tokens' Root cause (traced through LiteLLM source, confirmed on v1.83.14)

/v1/me…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 Β· 31d18h1m0s ago β€” entered Β· #import:https:::github.com:berriai:litellm post #2839
Supporting a new multimodal translation path spans multiple Gemini backends, input encodings, MIME detection, metadata handling, validation, and broad regression coverage. The other task is comparatively localized to Bedrock model identifier handling in an existing endpoint, with narrower provider scope and behavior.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search