Amazon Ergo in Claude Code
Claude Code cannot talk to an OpenAI-compatible endpoint directly. It sends Anthropic Messages requests, so running Amazon Ergo in Claude Code means putting a translating proxy such as LiteLLM between the two. This page shows the smallest setup that works and says where it gets rough.
Every example needs an ergo_live_ API key with prepaid credit (from $5). Get an API key →
Start with the part most guides skip: Claude Code does not accept an OpenAI-compatible base URL. It speaks the Anthropic Messages API, and our hosted API for the Amazon Ergo model speaks OpenAI Chat Completions. Pointing Claude Code straight at https://ergomodel.net/api/v1 fails. AWS says the same thing about its own Bedrock endpoint: Claude Code reaches Ergo only through a proxy that translates Anthropic Messages, and LiteLLM is the example it names.
So the chain is Claude Code → local LiteLLM proxy → ergomodel.net. Ergo Model is an independent service, not affiliated with Amazon, AWS or Anthropic; we host an OpenAI-compatible API for the open-weight Amazon Ergo model, and LiteLLM does the protocol translation on your machine.
1. Get a key
Create an ergo_live_ key at /get-api-key and export it. Creating the key is free; calls need a prepaid balance, which starts at $5. Usage is billed at $1.50 per 1M input tokens and $4.50 per 1M output tokens.
export ERGO_API_KEY=ergo_live_...2. Configure LiteLLM
Install the LiteLLM proxy and describe one model. The openai/ prefix tells LiteLLM to treat the upstream as a generic OpenAI-compatible server; api_base is our endpoint and the key is read from your environment.
pip install 'litellm[proxy]'# config.yaml
model_list:
- model_name: ergo-1.0
litellm_params:
model: openai/ergo-1.0
api_base: https://ergomodel.net/api/v1
api_key: os.environ/ERGO_API_KEYlitellm --config config.yaml --port 4000This is a sketch, not a hardened deployment. LiteLLM changes quickly, so check its documentation for the current Anthropic-compatible endpoint options and for how to set a master key if the proxy is reachable by anyone but you.
3. Point Claude Code at the proxy
Claude Code reads its endpoint from ANTHROPIC_BASE_URL. Aim it at the local proxy, not at ergomodel.net, and name the model you defined in config.yaml:
export ANTHROPIC_BASE_URL=http://localhost:4000
export ANTHROPIC_AUTH_TOKEN=sk-local # your LiteLLM master key, if you set one
export ANTHROPIC_MODEL=ergo-1.0
claudeClaude Code also sends some background requests under other model names. If the proxy logs "model not found" errors, add those names to model_list and map them to the same openai/ergo-1.0 entry. The exact names depend on your Claude Code version.
What to expect
- Tool-heavy sessions can be rougher than in opencode or Cline. Claude Code's prompts and tool schema were written for Anthropic models and every call is translated twice, so expect the occasional malformed tool call or retry.
- Ergo always reasons before it answers and this cannot be switched off. Reasoning tokens come out of max_tokens and are billed as output, so if you cap output in the proxy keep it at 2,048 or more (AWS suggests 8,192 or higher); a tight cap returns empty content with finish_reason "length".
- Text only. The model does not accept images, so pasted screenshots will not work.
- The context window is 1,048,576 tokens and the maximum output is 131,072, but Claude Code decides how much context to send and when to compact based on its own assumptions.
- Our rate limit is 30 requests per minute per key. A busy agent loop can reach it; the API answers 429 with a Retry-After header.
Would another agent be simpler?
If you are not tied to Claude Code, yes. opencode and Cline both speak OpenAI Chat Completions natively, so they connect to ergo-1.0 with no proxy and one fewer place for things to break. Use the proxy route when you specifically want Claude Code's interface on top of the Ergo model.
FAQ
Can Claude Code use Amazon Ergo directly?
No. Claude Code speaks the Anthropic Messages API and Amazon Ergo endpoints (ours, OpenRouter's and Bedrock's OpenAI-compatible one) speak OpenAI Chat Completions. You need a translating proxy such as LiteLLM in between.
What is the minimal LiteLLM setup?
One model_list entry with model openai/ergo-1.0, api_base https://ergomodel.net/api/v1 and api_key os.environ/ERGO_API_KEY. Start the proxy, then set ANTHROPIC_BASE_URL to the proxy's local address and ANTHROPIC_MODEL to ergo-1.0 before launching Claude Code.
Does it work as well as Claude Code with an Anthropic model?
Not always. Chat and simple edits are fine, but tool-heavy sessions through a translation proxy can be rougher than the same work in opencode or Cline, which talk to the endpoint natively.
What does it cost?
LiteLLM is free to run locally. Our API is prepaid from $5 at $1.50 per 1M input tokens and $4.50 per 1M output tokens; reasoning tokens count as output. There is no subscription and credits do not expire.
Is this setup documented by Amazon?
AWS documents the proxy approach for Claude Code against Amazon Bedrock. This page applies the same pattern to our independent hosted endpoint; it is our guide, not Amazon's.
See also: Get an API key · opencode guide (no proxy) · Cline guide · OpenAI-compatible API
Start using Amazon Ergo
Try the model in the free browser playground first, then create a key and add it to your setup.