Prepared by sygnał. with AI assistance.

# Amazon Ergo in Codex: setup, costs and what about Claude Code?

You can connect Amazon Ergo 1.0 to Codex CLI through Amazon Bedrock. Claude Code needs an extra component, a LiteLLM proxy. Ergo usage is billed separately through Bedrock rather than included in ChatGPT Plus or Claude Pro. At the global rate, 100,000 input tokens and 20,000 output tokens cost $0.16 before caching and other charges.

Documentation checked: December 3, 2026. This guide follows AWS documentation and includes an original cost calculation and an Angular test scenario. No paid API connection was run for this article.

What makes Amazon Ergo different?

Amazon introduced Ergo on December 1, 2026, at AWS re:Invent. The model targets coding tasks where an agent can inspect a repository, propose changes and check the results rather than just answer a question.

SpecificationAmazon Ergo 1.0
ArchitectureMoE, 1.1 trillion parameters in total, 55 billion active
Context1 million tokens
Maximum output131,072 tokens
Input and outputText
Claimed Bedrock speedOver 400 output tokens/s

MoE, or mixture of experts, means the model activates selected parts of its network for each token. That doesn't mean all its weights fit on an ordinary laptop. A large context window lets you supply lots of files, but it does not guarantee that the model will understand an entire project correctly.

Sources: AWS model card and Amazon's announcement. The speed is a vendor claim, not a measurement of an agent working on a repository.

Before connecting the model

You need an AWS account that can invoke Ergo through Bedrock, suitable IAM (AWS Identity and Access Management) permissions and a Bedrock API key. Start with a separate test environment, configure cost alerts and restrict permissions to the model you need. A billing alert is not a hard spending cap.

AWS documents two inference profiles:

ProfileScope
global.amazon.ergo-1.0Routing across supported regions worldwide
us.amazon.ergo-1.0Routing within the US

Use the inference profile ID, not the bare model ID amazon.ergo-1.0. The AWS example uses us-west-2. If you work in Poland or elsewhere in the EU, do not assume that global routing keeps data inside the EU. The endpoint region alone does not guarantee where inference takes place. Before sending company code, check your organization's requirements and AWS availability information.

Keep the Bedrock key in a secure secret store and pass it to the process via AWS_BEARER_TOKEN_BEDROCK. Don't commit it to your repository or write it in plain text into a configuration file. See the Prerequisites section of the AWS setup guide for the IAM policy and API key instructions.

Codex CLI: the shortest route

Codex CLI supports Bedrock's Responses interface. Install a current version and back up ~/.codex/config.toml before making changes. The example below, based on AWS documentation, selects Ergo as the default model. If you have existing settings, merge the relevant sections rather than replacing your entire file.

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 = "Ergo via Bedrock"
base_url = "https://bedrock-runtime.us-west-2.amazonaws.com/openai/v1"
env_key = "AWS_BEARER_TOKEN_BEDROCK"
wire_api = "responses"

In a Bash or Zsh terminal that already has access to the key, set the region to match the endpoint:

export AWS_REGION=us-west-2
codex

Run it in a test repository first, not a production project. Keep approval and sandbox protections enabled. Restore your configuration backup to return to the previous provider when needed. See AWS coding tools documentation.

What about Claude Code?

Claude Code communicates using the Anthropic Messages format. AWS documents a local LiteLLM proxy that converts requests into a format Ergo supports. This does not turn Ergo into a Claude model.

ToolRequest path
Codex CLICodex → Bedrock Responses → Ergo
Claude CodeClaude Code → local LiteLLM → Bedrock Responses → Ergo
OpenCodeOpenCode → Bedrock Chat Completions → Ergo

For Claude Code, follow the AWS instructions for the proxy configuration, launcher script and environment variables. Keep the proxy bound to 127.0.0.1, use your own local secret and avoid exposing its port to the network. Check that existing Claude Code settings do not override the launcher's variables. Don't assume every agent feature is fully compatible.

How much does a task actually cost?

AWS lists global rates of $1 per million input tokens and $3 per million output tokens. Tokens are pieces of text a model processes, not necessarily whole words. An agent repeatedly sends context and file contents, so total usage can be far larger than the first prompt.

Example input / output usageCost (USD)
10,000 / 2,0000.016
100,000 / 20,0000.16
500,000 / 100,0000.80
2,000,000 / 400,0003.20

These are hypothetical calculations, not measured task costs. Formula: input / 1000000 * 1 + output / 1000000 * 3. Caching, taxes and other charges are excluded. Count output tokens as reported by API usage, including reasoning if billed there. Check current prices and AWS usage metrics before running a longer task. Product pricing.

Your first task: a small Angular test

Rather than asking the agent to rebuild an application, choose a copy of a non-sensitive repository with tests. Suppose a form accepts an empty username. Start with diagnosis, without changing files.

Inspect the username validation in the Angular form.
Do not change any files. Identify the cause, suggest a minimal fix
and two tests: an empty string and a valid username. Do not open
files containing secrets or install dependencies.

If the plan looks good, allow edits only to relevant files and let the agent run existing tests. Review git diff and read the AWS token usage. Record end-to-end task time, cost, test results and the number of manual fixes. Repeat with a different model on the same repository version, using the same prompt and permissions. This is a more useful basis for choosing a model than comparing advertised token generation speeds.

Prompt instructions are not a security boundary. Configure tool permissions, sandboxing and data access separately. This is a suggested test scenario, not a benchmark result.

When Ergo does not respond

  • A 400 model ID error: check the global or US profile and supported region. Do not disable reasoning; Ergo requires it.
  • A 403 error: verify IAM permissions, key validity and model access.
  • A 429 error: check account quotas and request size; avoid endless retries.
  • An empty or truncated answer: AWS recommends an output limit of at least 8,192 tokens. Do not automatically set it to the maximum.
  • A Codex web_search error: leave built-in server-side search disabled.

See the troubleshooting section of the AWS guide.

Is it worth switching models?

Ergo is worth considering if you work with terminal-based agents and want to evaluate model costs independently of the tool that drives them. You can download the weights and host them on your own infrastructure, subject to the Amazon Ergo Open-Weights License. It is not Apache 2.0; read the license terms before offering the model to customers.

Start with one small Codex CLI task. If the test results and the bill look good, consider the Claude Code proxy setup or larger tasks.