From 2d2333cfa11512c3f72b50b8ed75ed4e6d510870 Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 13 Nov 2026 04:36:55 +0800 Subject: [PATCH] site: an Amazon Bedrock page in en, zh and ja /docs/bedrock says how magpie's bedrock and bedrock-mantle presets serve Claude, OpenAI's GPT models and other makers' models with one Bedrock API key and no SigV4: adding it, region= (CLI and the editor's Region), the runtime's given list (global. profiles for Claude and GPT, in-region ids for the rest, geography profiles typed in), the API picked per model, Mantle's own model list, in-region ids and two OpenAI prefixes, Claude Code's CLAUDE_CODE_USE_BEDROCK taken out and put back, and the anthropic-beta 400 asked again without the betas. Every claim is from internal/provider/presets.go and provider.go, internal/cli/providers_cli.go (applyPairs' region=), docs/subsystems/providers-accounts.md, gateway-routing.md and agent-wiring.md, with the label's zh and ja from i18n.js. Linked from each language's anthropic page; in the sitemap, llms.txt and llms-full.txt. Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt; node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run): 116 pass, 0 fail. Not tried: a real Bedrock key for this page; it names only what magpie's source and docs say. --- site/public/docs/anthropic.html | 2 + site/public/docs/bedrock.html | 272 +++++++++++++++++++++++++++++ site/public/docs/ja/anthropic.html | 2 + site/public/docs/ja/bedrock.html | 272 +++++++++++++++++++++++++++++ site/public/docs/zh/anthropic.html | 2 + site/public/docs/zh/bedrock.html | 272 +++++++++++++++++++++++++++++ site/public/llms-full.txt | 86 +++++++++ site/public/llms.txt | 1 + site/public/sitemap.xml | 3 + 9 files changed, 912 insertions(+) create mode 100644 site/public/docs/bedrock.html create mode 100644 site/public/docs/ja/bedrock.html create mode 100644 site/public/docs/zh/bedrock.html diff --git a/site/public/docs/anthropic.html b/site/public/docs/anthropic.html index 61d72fdfd..33adf3244 100644 --- a/site/public/docs/anthropic.html +++ b/site/public/docs/anthropic.html @@ -294,6 +294,8 @@ magpie provider add anthropic <key> id=anthropic-ws2 name="Anthropic WS2"
  • Checking a key. magpie provider test anthropic sends a tiny request through each endpoint, or to each model you name. Add --as codex or --as claude-code to send it the way that agent would.
  • +

    Claude on AWS: Amazon Bedrock in Claude Code, Codex and other agents.

    +

    FAQ

    How do I use an Anthropic API key in Claude Code?

    Add your Anthropic API key in magpie (Providers, Add provider, Anthropic), then pick a Claude model such as claude-opus-5-5 on Claude Code’s row, or run magpie claude anthropic/claude-opus-5-5. Claude Code speaks Anthropic Messages, so its requests go to https://api.anthropic.com as it sent them, with what the model would refuse fixed on the way.

    diff --git a/site/public/docs/bedrock.html b/site/public/docs/bedrock.html new file mode 100644 index 000000000..83bc44241 --- /dev/null +++ b/site/public/docs/bedrock.html @@ -0,0 +1,272 @@ + + + + + +Amazon Bedrock in Claude Code and Codex: Claude, GPT, DeepSeek, Kimi and GLM with a Bedrock API key · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +

    Docs · Guide

    +

    Amazon Bedrock in Claude Code, Codex and other agents

    +

    magpie has two Amazon Bedrock presets: bedrock, the Bedrock runtime, and bedrock-mantle, Bedrock's Mantle endpoint. Both take the same Bedrock API key, with no AWS access keys and no SigV4 signing. Once added, Claude Code, Codex, OpenCode and other agents can use Claude, OpenAI's GPT models, and gpt-oss, Qwen, DeepSeek, Kimi, GLM and MiniMax on Bedrock, billed to your AWS account.

    +

    Add it

    +
      +
    1. Get a key.Create a Bedrock API key on the Bedrock page of the AWS console.
    2. +
    3. Add it and pick a region.The default region is us-east-1. Change it in the app's editor under Region, or from the CLI:
    4. +
    +
    Terminal
    magpie provider add bedrock 
    +magpie provider set bedrock region=eu-west-1
    +magpie provider test bedrock
    +

    The runtime preset's regions are us-east-1, us-east-2, us-west-2, eu-central-1, eu-west-1, eu-west-3, ap-northeast-1, ap-southeast-1, ap-southeast-2, ap-south-1. Each has its own Claude (Anthropic Messages), Chat Completions and Responses address, and a change of region moves all three.

    +

    Models

    +

    The Bedrock runtime has no model list to ask, so magpie gives it one:

    +
    • Claude: global.anthropic.claude-opus-5-5, global.anthropic.claude-sonnet-5-5, global.anthropic.claude-haiku-4-5-20251001-v1:0 and more, as global. inference profiles, which every commercial region routes.
    • OpenAI GPT: global.openai.gpt-6-astra, global.openai.gpt-6-sol, global.openai.gpt-6-luna, global. profiles too.
    • Other makers: in-region ids such as openai.gpt-oss-120b-1:0, qwen.qwen3-coder-480b-a35b-v1:0, deepseek.v3.2, moonshotai.kimi-k2.5, zai.glm-5, minimax.minimax-m2.5, which not every region serves (gpt-oss isn't in ap-southeast-1).
    +

    A profile kept in one geography (us., eu., apac., jp., au.) isn't in the list; type it in, as any model of your own is.

    +

    Use it in an agent

    +

    magpie picks Bedrock's API per model: Claude on Anthropic Messages alone, OpenAI's GPT models (not gpt-oss) on Responses first, the rest on Chat Completions. Whatever API an agent speaks, magpie translates, so Codex can use Claude on Bedrock and Claude Code can use GPT there:

    +
    Terminal
    magpie claude bedrock/global.anthropic.claude-sonnet-5-5
    +magpie codex bedrock/global.openai.gpt-6-sol
    +

    Bedrock Mantle

    +

    Mantle is Bedrock's other endpoint (bedrock-mantle.<region>.api.aws), with the same key:

    +
    Terminal
    magpie provider add bedrock-mantle  region=us-west-2
    +magpie provider test bedrock-mantle
    +
    • Unlike the runtime, Mantle lists its models, so the list is your account's own, models only Mantle serves among them.
    • Model ids are in-region ones alone, such as anthropic.claude-sonnet-5 and openai.gpt-oss-120b; there are no global. or us. profiles.
    • Mantle serves its OpenAI APIs under two prefixes: OpenAI's closed GPT models and xAI's Grok at /openai/v1, the rest at /v1. magpie picks per model; when a maker it doesn't know yet is refused, it asks once more at the other prefix and remembers the one that worked.
    • Mantle has 17 regions; the runtime's eu-west-3 has no Mantle.
    +

    Claude Code's CLAUDE_CODE_USE_BEDROCK

    +

    With CLAUDE_CODE_USE_BEDROCK (or _VERTEX, _MANTLE and the like) on, Claude Code goes to that cloud's own endpoint and never reaches magpie. When magpie wires Claude Code in, it takes such a switch out of the settings it writes, keeps its value, and puts it back as written when it steps out, unless you set it again since. The cloud's own variables (AWS_*) stay. When the switch is somewhere magpie doesn't write (the managed settings, ~/.claude.json's env, or the login shell's environment), the Agents page's check names the variable and where it is.

    +

    Notes

    +
    • When Claude Code sends an anthropic-beta Bedrock doesn't take, Bedrock answers 400 "Unexpected value(s) … for the anthropic-beta header". magpie asks again at once without those betas, and leaves them out for that provider from then on.
    • The key goes in x-api-key alone on Claude's API, as Bedrock asks.
    • A custom provider added at a runtime or Mantle address is recognised too, and gets the same rules.
    + +

    FAQ

    +

    Does magpie need AWS access keys for Bedrock?

    +

    No. One Bedrock API key is enough, and magpie does no SigV4 signing. Create it on the Bedrock page of the AWS console.

    +

    Can Claude Code use Claude on Bedrock through magpie?

    +

    Yes. Pick a model such as bedrock/global.anthropic.claude-sonnet-5-5. Leave CLAUDE_CODE_USE_BEDROCK off, or Claude Code goes around magpie; magpie takes it out of the settings it writes.

    +

    Why can't I use some models in my region?

    +

    The global. Claude and GPT profiles are routed in every commercial region; other makers' in-region ids aren't in every region. Pick another region, or type in an id your region serves.

    +

    Bedrock or Bedrock Mantle?

    +

    Both take the same key. The runtime has global. profiles and a given model list; Mantle lists your account's own models, Mantle-only ones included, under in-region ids alone.

    + +

    Related: Anthropic in Claude Code, Codex, Gemini CLI and OpenCode, Google Vertex AI in Claude Code, Codex and other agents. If something fails, see Fixing common errors: 401, 429, 502, 504 and more or ask on Discord.

    +
    +
    + + + + + + + diff --git a/site/public/docs/ja/anthropic.html b/site/public/docs/ja/anthropic.html index 78db1b791..dacba1187 100644 --- a/site/public/docs/ja/anthropic.html +++ b/site/public/docs/ja/anthropic.html @@ -294,6 +294,8 @@ magpie provider add anthropic <key> id=anthropic-ws2 name="Anthropic WS2"
  • キーの確認。magpie provider test anthropic は各エンドポイントに、または指定した各モデルに小さなリクエストを送ります。--as codex や --as claude-code を付けると、そのツールと同じ形で送ります。
  • +

    AWS で Claude を使う:Amazon Bedrock を Claude Code・Codex などのエージェントで使う。

    +

    よくある質問

    Claude Code で Anthropic の API キーを使うには?

    magpie に Anthropic の API キーを追加し(プロバイダ、プロバイダを追加、Anthropic)、Claude Code の行で claude-opus-5-5 などの Claude モデルを選ぶか、magpie claude anthropic/claude-opus-5-5 を実行します。Claude Code は Anthropic Messages を話すので、リクエストは送ったとおりに https://api.anthropic.com へ届き、途中で直すのはモデルが拒否するものだけです。

    diff --git a/site/public/docs/ja/bedrock.html b/site/public/docs/ja/bedrock.html new file mode 100644 index 000000000..27e4c6ec3 --- /dev/null +++ b/site/public/docs/ja/bedrock.html @@ -0,0 +1,272 @@ + + + + + +Amazon Bedrock を Claude Code・Codex で使う:Bedrock API キーで Claude・GPT・DeepSeek・Kimi・GLM · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +

    ドキュメント · ガイド

    +

    Amazon Bedrock を Claude Code・Codex などのエージェントで使う

    +

    magpie には Amazon Bedrock のプリセットが 2 つあります。Bedrock ランタイムの bedrock と、Bedrock の Mantle エンドポイントの bedrock-mantle です。どちらも同じ Bedrock API キーを使い、AWS のアクセスキーや SigV4 署名は不要です。追加すると、Claude Code・Codex・OpenCode などから Bedrock の Claude、OpenAI の GPT、gpt-oss・Qwen・DeepSeek・Kimi・GLM・MiniMax を使え、料金は自分の AWS アカウントに付きます。

    +

    追加する

    +
      +
    1. キーを作る。AWS コンソールの Bedrock ページで Bedrock API キーを作成します。
    2. +
    3. 追加してリージョンを選ぶ。既定は us-east-1 です。アプリのエディターの リージョン で変えるか、CLI で設定します。
    4. +
    +
    ターミナル
    magpie provider add bedrock 
    +magpie provider set bedrock region=eu-west-1
    +magpie provider test bedrock
    +

    ランタイムのリージョンは us-east-1・us-east-2・us-west-2・eu-central-1・eu-west-1・eu-west-3・ap-northeast-1・ap-southeast-1・ap-southeast-2・ap-south-1 です。リージョンごとに Claude(Anthropic Messages)・Chat Completions・Responses のアドレスがあり、リージョンを変えると 3 つとも変わります。

    +

    モデル

    +

    Bedrock ランタイムには問い合わせられるモデル一覧がないため、magpie が一覧を用意しています。

    +
    • Claude:global.anthropic.claude-opus-5-5・global.anthropic.claude-sonnet-5-5・global.anthropic.claude-haiku-4-5-20251001-v1:0 など。global. 推論プロファイルで、すべての商用リージョンがルーティングします。
    • OpenAI GPT:global.openai.gpt-6-astra・global.openai.gpt-6-sol・global.openai.gpt-6-luna。これも global. プロファイルです。
    • ほかの提供元:openai.gpt-oss-120b-1:0・qwen.qwen3-coder-480b-a35b-v1:0・deepseek.v3.2・moonshotai.kimi-k2.5・zai.glm-5・minimax.minimax-m2.5 などのリージョン内 ID。すべてのリージョンにあるとは限りません(ap-southeast-1 には gpt-oss がありません)。
    +

    1 つの地域に限られたプロファイル(us.・eu.・apac.・jp.・au.)は一覧にないので、ほかの自分のモデルと同じように入力します。

    +

    エージェントで使う

    +

    magpie はモデルごとに Bedrock の API を選びます。Claude は Anthropic Messages だけ、OpenAI の GPT(gpt-oss を除く)はまず Responses、残りは Chat Completions です。エージェントがどの API を話しても magpie が変換するので、Codex から Bedrock の Claude を、Claude Code から GPT を使えます。

    +
    ターミナル
    magpie claude bedrock/global.anthropic.claude-sonnet-5-5
    +magpie codex bedrock/global.openai.gpt-6-sol
    +

    Bedrock Mantle

    +

    Mantle は Bedrock のもう 1 つのエンドポイント(bedrock-mantle.<リージョン>.api.aws)で、同じキーを使います。

    +
    ターミナル
    magpie provider add bedrock-mantle  region=us-west-2
    +magpie provider test bedrock-mantle
    +
    • ランタイムと違い Mantle はモデル一覧を返すので、一覧はアカウント自身のもので、Mantle だけのモデルも含まれます。
    • モデル ID はリージョン内のものだけです(anthropic.claude-sonnet-5、openai.gpt-oss-120b など)。global. や us. のプロファイルはありません。
    • Mantle の OpenAI API は 2 つのプレフィックスに分かれます。OpenAI のクローズドな GPT と xAI の Grok は /openai/v1、残りは /v1 です。magpie はモデルごとに選び、まだ知らない提供元が拒否されたらもう一方で 1 回だけ試し、通った方を覚えます。
    • Mantle のリージョンは 17 あり、ランタイムの eu-west-3 には Mantle がありません。
    +

    Claude Code の CLAUDE_CODE_USE_BEDROCK

    +

    CLAUDE_CODE_USE_BEDROCK(や _VERTEX・_MANTLE など)がオンだと、Claude Code はそのクラウドのエンドポイントに直接つなぎ、magpie を通りません。magpie は Claude Code をつなぐとき、自分が書く設定からそのスイッチを外して値を保存し、つなぐのをやめるときに元どおり戻します(その後あなたが設定し直した場合を除く)。AWS_* などクラウド自身の変数はそのままです。magpie が書かない場所(管理設定、~/.claude.json の env、ログインシェルの環境変数)にある場合は、エージェントページのチェックが変数名と場所を示します。

    +

    補足

    +
    • Claude Code が Bedrock の受け付けない anthropic-beta を送ると、Bedrock は 400「Unexpected value(s) … for the anthropic-beta header」を返します。magpie はその beta を外してすぐ送り直し、以後そのプロバイダーには送りません。
    • Claude の API では、Bedrock の求めに合わせてキーを x-api-key だけで送ります。
    • ランタイムや Mantle のアドレスで追加したカスタムプロバイダーも認識され、同じルールが適用されます。
    + +

    よくある質問

    +

    magpie で Bedrock を使うのに AWS アクセスキーは必要ですか?

    +

    不要です。Bedrock API キー 1 つで足り、magpie は SigV4 署名をしません。AWS コンソールの Bedrock ページで作成します。

    +

    Claude Code から magpie 経由で Bedrock の Claude を使えますか?

    +

    使えます。bedrock/global.anthropic.claude-sonnet-5-5 のようなモデルを選びます。CLAUDE_CODE_USE_BEDROCK はオフのままにしてください。オンだと magpie を通りません。magpie は自分が書く設定からそれを外します。

    +

    自分のリージョンで使えないモデルがあるのはなぜ?

    +

    global. の Claude と GPT はすべての商用リージョンでルーティングされますが、ほかの提供元のリージョン内 ID はリージョンによってありません。別のリージョンを選ぶか、そのリージョンにある ID を入力します。

    +

    Bedrock と Bedrock Mantle のどちらを使う?

    +

    キーは同じです。ランタイムには global. プロファイルと用意済みの一覧があり、Mantle はアカウント自身のモデル(Mantle 限定のものを含む)をリージョン内 ID だけで返します。

    + +

    関連ページ:Anthropic を Claude Code・Codex・Gemini CLI・OpenCode で使う、Google Vertex AI を Claude Code・Codex などのエージェントで使う。エラーが出たら よくあるエラーの直し方:401・429・502・504 など を見るか、Discord で質問してください。

    +
    +
    + + + + + + + diff --git a/site/public/docs/zh/anthropic.html b/site/public/docs/zh/anthropic.html index 6bcd96ffc..dcca45ab0 100644 --- a/site/public/docs/zh/anthropic.html +++ b/site/public/docs/zh/anthropic.html @@ -294,6 +294,8 @@ magpie provider add anthropic <key> id=anthropic-ws2 name="Anthropic WS2"
  • 检查 Key。magpie provider test anthropic 会向每个接口发一个很小的请求,或者发给你指定的每个模型。加上 --as codex 或 --as claude-code,就按那个工具的方式发送。
  • +

    在 AWS 上用 Claude:Amazon Bedrock 接入 Claude Code、Codex 等 Agent。

    +

    常见问题

    怎么在 Claude Code 里用 Anthropic API Key?

    在 magpie 里添加 Anthropic API Key(供应商、添加供应商、Anthropic),然后在 Claude Code 那一行选一个 Claude 模型,比如 claude-opus-5-5,或者运行 magpie claude anthropic/claude-opus-5-5。Claude Code 说的是 Anthropic Messages,所以请求按它发出的样子发到 https://api.anthropic.com,只在路上修掉模型会拒绝的内容。

    diff --git a/site/public/docs/zh/bedrock.html b/site/public/docs/zh/bedrock.html new file mode 100644 index 000000000..baddbcc7d --- /dev/null +++ b/site/public/docs/zh/bedrock.html @@ -0,0 +1,272 @@ + + + + + +Amazon Bedrock 接入 Claude Code、Codex:用 Bedrock API Key 调用 Claude、GPT、DeepSeek、Kimi 和 GLM · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +

    文档 · 指南

    +

    Amazon Bedrock 接入 Claude Code、Codex 等 Agent

    +

    magpie 有两个 Amazon Bedrock 预设:bedrock(Bedrock 运行时)和 bedrock-mantle(Bedrock 的 Mantle 端点)。两者用同一个 Bedrock API Key,不需要 AWS 访问密钥和 SigV4 签名。接好之后,Claude Code、Codex、OpenCode 等 Agent 都能用 Bedrock 上的 Claude、OpenAI GPT,以及 gpt-oss、Qwen、DeepSeek、Kimi、GLM、MiniMax 等模型,费用记在你的 AWS 账号上。

    +

    添加

    +
      +
    1. 拿到 Key。在 AWS 控制台的 Bedrock 页面创建一个 Bedrock API Key。
    2. +
    3. 添加并选区域。默认区域是 us-east-1,在应用的编辑器里用 区域 换,或者在命令行设置:
    4. +
    +
    终端
    magpie provider add bedrock 
    +magpie provider set bedrock region=eu-west-1
    +magpie provider test bedrock
    +

    运行时预设的区域有 us-east-1、us-east-2、us-west-2、eu-central-1、eu-west-1、eu-west-3、ap-northeast-1、ap-southeast-1、ap-southeast-2、ap-south-1。每个区域都有自己的 Claude(Anthropic Messages)、Chat Completions 和 Responses 地址,换区域时三个一起换。

    +

    模型

    +

    Bedrock 运行时没有可以查询的模型列表,所以 magpie 预设了一组模型:

    +
    • Claude:global.anthropic.claude-opus-5-5、global.anthropic.claude-sonnet-5-5、global.anthropic.claude-haiku-4-5-20251001-v1:0 等,用的是 global. 推理配置,所有商业区域都能转发。
    • OpenAI GPT:global.openai.gpt-6-astra、global.openai.gpt-6-sol、global.openai.gpt-6-luna,同样是 global. 推理配置。
    • 其他厂商:openai.gpt-oss-120b-1:0、qwen.qwen3-coder-480b-a35b-v1:0、deepseek.v3.2、moonshotai.kimi-k2.5、zai.glm-5、minimax.minimax-m2.5 等区域内 id,并不是每个区域都有(比如 ap-southeast-1 没有 gpt-oss)。
    +

    限定在某个地区的推理配置(us.、eu.、apac.、jp.、au. 开头)不在预设里,需要手动填入,和其他自填的模型一样。

    +

    给 Agent 用

    +

    magpie 按模型选 Bedrock 的 API:Claude 只走 Anthropic Messages,OpenAI 的 GPT(不含 gpt-oss)优先走 Responses,其余走 Chat Completions。Agent 说哪种 API 都可以,magpie 负责转换,所以 Codex 也能用 Bedrock 上的 Claude,Claude Code 也能用 Bedrock 上的 GPT:

    +
    终端
    magpie claude bedrock/global.anthropic.claude-sonnet-5-5
    +magpie codex bedrock/global.openai.gpt-6-sol
    +

    Bedrock Mantle

    +

    Mantle 是 Bedrock 的另一个端点(bedrock-mantle.<区域>.api.aws),用同一个 Key:

    +
    终端
    magpie provider add bedrock-mantle  region=us-west-2
    +magpie provider test bedrock-mantle
    +
    • 和运行时不同,Mantle 能列出模型,所以模型列表就是你账号自己的,包括只在 Mantle 上的模型。
    • 模型 id 只用区域内的,比如 anthropic.claude-sonnet-5、openai.gpt-oss-120b,没有 global. 或 us. 推理配置。
    • Mantle 的 OpenAI 接口按模型分在两个前缀下:OpenAI 闭源 GPT 和 xAI 的 Grok 在 /openai/v1,其余在 /v1。magpie 按模型自动选;遇到它还不认识的厂商被拒时,会换另一个前缀再试一次,成功就记住。
    • Mantle 有 17 个区域,运行时的 eu-west-3 没有 Mantle。
    +

    Claude Code 的 CLAUDE_CODE_USE_BEDROCK

    +

    Claude Code 打开 CLAUDE_CODE_USE_BEDROCK(或 _VERTEX、_MANTLE 等)时,会直接连那家云的端点,不经过 magpie。magpie 接管 Claude Code 时,会把它写入的设置里打开的这类开关拿掉并保存原值,退出接管时按原样放回(除非你之后又改过)。AWS_* 这类云自己的变量不会动。开关写在 magpie 不写的地方(托管设置、~/.claude.json 的 env 或登录 shell 的环境变量)时,Agent 页的检查会指出是哪个变量、在哪里。

    +

    几点说明

    +
    • Claude Code 发出 Bedrock 不认的 anthropic-beta 时,Bedrock 会回 400 “Unexpected value(s) … for the anthropic-beta header”。magpie 会立刻去掉这些 beta 重发,之后对这个供应商也不再发。
    • Key 只放在 x-api-key 里发给 Claude 的接口,这是 Bedrock 的要求。
    • 已经有运行时或 Mantle 地址的自定义供应商,magpie 也会认出来,按同样的规则处理。
    + +

    常见问题

    +

    magpie 接 Bedrock 需要 AWS Access Key 吗?

    +

    不需要。只要一个 Bedrock API Key,magpie 不做 SigV4 签名。在 AWS 控制台的 Bedrock 页面创建即可。

    +

    Claude Code 能通过 magpie 用 Bedrock 上的 Claude 吗?

    +

    能。选 bedrock/global.anthropic.claude-sonnet-5-5 这样的模型即可。不要再打开 CLAUDE_CODE_USE_BEDROCK,否则 Claude Code 会绕过 magpie;magpie 接管时会把它写入的设置里的这个开关拿掉。

    +

    为什么有的模型在我的区域用不了?

    +

    global. 开头的 Claude 和 GPT 在所有商业区域都能转发;其他厂商的区域内 id 不是每个区域都有。换一个区域,或手动填入你区域有的模型 id。

    +

    Bedrock 和 Bedrock Mantle 选哪个?

    +

    都用同一个 Key。运行时有 global. 推理配置和预设的模型列表;Mantle 能列出账号自己的模型,包括只在 Mantle 上的,但只用区域内 id。

    + +

    相关页面:Anthropic 接入 Claude Code、Codex、Gemini CLI 和 OpenCode、Google Vertex AI 接入 Claude Code、Codex 等 Agent。遇到错误请看 常见错误排查:401、429、502、504 等,或者到 Discord 提问。

    +
    +
    + + + + + + + diff --git a/site/public/llms-full.txt b/site/public/llms-full.txt index 643d4fc96..af967fc6f 100644 --- a/site/public/llms-full.txt +++ b/site/public/llms-full.txt @@ -3264,6 +3264,8 @@ magpie provider add anthropic id=anthropic-ws2 name="Anthropic WS2" header - **“this is an Anthropic API key, not a setup-token”..** The key went to the Claude subscription’s sign-in. Add it as the Anthropic provider instead. - **Checking a key..** `magpie provider test anthropic` sends a tiny request through each endpoint, or to each model you name. Add `--as codex` or `--as claude-code` to send it the way that agent would. +Claude on AWS: [Amazon Bedrock in Claude Code, Codex and other agents](https://usemagpie.ai/docs/bedrock). + ## FAQ ### How do I use an Anthropic API key in Claude Code? @@ -9464,6 +9466,90 @@ Related: [Gemini in Claude Code, Codex, Gemini CLI and OpenCode](https://usemagp --- +Source: https://usemagpie.ai/docs/bedrock + +# Amazon Bedrock in Claude Code, Codex and other agents + +magpie has two Amazon Bedrock presets: `bedrock`, the Bedrock runtime, and `bedrock-mantle`, Bedrock's Mantle endpoint. Both take the same Bedrock API key, with no AWS access keys and no SigV4 signing. Once added, Claude Code, Codex, OpenCode and other agents can use Claude, OpenAI's GPT models, and gpt-oss, Qwen, DeepSeek, Kimi, GLM and MiniMax on Bedrock, billed to your AWS account. + +## Add it + +1. **Get a key..** Create a Bedrock API key on the Bedrock page of the AWS console. +2. **Add it and pick a region..** The default region is us-east-1. Change it in the app's editor under Region, or from the CLI: + +``` +magpie provider add bedrock +magpie provider set bedrock region=eu-west-1 +magpie provider test bedrock +``` + +The runtime preset's regions are us-east-1, us-east-2, us-west-2, eu-central-1, eu-west-1, eu-west-3, ap-northeast-1, ap-southeast-1, ap-southeast-2, ap-south-1. Each has its own Claude (Anthropic Messages), Chat Completions and Responses address, and a change of region moves all three. + +## Models + +The Bedrock runtime has no model list to ask, so magpie gives it one: + +- Claude: `global.anthropic.claude-opus-5-5`, `global.anthropic.claude-sonnet-5-5`, `global.anthropic.claude-haiku-4-5-20251001-v1:0` and more, as global. inference profiles, which every commercial region routes. +- OpenAI GPT: `global.openai.gpt-6-astra`, `global.openai.gpt-6-sol`, `global.openai.gpt-6-luna`, global. profiles too. +- Other makers: in-region ids such as `openai.gpt-oss-120b-1:0`, `qwen.qwen3-coder-480b-a35b-v1:0`, `deepseek.v3.2`, `moonshotai.kimi-k2.5`, `zai.glm-5`, `minimax.minimax-m2.5`, which not every region serves (gpt-oss isn't in ap-southeast-1). + +A profile kept in one geography (`us.`, `eu.`, `apac.`, `jp.`, `au.`) isn't in the list; type it in, as any model of your own is. + +## Use it in an agent + +magpie picks Bedrock's API per model: Claude on Anthropic Messages alone, OpenAI's GPT models (not gpt-oss) on Responses first, the rest on Chat Completions. Whatever API an agent speaks, magpie translates, so Codex can use Claude on Bedrock and Claude Code can use GPT there: + +``` +magpie claude bedrock/global.anthropic.claude-sonnet-5-5 +magpie codex bedrock/global.openai.gpt-6-sol +``` + +## Bedrock Mantle + +Mantle is Bedrock's other endpoint (`bedrock-mantle..api.aws`), with the same key: + +``` +magpie provider add bedrock-mantle region=us-west-2 +magpie provider test bedrock-mantle +``` + +- Unlike the runtime, Mantle lists its models, so the list is your account's own, models only Mantle serves among them. +- Model ids are in-region ones alone, such as `anthropic.claude-sonnet-5` and `openai.gpt-oss-120b`; there are no `global.` or `us.` profiles. +- Mantle serves its OpenAI APIs under two prefixes: OpenAI's closed GPT models and xAI's Grok at `/openai/v1`, the rest at `/v1`. magpie picks per model; when a maker it doesn't know yet is refused, it asks once more at the other prefix and remembers the one that worked. +- Mantle has 17 regions; the runtime's eu-west-3 has no Mantle. + +## Claude Code's CLAUDE_CODE_USE_BEDROCK + +With `CLAUDE_CODE_USE_BEDROCK` (or `_VERTEX`, `_MANTLE` and the like) on, Claude Code goes to that cloud's own endpoint and never reaches magpie. When magpie wires Claude Code in, it takes such a switch out of the settings it writes, keeps its value, and puts it back as written when it steps out, unless you set it again since. The cloud's own variables (`AWS_*`) stay. When the switch is somewhere magpie doesn't write (the managed settings, `~/.claude.json`'s env, or the login shell's environment), the Agents page's check names the variable and where it is. + +## Notes + +- When Claude Code sends an `anthropic-beta` Bedrock doesn't take, Bedrock answers 400 "Unexpected value(s) … for the anthropic-beta header". magpie asks again at once without those betas, and leaves them out for that provider from then on. +- The key goes in `x-api-key` alone on Claude's API, as Bedrock asks. +- A custom provider added at a runtime or Mantle address is recognised too, and gets the same rules. + +## FAQ + +### Does magpie need AWS access keys for Bedrock? + +No. One Bedrock API key is enough, and magpie does no SigV4 signing. Create it on the Bedrock page of the AWS console. + +### Can Claude Code use Claude on Bedrock through magpie? + +Yes. Pick a model such as bedrock/global.anthropic.claude-sonnet-5-5. Leave CLAUDE_CODE_USE_BEDROCK off, or Claude Code goes around magpie; magpie takes it out of the settings it writes. + +### Why can't I use some models in my region? + +The global. Claude and GPT profiles are routed in every commercial region; other makers' in-region ids aren't in every region. Pick another region, or type in an id your region serves. + +### Bedrock or Bedrock Mantle? + +Both take the same key. The runtime has global. profiles and a given model list; Mantle lists your account's own models, Mantle-only ones included, under in-region ids alone. + +Related: [Anthropic in Claude Code, Codex, Gemini CLI and OpenCode](https://usemagpie.ai/docs/anthropic), [Google Vertex AI in Claude Code, Codex and other agents](https://usemagpie.ai/docs/vertex). If something fails, see [Fixing common errors: 401, 429, 502, 504 and more](https://usemagpie.ai/docs/troubleshooting) or ask on [Discord](https://discord.gg/vGSnD3ZKQF). + +--- + Source: https://usemagpie.ai/docs/library # Library diff --git a/site/public/llms.txt b/site/public/llms.txt index 13f1d8cda..c5df9464c 100644 --- a/site/public/llms.txt +++ b/site/public/llms.txt @@ -143,6 +143,7 @@ DeepSeek, Kimi (Moonshot), GLM (Zhipu), Qwen, MiniMax, Anthropic (Claude), OpenA - [Image recognition and generation for any model](https://usemagpie.ai/docs/images): an Image recognition model describes images for models that can't see; analyze_image MCP server; Magpie Image generates images and videos into the project - [Token usage and cost per agent](https://usemagpie.ai/docs/usage): tokens and cost per agent, model, account and session; magpie usage --csv; magpie model price for a relay's real price; Claude Code status line; /v1/magpie/usage - [Google Vertex AI in Claude Code, Codex and other agents](https://usemagpie.ai/docs/vertex): Gemini, Claude and partner models (DeepSeek, GLM, gpt-oss) from your own Google Cloud project, signed with gcloud credentials or a service account, no API key; models per location, Model Garden, PayGo headers and common errors. +- [Amazon Bedrock in Claude Code, Codex and other agents](https://usemagpie.ai/docs/bedrock): the bedrock and bedrock-mantle presets with one Bedrock API key and no SigV4; regions, global inference profiles for Claude and GPT, other makers' in-region ids, Mantle's own model list, and CLAUDE_CODE_USE_BEDROCK. - [Library](https://usemagpie.ai/docs/library): instructions, MCP servers, skills, hooks and subagents for each agent. - [MCP router](https://usemagpie.ai/docs/mcp-router): one magpie MCP server per agent. - [Remote magpie](https://usemagpie.ai/docs/remote): use one magpie from several computers. diff --git a/site/public/sitemap.xml b/site/public/sitemap.xml index befe3e520..83bb2d2ff 100644 --- a/site/public/sitemap.xml +++ b/site/public/sitemap.xml @@ -95,6 +95,7 @@ https://usemagpie.ai/docs/images https://usemagpie.ai/docs/usage https://usemagpie.ai/docs/vertex +https://usemagpie.ai/docs/bedrock https://usemagpie.ai/docs/local-models https://usemagpie.ai/docs/opencode-models https://usemagpie.ai/docs/alternatives @@ -211,6 +212,7 @@ https://usemagpie.ai/docs/zh/images https://usemagpie.ai/docs/zh/usage https://usemagpie.ai/docs/zh/vertex +https://usemagpie.ai/docs/zh/bedrock https://usemagpie.ai/docs/zh/local-models https://usemagpie.ai/docs/zh/opencode-models https://usemagpie.ai/docs/zh/alternatives @@ -326,6 +328,7 @@ https://usemagpie.ai/docs/ja/images https://usemagpie.ai/docs/ja/usage https://usemagpie.ai/docs/ja/vertex +https://usemagpie.ai/docs/ja/bedrock https://usemagpie.ai/docs/ja/local-models https://usemagpie.ai/docs/ja/opencode-models https://usemagpie.ai/docs/ja/alternatives