DEV Community

Manu Shukla
Manu Shukla

Posted on • Originally published at ecorpit.com

Connect Claude Code, Cursor and Codex to Amazon Bedrock's new console (2026)

Connect Claude Code, Cursor and Codex to Amazon Bedrock's new console (2026)

Summary. On 5 June 2026 AWS launched a new Amazon Bedrock console built on a new inference engine called the bedrock-mantle endpoint, and it changes how you standardise AI coding agents. The console lets you connect five agents, Claude Code, Cline, Codex, Cursor and OpenCode, to GPT, Claude and open-weight models through one endpoint, using either your AWS IAM credentials or a Bedrock API key. It speaks the OpenAI Responses API, the OpenAI Chat Completions API and the Anthropic Messages API, so an OpenAI-style agent and an Anthropic-style agent both work without a proxy. You can compare up to 3 models side by side, and the endpoint is live in 13 AWS Regions including Mumbai. The commercial reason to route agents this way is control: Claude Sonnet costs $3 per million input tokens and $15 per million output tokens on Bedrock, a 5x gap between input and output, and centralising the traffic gives you one place for IAM, cost and audit. The endpoint exposes 3 API surfaces across 2 vendors, and Claude Code added a guided setup wizard in April 2026 (version 2.1.92). This guide covers the prerequisites, both authentication methods, and the exact steps to wire Claude Code, then Cursor and Codex, through Bedrock.

What the new Bedrock console changes

Amazon Bedrock's new console is a redesigned workflow for finding a model and moving from evaluation to production on the bedrock-mantle endpoint. Three things are new. A model card lets you browse the full catalogue and compare capabilities, context window, pricing and Regional availability in one view. Project-based work groups evaluations and usage insights around the lifecycle of an application. And live documentation prefills code samples with your project's model ID, Region and endpoint URL, so you can copy a snippet and run it without editing.

The older console is still there for the fully managed features, and this is the split that matters. Agents, Knowledge Bases, Guardrails, fine-tuning, and the InvokeModel and Converse APIs continue to run on the bedrock-runtime endpoint. The new bedrock-mantle endpoint is the one that speaks OpenAI- and Anthropic-compatible APIs and is built for connecting external coding agents. As AWS Principal Developer Advocate Channy Yun described it, the engine is "built for high performance, reliability, and security." If you already build agents with the managed stack, our guide to Amazon Bedrock AgentCore covers that path; this one is about pointing your existing IDE agents at Bedrock.

Before you start: IAM, Regions and the first-use form

Three prerequisites save you a broken first request. First, permissions: the agent's identity needs an IAM policy that can invoke Bedrock models and list inference profiles. IAM is doing the real work here, letting you control which people and services can call which models at team or organisation scope, with CloudTrail capturing every invocation for audit. Second, Region: AWS_REGION is required, and Claude Code in particular does not read the Region from your .aws config file, so you set it explicitly. The bedrock-mantle endpoint is available in US East (N. Virginia, Ohio), US West (Oregon), Asia Pacific (Jakarta, Mumbai, Sydney, Tokyo), Europe (Frankfurt, Ireland, London, Milan, Stockholm) and South America (São Paulo). Third, for Anthropic models you complete a one-time First Time Use form before the first call; skip it and early calls may pass, then start failing with a 403.

For authentication you pick one of two paths, and the right choice depends on whether the identity is a developer or a service.

Method Best for How it works
AWS IAM credentials Developers and CI already on AWS Uses the default AWS SDK credential chain: aws configure, access keys, or IAM Identity Center SSO
Bedrock API key Agents that expect a single API key A Bedrock-issued key passed like an OpenAI or Anthropic key, scoped by IAM behind the scenes

Use IAM or SSO where you can, because it avoids long-lived keys and keeps every call attributable. Use a Bedrock API key where a tool only accepts a single key string. Either way, keep traffic on a VPC endpoint so it does not leave your private network.

Step 1: Connect Claude Code (Anthropic Messages API)

Claude Code talks the Anthropic Messages API, and Bedrock speaks it natively. Set two environment variables and let the AWS SDK handle credentials:

export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=ap-south-1
# optional: pin a model by its Bedrock inference profile ID
export ANTHROPIC_MODEL=<your-inference-profile-id>
Enter fullscreen mode Exit fullscreen mode

If you prefer file config, put the same values in ~/.claude/settings.json:

{
  "env": {
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "AWS_REGION": "ap-south-1"
  }
}
Enter fullscreen mode Exit fullscreen mode

Then authenticate the way you already do on AWS, with aws configure, environment keys, or SSO through IAM Identity Center. Since April 2026 (Claude Code v2.1.92) there is also an interactive wizard: run /setup-bedrock to configure the connection in a guided dialog rather than setting variables by hand. Copy the exact inference profile ID for the model you want from the console's model card, rather than guessing a model string.

Step 2: Connect Cursor, Codex and the OpenAI-style agents

Cursor and Codex expect an OpenAI-compatible endpoint, which is exactly what bedrock-mantle exposes through the OpenAI Responses and Chat Completions APIs. In the new console, open a project, choose Getting started, then Clients, and select your agent (Claude Code, Cline, Codex, Cursor or OpenCode). The console generates the install command, the environment variables, the exact endpoint URL, the model ID and the API key reference for that agent. Copy those values rather than hand-writing the hostname, because the console prefills them for your Region and model.

The shape is the familiar OpenAI base-URL override:

# values are generated for you in the console's Clients tab
export OPENAI_BASE_URL="<bedrock-mantle-endpoint-url>"
export OPENAI_API_KEY="<your-bedrock-api-key>"
# then point the agent at the model ID shown on the model card
Enter fullscreen mode Exit fullscreen mode

Cline and OpenCode follow the same pattern and can use either IAM credentials or a Bedrock API key. The point of doing it through the console is that the generated snippet already matches your project, so a mismatched Region or model ID does not silently break the first call.

Which agent speaks which protocol

The five supported agents split across the two API families. This is the quick reference for who talks what.

Coding agent API protocol on Bedrock Auth options Notes
Claude Code Anthropic Messages API IAM or Bedrock API key CLAUDE_CODE_USE_BEDROCK=1, AWS_REGION required
Cursor OpenAI-compatible Bedrock API key Override the OpenAI base URL
Codex OpenAI Responses API IAM or Bedrock API key Uses the Responses API surface
Cline OpenAI or Anthropic IAM or Bedrock API key Works with either family
OpenCode OpenAI or Anthropic IAM or Bedrock API key Console generates the snippet

Governance: cost, audit and guardrails

Routing every agent through one endpoint is worth the setup because it centralises the three things platform teams care about. Cost is visible per model: the model card shows input and output token pricing before you commit, and for reference Claude Sonnet is $3 per million input tokens and $15 per million output tokens on Bedrock, with a 5x gap between input and output that matters for code generation. Audit is automatic: CloudTrail records every invocation, and the project dashboard shows tokens per minute and requests per minute so you can spot a runaway agent. Control is per-identity: IAM decides which team can call which model, and Guardrails on the managed bedrock-runtime endpoint can screen content where you need it. For deciding which model each workload should use, our LLM hybrid routing and API-spend framework and our note on Claude Code token cost in production go deeper.

India and global considerations

For Indian teams and global capability centres, the Mumbai Region (ap-south-1) support means agent traffic and logs can stay in-country, which matters for data-residency expectations under the Digital Personal Data Protection Act, 2023. Keep the bedrock-mantle calls on a VPC endpoint, scope IAM to the smallest set of models a team needs, and use CloudTrail as the audit record. The token math is the same everywhere, but running inference in-Region cuts latency for developers in India and keeps the data path simple. Teams isolating agent workloads across clouds can also read our guide to agent session isolation on AWS, Azure and Google.

Common setup errors

Three failures account for most broken first connections. A 403 that appears after a few successful calls almost always means the Anthropic First Time Use form was not completed; fill it in once and the errors stop. An immediate credential or Region error usually means AWS_REGION is not set, because Claude Code does not fall back to your .aws config for the Region; export it explicitly. And a model-not-found error normally comes from a hand-typed model string, so copy the exact inference profile ID from the console's model card instead of guessing.

Two more are worth knowing. If an OpenAI-style agent like Cursor returns auth errors, check that the base URL points at the bedrock-mantle endpoint the console generated for your Region, not a global default, and that the Bedrock API key is scoped by IAM to the model you selected. If calls work locally but fail in CI, the runner is missing the IAM role or key that your laptop has through SSO; give the pipeline its own scoped identity rather than sharing a personal one.

FAQ

What is the new Amazon Bedrock console?

It is a redesigned Bedrock console, launched on 5 June 2026, that runs on the bedrock-mantle endpoint. It adds a model card for side-by-side comparison, project-based evaluation, and live documentation with prefilled code. It speaks the OpenAI Responses, OpenAI Chat Completions and Anthropic Messages APIs, so external coding agents can connect directly.

Which coding agents can connect to Bedrock Mantle?

Five are supported directly in the console's Clients flow: Claude Code, Cline, Codex, Cursor and OpenCode. The console generates the install command, environment variables, endpoint URL and model ID for each. Claude Code uses the Anthropic Messages API, while Cursor and Codex use the OpenAI-compatible Responses and Chat Completions APIs.

How do I point Claude Code at Amazon Bedrock?

Set CLAUDE_CODE_USE_BEDROCK=1 and AWS_REGION, then authenticate with the default AWS credential chain through aws configure or IAM Identity Center SSO. AWS_REGION is required because Claude Code does not read it from the .aws file. Since April 2026 you can also run the /setup-bedrock wizard to configure it interactively.

Do I need an API key or can I use IAM?

Both work. Use AWS IAM credentials or IAM Identity Center SSO when the identity already lives on AWS, which avoids long-lived keys and keeps calls attributable through CloudTrail. Use a Bedrock API key when a tool only accepts a single key string, such as an OpenAI base-URL override. IAM still scopes the key behind the scenes.

What does it cost to run coding agents on Bedrock?

You pay per token at each model's rate. Claude Sonnet is $3 per million input tokens and $15 per million output tokens on Bedrock, and the model card shows each model's price before you commit. The 5x gap between input and output means output-heavy code generation drives most of the bill, so monitor tokens per request.

Why route agents through Bedrock instead of direct APIs?

Centralising traffic gives one place for identity, cost and audit. IAM controls which team can call which model, CloudTrail logs every invocation, and the project dashboard surfaces token and request rates. You also keep data on a VPC endpoint inside your network, which is harder to guarantee when each developer calls a vendor API directly.

Is the new console available in India?

Yes. The bedrock-mantle endpoint is live in the Mumbai Region, ap-south-1, among 13 Regions worldwide. Running inference in-Region keeps agent traffic and logs in-country, which supports data-residency expectations under the DPDP Act, and it lowers latency for developers working from India compared with a distant Region.

What still runs on the old Bedrock endpoint?

The fully managed features stay on the bedrock-runtime endpoint: Agents, Knowledge Bases, Guardrails, fine-tuning, and the InvokeModel and Converse APIs. The new bedrock-mantle endpoint is the OpenAI- and Anthropic-compatible surface for connecting external coding agents. You can use both together from the same account.

How eCorpIT can help

eCorpIT is a Gurugram-based, senior-led engineering organisation that has built cloud and AI infrastructure for teams since 2021. We help platform teams standardise AI coding agents on Amazon Bedrock: IAM and SSO setup, VPC-endpoint routing, per-team model access, CloudTrail-based audit, and cost dashboards, designed aligned with DPDP data-residency expectations. See our private LLM deployment service and AI evals and observability service, or contact us to plan a rollout.

References

  1. AWS News Blog (Channy Yun), "Try the new console experience in Amazon Bedrock, optimized for Anthropic- and OpenAI-compatible APIs," 5 June 2026: https://aws.amazon.com/blogs/aws/try-the-new-console-experience-in-amazon-bedrock-optimized-for-anthropic-and-openai-compatible-apis/
  2. Claude Code documentation, "Claude Code on Amazon Bedrock": https://code.claude.com/docs/en/amazon-bedrock
  3. AWS, "Amazon Bedrock pricing": https://aws.amazon.com/bedrock/pricing/
  4. AWS documentation, "Model support by AWS Region": https://docs.aws.amazon.com/bedrock/latest/userguide/models-region-compatibility.html
  5. AWS Solutions Library, "Guidance for Claude Code with Amazon Bedrock": https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock
  6. Price Per Token, "Claude Sonnet 4.6 API pricing 2026": https://pricepertoken.com/pricing-page/model/anthropic-claude-sonnet-4.6
  7. bespinian, "Using Claude Code on AWS Bedrock": https://bespinian.io/en/claude-code-using-aws-bedrock/
  8. AWS in Plain English, "Configuring Claude Code extension with AWS Bedrock": https://aws.plainenglish.io/configuring-claude-code-extension-with-aws-bedrock-and-how-you-can-avoid-my-mistakes-090dbed5215b
  9. DEV Community (Haowen Huang), "Running Claude Code and Claude Desktop on Amazon Bedrock": https://dev.to/haowen_huang/running-claude-code-and-claude-desktop-on-amazon-bedrock-1ed2
  10. Medium (Carlos Biagolini), "How to configure Claude Code with Amazon Bedrock": https://medium.com/codetodeploy/how-to-configure-claude-code-with-amazon-bedrock-daf9c9c9d305

Last updated: 18 July 2026.

Top comments (0)