Ergo AI Guide

Use Amazon Ergo in Claude Code

1. Start a localhost LiteLLM translation proxy

Because Claude Code speaks the Anthropic Messages protocol while Amazon Ergo exposes Bedrock’s OpenAI-compatible Responses API, AWS documents running a local LiteLLM proxy on 127.0.0.1:4000.

Install uv, export your AWS_BEARER_TOKEN_BEDROCK, and choose a fresh random string for REPLACE_WITH_YOUR_LOCAL_TOKEN (keep it distinct from your AWS key). Save ergo-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: REPLACE_WITH_YOUR_LOCAL_TOKEN

Launch the proxy bound strictly to localhost:

uv tool run --from 'litellm[proxy]' litellm \
  --config ergo-litellm.yaml --host 127.0.0.1 --port 4000

2. Launch Claude Code in a separate terminal

unset CLAUDE_CODE_USE_BEDROCK ANTHROPIC_API_KEY
export ANTHROPIC_BASE_URL=http://127.0.0.1:4000
export ANTHROPIC_AUTH_TOKEN=REPLACE_WITH_YOUR_LOCAL_TOKEN
export ANTHROPIC_MODEL=global.amazon.ergo-1.0
export ANTHROPIC_DEFAULT_OPUS_MODEL="$ANTHROPIC_MODEL"
export ANTHROPIC_DEFAULT_SONNET_MODEL="$ANTHROPIC_MODEL"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="$ANTHROPIC_MODEL"
export CLAUDE_CODE_SUBAGENT_MODEL="$ANTHROPIC_MODEL"
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=1048568
claude

Send a quick read-only prompt on a test file and check the LiteLLM terminal logs to confirm traffic hits global.amazon.ergo-1.0.

Troubleshooting & alternatives

  • Proxy never receives traffic: Check ~/.claude/settings.json for a hardcoded env block overriding ANTHROPIC_BASE_URL.
  • Credential changes ignored: Restart the litellm process whenever you rotate AWS_BEARER_TOKEN_BEDROCK.
  • No local proxy desired: Check Vercel’s Claude Code AI Gateway guide or use Codex CLI / OpenCode directly against Bedrock.

Reference: AWS Ergo coding-tool docs · Estimate Bedrock spend.

QUESTIONS

Frequently asked questions

Does this setup use Anthropic’s Claude models?

No. Claude Code acts only as the terminal agent harness in this setup; every inference call is forwarded to Amazon Ergo-1.0 on Amazon Bedrock.

Does LiteLLM charge extra fees or host my code?

No. LiteLLM runs strictly on your own machine (127.0.0.1) to translate API schemas. All token metering happens in your Amazon Bedrock account.

How do I change Amazon Ergo’s reasoning_effort in Claude Code?

Edit extra_body.reasoning.effort inside ergo-litellm.yaml (low, medium, high, or max) and restart the local LiteLLM proxy.