|
Hi, Wrapping Claude CLI with Bedrock seems to work as far as I understand, but I couldn't get the Agent SDK (against Bedrock) to work with headroom proxy. Environment
Jochen Mehlhorn jochen.mehlhorn@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH |
Replies: 2 comments
|
Short answer: yes, it should work the same way as the Claude Code CLI recipe, and the reason is worth knowing since it explains why it wasn't working for you. The Agent SDK doesn't talk to Bedrock (or Anthropic, or Headroom) on its own — it spawns the actual The repo has a doc for exactly this setup at If that's set to 1 (or unset with some other Bedrock-mode flag active), Claude Code calls Bedrock directly via the AWS SDK and completely bypasses So for the Agent SDK, set (either via the process env or with the proxy itself started in Bedrock mode: If it's still not routing through the proxy after that, check the proxy's dashboard/ |
|
Thanks @yehudaLevy. Your answer clarifies why it did not work at first for me. |
Short answer: yes, it should work the same way as the Claude Code CLI recipe, and the reason is worth knowing since it explains why it wasn't working for you.
The Agent SDK doesn't talk to Bedrock (or Anthropic, or Headroom) on its own — it spawns the actual
claudeCLI binary as a subprocess and passes through your process's environment (seesubprocess_cli.pyinclaude-agent-sdk-python, it mergesos.environwith anything you set viaClaudeAgentOptions.env). So whatever env vars make the CLI recipe work will make the SDK work too, since under the hood it's still the CLI making the request.The repo has a doc for exactly this setup at
docs/claude-code-bedrock-headroom.md, and the key gotcha…