Dev.to AI 🤖 Ai 👁 2 📖 8 min read

How to Use Amazon Ergo in Claude Code, Cursor and Codex

How to Use Amazon Ergo in Claude Code, Codex and Cursor TL;DR To use Amazon Ergo in Claude Code, Codex or Cursor, create an Amazon Bedrock API key and call the inference profile global.amazon.ergo-1.0 at htt

How to Use Amazon Ergo in Claude Code, Cursor and Codex

How to Use Amazon Ergo in Claude Code, Codex and Cursor

TL;DR

To use Amazon Ergo in Claude Code, Codex or Cursor, create an Amazon Bedrock API key and call the inference profile global.amazon.ergo-1.0 at https://bedrock-runtime.<region>.amazonaws.com/openai/v1. Codex connects directly over the Responses API. Claude Code needs a local LiteLLM proxy.

Start Free on Web

How to use Amazon Ergo when your team already runs coding agents

Amazon Ergo is Amazon's first open-weights model, released on December 1, 2026 by Amazon Frontier Model Research. The Hugging Face model card describes a 1.1 trillion parameter mixture-of-experts model with 55 billion active parameters per token, a 1M-token context window and 128K maximum output. It's built for software engineering and agentic work, and it's text only in this release.

Three facts shape how you roll it out:

  1. It's cheap. On Bedrock, Ergo costs $1 per million input tokens, $0.03 per million cached input tokens and $3 per million output tokens through the Global cross-Region profile.
  2. It's fast. Amazon quotes over 400 output tokens per second on Bedrock, with a Turbo mode at 2,200 in limited preview.
  3. It always reasons. Every request spends output tokens thinking, even on easy tasks, and a reasoning effort of none returns a 400 error.

One developer can follow the setup below and be done. A team running Claude Code and Codex agents side by side also needs to decide which tasks go to Ergo and how to keep keys and spend under control. That's the second half of this guide, and it's where Sharkly fits: one board where People assign tasks to coding agents running on their own Computers.

Amazon Ergo setup in Claude Code, Codex and Cursor

Everything goes through Bedrock's OpenAI-compatible endpoint. Before you touch any tool, do three things from Amazon's coding tools guide:

  • Attach an IAM policy that allows bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream on the Ergo inference profiles.
  • Create a long-term API key in the Bedrock console and export it as AWS_BEARER_TOKEN_BEDROCK.
  • Use an inference profile ID. The base ID amazon.ergo-1.0 can't be called directly, because Ergo runs only through US Geo and Global cross-Region inference.
Tool Protocol How it connects Model name
Codex OpenAI Responses Direct to /openai/v1 global.amazon.ergo-1.0
Claude Code Anthropic Messages LiteLLM proxy on 127.0.0.1:4000 global.amazon.ergo-1.0
Cursor OpenAI Chat Completions OpenAI base URL override global.amazon.ergo-1.0

Architecture diagram: Codex calls the Bedrock OpenAI-compatible Responses API directly, Claude Code sends Anthropic Messages to a local LiteLLM proxy on port 4000 that translates them into Bedrock Responses calls, and Cursor's OpenAI override targets the Chat Completions API; all three reach global.amazon.ergo-1.0 with a Bedrock API key

Codex

Codex speaks the Responses API, so it talks to Bedrock with no middle layer. Add this to ~/.codex/config.toml:

model = "global.amazon.ergo-1.0"
model_provider = "bedrock-runtime"
model_reasoning_effort = "medium"
web_search = "disabled"
model_context_window = 1048568

[model_providers.bedrock-runtime]
name = "Amazon Bedrock"
base_url = "https://bedrock-runtime.us-west-2.amazonaws.com/openai/v1"
env_key = "AWS_BEARER_TOKEN_BEDROCK"
wire_api = "responses"

Set AWS_REGION=us-west-2 in your shell profile, because Codex doesn't read the Region from your AWS CLI profile. Keep web_search disabled: Amazon's guide marks it required, and Codex throws a web search tool error without it. A startup warning that model metadata wasn't found is harmless.

Claude Code

Claude Code sends Anthropic Messages requests, which Bedrock's OpenAI endpoint doesn't accept. Amazon's fix is a local LiteLLM proxy that translates them. Save this as ~/ergo-claude-code/litellm.yaml:

model_list:
  - model_name: global.amazon.ergo-1.0
    litellm_params:
      model: openai/global.amazon.ergo-1.0
      api_base: https://bedrock-runtime.us-west-2.amazonaws.com/openai/v1
      api_key: os.environ/AWS_BEARER_TOKEN_BEDROCK
      extra_body:
        reasoning:
          effort: medium
litellm_settings:
  drop_params: true
general_settings:
  master_key: sk-ergo-local

Start it with uv tool run --from 'litellm[proxy]' litellm --config ~/ergo-claude-code/litellm.yaml --host 127.0.0.1 --port 4000. Then launch Claude Code with these variables:

export ANTHROPIC_BASE_URL="http://127.0.0.1:4000"
export ANTHROPIC_AUTH_TOKEN="sk-ergo-local"
export ANTHROPIC_MODEL="global.amazon.ergo-1.0"
export ANTHROPIC_DEFAULT_OPUS_MODEL="global.amazon.ergo-1.0"
export ANTHROPIC_DEFAULT_SONNET_MODEL="global.amazon.ergo-1.0"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="global.amazon.ergo-1.0"
export CLAUDE_CODE_SUBAGENT_MODEL="global.amazon.ergo-1.0"
unset CLAUDE_CODE_USE_BEDROCK
claude

sk-ergo-local is a placeholder the proxy checks, not a real credential. Watch your ~/.claude/settings.json: an env block there that sets ANTHROPIC_MODEL or CLAUDE_CODE_USE_BEDROCK overrides the launcher.

Cursor

Amazon's guide covers Claude Code, Codex, OpenCode and Kiro, but not Cursor. Cursor's custom model setting speaks OpenAI Chat Completions, and Bedrock serves Ergo on that API, so the route to try is: Cursor Settings > Models, add global.amazon.ergo-1.0 as a custom model, paste your Bedrock key as the OpenAI key, and turn on the base URL override with the /openai/v1 address. Test it on a throwaway project before you trust it with real work.

Decide which tasks go to Amazon Ergo

A new model shouldn't take over every agent on its first day. Route by task shape:

  • Good fits: long refactors that need the 1M context, multi-step agent tasks where 400 tokens per second shortens the wait, and high-volume work where the $3 output price matters.
  • Poor fits: anything that needs screenshots or diagrams, since Ergo reads text only, and tiny edits where forced reasoning adds tokens for no gain.
  • Keep a control: run the same kind of task on your current model for a week and compare results on your own repos.

Amazon's own limitations list says first-attempt accuracy trails the strongest closed models, and recommends letting the agent test and verify its own changes. Its launch post puts Ergo at 65.4 on Amazon's internal AI SWE benchmark, against 85.3 for Opus 5.5. So give Ergo tasks with a test suite it can run, and keep a stronger model on review. Our guide to routing agent tasks by difficulty covers the pattern.

What does an Amazon Ergo agent turn cost?

Bedrock bills per token. Take an agent turn that reads 100K tokens and writes 10K:

Case Input Output Total
No cache 100K × $1/M = $0.10 10K × $3/M = $0.03 $0.13
90K of input cached $0.01 + $0.0027 $0.03 $0.043

Two habits keep that low. Keep sessions on the same files so the cache hits, and set the output limit close to what you need: Amazon notes that each request reserves its full output limit against your account quota. Don't go under 8,192 tokens, though, or reasoning eats the budget and you get an empty answer.

One key per team, without sharing secrets

A Bedrock API key belongs to an IAM identity in your AWS account. That's easier for teams than a personal subscription, but pasting one key into five laptops still means one leak exposes everyone's access. Give each Computer its own key or short-term token, scope the IAM policy to the two Ergo profiles, and turn on Bedrock invocation logs if you want a per-request record. Ergo runs with zero data retention on Bedrock, so your prompts aren't stored or used for training.

AWS tells you what the account spent. It doesn't tell you which task spent it. For that you need the work and the runs in one place, which is the gap our post on tracking coding agent spend walks through.

Route Amazon Ergo work across a team with Sharkly

Sharkly doesn't replace Claude Code or Codex; it runs them. An Agent in Sharkly is a configured teammate that executes through a Runtime (Claude Code, Codex and others) on a connected Computer. Sharkly is BYOK, so runs bill to the Bedrock account the Runtime calls, not to Sharkly.

Three settings from the Agents docs make an Ergo rollout manageable:

  • Environment variables. Each Agent holds plain and secret environment variables. Put ANTHROPIC_BASE_URL and the model names in plain variables instead of editing a shared settings.json. For a Codex Agent, point CODEX_HOME at a folder that holds the Ergo config.toml, and keep the Bedrock key in a secret variable.
  • Variants. An Agent variant inherits the original Agent live and overrides single settings. Keep "Builder" on its usual model and add a "Builder (Ergo)" variant that overrides only the environment variables. Instructions and Skills stay in one place.
  • Computers. The LiteLLM proxy runs on the Computer, so the variant should run on a Computer where the proxy is up.

An Agent's actions menu in the Sharkly Agents directory, with Create variant next to Settings and Duplicate

Cursor stays in each developer's editor. The board handles the agent runs.

Roll it out in five steps

  1. Connect the Computer that holds Claude Code or Codex with sharkly computer register.
  2. Start the LiteLLM proxy on it for Claude Code, or write the Ergo config.toml for Codex.
  3. Create an Ergo variant of an Agent you already trust and set its environment variables, key as a secret.
  4. Assign it long, testable tasks from your routing list; send short ones to the original Agent.
  5. Read each run's result and execution log on the Task before you accept the work.

Sequence diagram: a person assigns a Task to the Ergo variant, Sharkly queues the run to the local service on the Computer, which starts Claude Code with the variant's environment variables; Claude Code calls the local LiteLLM proxy, the proxy calls Amazon Bedrock with global.amazon.ergo-1.0, and the result and execution log return to the Task for human review

When a run fails with a 429 throttling error or an empty answer, the execution log shows the provider's response, so you can tell a spent quota from an output limit set too low.

Alternatives to switching now

You don't have to adopt Amazon Ergo this week:

Conclusion

Setting up Amazon Ergo takes one Bedrock key and ten minutes per tool. Running it across a team takes three decisions: which tasks it gets, which key each Computer uses, and how you'll see what each task cost. Get those right and a new model becomes one more option on the board, not a config change on five laptops. To try it, connect a Computer to Sharkly and create an Ergo variant next to an Agent you already trust.

FAQ

Is Amazon Ergo free to use?

The weights are free under the Amazon Ergo Open-Weights License, which allows commercial use under an acceptable use policy. Running them yourself takes serious hardware: the MXFP4 download alone is 626 GB. On Bedrock you pay per token.

Why does Claude Code need a proxy for Amazon Ergo?

Claude Code sends Anthropic Messages requests. Bedrock serves Ergo on OpenAI-compatible Responses and Chat Completions APIs, so LiteLLM translates between them.

Can I use Claude Code's built-in Bedrock mode instead?

Not in Amazon's documented setup. Its launcher unsets CLAUDE_CODE_USE_BEDROCK and routes through the proxy.

Which Region should I call Amazon Ergo from?

Any commercial Region works with global.amazon.ergo-1.0. Use us.amazon.ergo-1.0 if requests must stay in US Regions. In-Region inference isn't supported.

Can Amazon Ergo read screenshots?

No. This release is text only, so keep visual tasks on a multimodal model.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.