2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Claude Code で Bedrock を使う方法(ap-northeast-1)

Last updated at Posted at 2025-07-02

環境変数を以下のように設定して claude コマンドを実行する。

export AWS_REGION=ap-northeast-1
export AWS_PROFILE=default
export CLAUDE_CODE_USE_BEDROCK=1
export ANTHROPIC_MODEL='apac.anthropic.claude-3-7-sonnet-20250219-v1:0'
export ANTHROPIC_SMALL_FAST_MODEL='apac.anthropic.claude-3-haiku-20240307-v1:0'

ポイントとしてはモデル ID ではなく推論プロファイル ID を指定する点。

ap-northeast-1 の場合、モデル ID の先頭に apac. を付け加えれば推論プロファイル ID になる模様。ちゃんと確認したい場合は aws bedrock list-inference-profiles で確認できます。

モデル ID を指定した場合のエラー(検索用)

API Error (anthropic.claude-3-7-sonnet-20250219-v1:0): 400 Invocation of model ID anthropic.claude-3-7-sonnet-20250219-v1:0 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an inference profile that contains this model.
API Error (anthropic.claude-sonnet-4-20250514-v1:0): 400 Invocation of model ID anthropic.claude-sonnet-4-20250514-v1:0 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an inference profile that contains this model.

参考

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?