Dev.to AI πŸ€– Ai πŸ‘ 2 πŸ“– 4 min read

Amazon Ergo in Claude Code: Setup, Costs and When to Use It

Short answer: Amazon Ergo 1.0 is a cheap, fast model for everyday coding, and it runs inside Claude Code with a few environment variables. Give it a big output limit, because it always thinks, and keep a second model for

Short answer: Amazon Ergo 1.0 is a cheap, fast model for everyday coding, and it runs inside Claude Code with a few environment variables. Give it a big output limit, because it always thinks, and keep a second model for anything visual, because it cannot read images.

Every number below comes from runs I did side by side with Claude Opus 5.5 and Kimi K3.1 Pro, using the same prompts.

What you need to know first

Amazon released Ergo 1.0 on December 1, 2026. It is a mixture of experts model (only some of its sub-networks run for each token): 1.1 trillion parameters in total, 55 billion active per token.

Spec Value
OpenRouter id amazon/ergo-1.0
Price per 1M tokens $1 in / $3 out
Context window 1M tokens
Image input No
Effort levels low to max, no off switch
AWS output limit advice 8,192 tokens or more

For comparison, Kimi K3.1 Pro costs $2 / $10 and Opus 5.5 costs $4 / $20.

Step 1: Call it on OpenRouter

OpenRouter gives you Ergo with one key and no AWS setup. This is the body my test harness sent to https://openrouter.ai/api/v1/chat/completions:

{
  "model": "amazon/ergo-1.0",
  "messages": [{"role": "user", "content": "I'm a backend developer and I already know what an API and a retry are. Explain idempotency keys to me in exactly 5 sentences."}],
  "stream": true,
  "max_tokens": 3000,
  "usage": {"include": true},
  "provider": {"order": ["amazon-bedrock"], "allow_fallbacks": false}
}
  • provider.order with allow_fallbacks: false pins the call to Amazon Bedrock, so you know which host ran it.
  • usage.include returns token counts, reasoning tokens and cost. Log it every time.
  • To set the effort, add "reasoning": {"effort": "max"}.

Step 2: Give it room to think

This is the setting that bit me. I asked Ergo to turn a changelog into schema-valid JSON with a 4,000-token limit:

Run Result
Runs 1 and 2 Valid, 9 of 9 fields right
Run 3 3,665 reasoning tokens, hit the cap, JSON cut off
max effort, 16,000 limit Valid, 6.7 s, $0.0066

Opus 5.5 got 3 of 3 on the same task. So:

  1. Set max_tokens to at least 8,192, as AWS recommends, and higher for code.
  2. Check the finish reason. A response that stopped at the limit is not an answer.
  3. Validate structured output before you use it.

Step 3: Run it inside Claude Code

Claude Code can talk to OpenRouter's Anthropic-compatible endpoint. These are the variables from the launch script I used (the key loads from a local .env first):

export ANTHROPIC_BASE_URL=https://openrouter.ai/api
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
export ANTHROPIC_API_KEY=""
export ANTHROPIC_MODEL=amazon/ergo-1.0 ANTHROPIC_DEFAULT_HAIKU_MODEL=amazon/ergo-1.0 ANTHROPIC_SMALL_FAST_MODEL=amazon/ergo-1.0
export ANTHROPIC_DEFAULT_SONNET_MODEL=amazon/ergo-1.0 ANTHROPIC_DEFAULT_OPUS_MODEL=amazon/ergo-1.0
claude --model amazon/ergo-1.0

I set every model slot to Ergo so Claude Code's background calls go to it too. AWS's docs route Claude Code through a LiteLLM proxy instead; I only tested OpenRouter.

I gave it a cart repo with a one-cent bug I planted in the money helper. Ergo proved that 19.99 * 100 is 1998.9999999999998 in floating point and fixed the truncation:

-    return int(amount * 100)
+    return int(round(amount * 100))
Bug fix Ergo Kimi Opus
Hidden tests 2 of 2 2 of 2 2 of 2
Time 39 s ~23 s 21 s
Cost ~$0.04 $0.14 ~$0.22

Kimi used Python's Decimal, which I would pick for real money code.

Step 4: Know the cost per task

Ergo always thinks, and 55 to 61% of its output on my three one-shot browser games was reasoning. It was still far cheaper:

Three games Ergo Opus
Total cost $0.48 $4.50
Time per game ~2 min 8-13 min

Opus built the best-looking games, and Ergo was a close second each time. Kimi, on Moonshot's host, returned one empty answer.

Step 5: Plan around the first-token wait

On long builds Ergo averaged about 435 tokens per second, roughly 4x Opus. But on launch day it waited 14 to 36 seconds before the first token, while Opus started in about 2. The next day it took 2.8 seconds. Measure it yourself before you put Ergo behind anything a user waits on.

When to use it, and when not to

Use Ergo for bug fixes with tests, fast prototypes and high-volume text jobs. Use something else when an image is in the loop (OpenRouter rejects the request), for the hardest coding (Amazon's own AI SWE chart: Ergo 65.4, Opus 85.3), or if you wanted to run it locally (the smallest weights file is 626 GB).

The full test

Prefer to watch? The full test is here:

The complete guide, with the license and Amazon's benchmark tables, is on Hashnode: Amazon Ergo 1.0 vs Claude Opus 5.5 and Kimi K3.1 Pro.

What output limit are you running Ergo with? I'd like to know if anyone still gets cut-off answers above 8,192.

Links and sources

Drafted with AI assistance from my own tests and notes.

πŸ“° 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.