2
0

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 api で使用する

Last updated at Posted at 2025-05-27

公式情報を元に claude code を bedrock で動作させます

install claude code

npm install -g @anthropic-ai/claude-code

aws 認証情報

~/.aws/credential に既に設定済みであれば環境変数への設定は不要
設定する aws アカウントに bedrock の権限を付与する必用があります

環境変数の設定

export CLAUDE_CODE_USE_BEDROCK=1
export DISABLE_PROMPT_CACHING=0

# ここでは us region を指定します
export ANTHROPIC_MODEL=us.anthropic.claude-sonnet-4-20250514-v1:0

# aws 認証情報
export AWS_ACCESS_KEY_ID=dummy_id
export AWS_SECRET_ACCESS_KEY=dummy_key
export AWS_REGION=us-west-2

実行

project dir へ移動し以下を実行

claude

初期化が始まるので完了させます

bedrock の反映確認

以下の様な画面になり, bedrock の model 名などが表示されていれば完了となる

スクリーンショット 2025-05-28 1.00.06.png

cost 確認

対話 interface 内で以下のコマンドで確認できます

/cost 

coalude code cost collector

command での cost 集計ツールを作成してみましたので
ご興味あればご利用ください

以上となります

2
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?