{"slug": "how-to-use-amazon-ergo-in-claude-code-cursor-and-codex", "title": "How to Use Amazon Ergo in Claude Code, Cursor and Codex", "summary": "A developer guide details how to connect Amazon's newly released open-weights model, Ergo, to the Codex, Claude Code and Cursor coding agents through Bedrock's OpenAI-compatible endpoint. Ergo, released December 1, 2026 by Amazon Frontier Model Research, is a 1.1-trillion-parameter mixture-of-experts model with 55 billion active parameters, a 1M-token context window and 128K max output, aimed at software engineering and agentic work. Codex connects directly via the Responses API, while Claude Code requires a local LiteLLM proxy to translate Anthropic Messages requests.", "body_md": "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.\n\nAmazon Ergo is Amazon's first open-weights model, released on December 1, 2026 by Amazon Frontier Model Research. The [Hugging Face model card](https://huggingface.co/Amazon-FMR/Ergo) 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.\n\nThree facts shape how you roll it out:\n\n`none` returns a 400 error.\nOne 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](https://sharkly.ai?utm_source=dev.to&utm_medium=wanda&utm_content=sharkly-blog-sync) fits: one board where People assign tasks to coding agents running on their own Computers.\n\nEverything goes through Bedrock's OpenAI-compatible endpoint. Before you touch any tool, do three things from Amazon's [coding tools guide](https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-amazon-ergo-1-0-coding-tools.html):\n\n`bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream` on the Ergo inference profiles.`AWS_BEARER_TOKEN_BEDROCK`.` amazon.ergo-1.0` can't be called directly, because Ergo runs only through US Geo and Global cross-Region inference.\n| Tool | Protocol | How it connects | Model name | \n|---|---|---|---|\n| Codex | OpenAI Responses | Direct to `/openai/v1` | `global.amazon.ergo-1.0` | \n| Claude Code | Anthropic Messages | LiteLLM proxy on `127.0.0.1:4000` | `global.amazon.ergo-1.0` | \n| Cursor | OpenAI Chat Completions | OpenAI base URL override | `global.amazon.ergo-1.0` | \n\nCodex speaks the Responses API, so it talks to Bedrock with no middle layer. Add this to `~/.codex/config.toml`:\n\n```\nmodel = \"global.amazon.ergo-1.0\"\nmodel_provider = \"bedrock-runtime\"\nmodel_reasoning_effort = \"medium\"\nweb_search = \"disabled\"\nmodel_context_window = 1048568\n\n[model_providers.bedrock-runtime]\nname = \"Amazon Bedrock\"\nbase_url = \"https://bedrock-runtime.us-west-2.amazonaws.com/openai/v1\"\nenv_key = \"AWS_BEARER_TOKEN_BEDROCK\"\nwire_api = \"responses\"\n```\n\nSet `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.\n\nClaude Code sends Anthropic Messages requests, which Bedrock's OpenAI endpoint doesn't accept. Amazon's fix is a local [LiteLLM](https://docs.litellm.ai/) proxy that translates them. Save this as `~/ergo-claude-code/litellm.yaml`:\n\n```\nmodel_list:\n  - model_name: global.amazon.ergo-1.0\n    litellm_params:\n      model: openai/global.amazon.ergo-1.0\n      api_base: https://bedrock-runtime.us-west-2.amazonaws.com/openai/v1\n      api_key: os.environ/AWS_BEARER_TOKEN_BEDROCK\n      extra_body:\n        reasoning:\n          effort: medium\nlitellm_settings:\n  drop_params: true\ngeneral_settings:\n  master_key: sk-ergo-local\n```\n\nStart 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:\n\n```\nexport ANTHROPIC_BASE_URL=\"http://127.0.0.1:4000\"\nexport ANTHROPIC_AUTH_TOKEN=\"sk-ergo-local\"\nexport ANTHROPIC_MODEL=\"global.amazon.ergo-1.0\"\nexport ANTHROPIC_DEFAULT_OPUS_MODEL=\"global.amazon.ergo-1.0\"\nexport ANTHROPIC_DEFAULT_SONNET_MODEL=\"global.amazon.ergo-1.0\"\nexport ANTHROPIC_DEFAULT_HAIKU_MODEL=\"global.amazon.ergo-1.0\"\nexport CLAUDE_CODE_SUBAGENT_MODEL=\"global.amazon.ergo-1.0\"\nunset CLAUDE_CODE_USE_BEDROCK\nclaude\n```\n\n`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.\n\nAmazon'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.\n\nA new model shouldn't take over every agent on its first day. Route by task shape:\n\nAmazon's own [limitations list](https://huggingface.co/Amazon-FMR/Ergo) 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](http://sharkly.ai/blog/route-agent-tasks-by-difficulty?utm_source=dev.to&utm_medium=wanda&utm_content=sharkly-blog-sync) covers the pattern.\n\nBedrock bills per token. Take an agent turn that reads 100K tokens and writes 10K:\n\n| Case | Input | Output | Total | \n|---|---|---|---|\n| No cache | 100K × $1/M = $0.10 | 10K × $3/M = $0.03 | $0.13 | \n| 90K of input cached | $0.01 + $0.0027 | $0.03 | $0.043 | \n\nTwo 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.\n\nA 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.\n\nAWS 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](http://sharkly.ai/blog/coding-agent-cost-management-tracking-spend-across-claude-co?utm_source=dev.to&utm_medium=wanda&utm_content=sharkly-blog-sync) walks through.\n\nSharkly 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.\n\nThree settings from the [Agents docs](https://help.sharkly.ai/docs/agent-and-computer/agents?utm_source=dev.to&utm_medium=wanda&utm_content=sharkly-blog-sync) make an Ergo rollout manageable:\n\n`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.\nCursor stays in each developer's editor. The board handles the agent runs.\n\n`sharkly computer register`.\nWhen 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.\n\nYou don't have to adopt Amazon Ergo this week:\n\nSetting 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](https://sharkly.ai?utm_source=dev.to&utm_medium=wanda&utm_content=sharkly-blog-sync) and create an Ergo variant next to an Agent you already trust.\n\nThe 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.\n\nClaude Code sends Anthropic Messages requests. Bedrock serves Ergo on OpenAI-compatible Responses and Chat Completions APIs, so LiteLLM translates between them.\n\nNot in Amazon's documented setup. Its launcher unsets `CLAUDE_CODE_USE_BEDROCK` and routes through the proxy.\n\nAny 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.\n\nNo. This release is text only, so keep visual tasks on a multimodal model.", "url": "https://wpnews.pro/news/how-to-use-amazon-ergo-in-claude-code-cursor-and-codex", "canonical_source": "https://dev.to/hassann/how-to-use-amazon-ergo-in-claude-code-cursor-and-codex-5561", "published_at": "2026-12-02 08:07:46+00:00", "updated_at": "2026-12-02 08:15:06.876606+00:00", "lang": "en", "topics": ["large-language-models", "ai-agents", "ai-tools", "developer-tools", "ai-infrastructure"], "entities": ["Amazon", "Amazon Bedrock", "Amazon Ergo", "Amazon Frontier Model Research", "Claude Code", "Cursor", "Codex", "LiteLLM"], "also_reported_by": [], "takeaway": "Ergo is reachable only through the global.amazon.ergo-1.0 inference profile on Bedrock's OpenAI-compatible endpoint, so Codex connects directly via the Responses API while Claude Code needs a local LiteLLM proxy on 127.0.0.1:4000 to translate Anthropic Messages requests.", "recommendation": {"advice": "Point coding agents at Bedrock's OpenAI-compatible endpoint using the global.amazon.ergo-1.0 inference profile, and run a local LiteLLM proxy for Claude Code since Bedrock won't accept Anthropic Messages requests directly.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/how-to-use-amazon-ergo-in-claude-code-cursor-and-codex", "markdown": "https://wpnews.pro/news/how-to-use-amazon-ergo-in-claude-code-cursor-and-codex.md", "text": "https://wpnews.pro/news/how-to-use-amazon-ergo-in-claude-code-cursor-and-codex.txt", "jsonld": "https://wpnews.pro/news/how-to-use-amazon-ergo-in-claude-code-cursor-and-codex.jsonld"}}