API Error: Truncated event with using Bedrock Inference Profiles

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 6 comments · opened Mar 3, 2025 · closed May 22, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

Bedrock Application Inference profiles are a great way to track costs between different applications in the same aws account.

Unfortunately, claude code seems to choke when using one :(.

ANTHROPIC_MODEL="arn:aws:bedrock:***:****:application-inference-profile/***" claude --verbose --debug -p hello
 API Error: Truncated event message received.

Is it easy/possible to support these? I assumed the response from bedrock would be the same shape :*(.

View original on GitHub ↗

6 Comments

JamesFincher · 1 year ago

Having the same issue.

clayallsopp · 1 year ago

I think the issue has to do with escaping the ARN - you need to switch the / in the ARN to %2F:

CLAUDE_CODE_USE_BEDROCK=1 DISABLE_PROMPT_CACHING=1 ANTHROPIC_MODEL="arn:aws:bedrock:us-east-1:xxx:application-inference-profile%2Fxxx"

Doing this resolved the issue for me. I opened https://github.com/anthropics/anthropic-sdk-typescript/pull/715 in the underlying library to try to fix more automatically.

lou-k · 1 year ago

@clayallsopp you made my day

thomasgtaylor · 1 year ago

This may not be an issue anymore. On the latest version, I switched from %2F -> /

ant-kurt collaborator · 1 year ago

v0.2.125 onwards added proper handling for /, you should no longer pass %2F in your inference profile ARNs.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.