Amazon Ergo API: Pricing, Setup, Tools and the Caching Math

Amazon Ergo API on Morph: $1.00/M in, $0.03/M cached, $3.00/M out, 1M context. curl, Python and TypeScript examples, Claude Code setup, tool calling, structured outputs, reasoning, and how it compares to Amazon Bedrock.

December 1, 2026 · 1 min read
Per 1M tokens in / out on Morph
$1.00 / $3.00
Per 1M tokens in / out on Morph
Cached input, 97% under the input rate
$0.03/M
Cached input, 97% under the input rate
Context window, tokens
1,048,576
Context window, tokens
Max output, tokens
131,072
Max output, tokens

The Amazon Ergo API on Morph

Last updated December 1, 2026.

An agent loop resends its whole conversation every turn, so the cached-input rate decides most of the bill. On Amazon Ergo that rate is $0.03 per million tokens on Morph, 97% under the $1.00 input rate. Output is $3.00 per million, and reasoning tokens count as output.

Amazon Ergo is Amazon Frontier Model Research's open-weights model for software engineering and agents: 1.1T total parameters, 55B active per token, text-only input, and reasoning that is always on. Amazon released it on December 1, 2026. On Morph, call it as morph-ergo with a 1,048,576-token context and up to 131,072 output tokens. One Morph key works on an OpenAI-compatible endpoint and the Anthropic Messages API, so Claude Code and the OpenAI SDKs need only a base URL, a key and a model name. To try it first, the chat playground opens with Ergo selected.

Amazon Ergo API pricing (per 1M tokens)
EndpointModel IDInputCached inputOutput
Morphmorph-ergo$1.00$0.03$3.00
Amazon Bedrock, global profileglobal.amazon.ergo-1.0$1.00$0.03$3.00
Amazon Bedrock, US geo profileus.amazon.ergo-1.0$1.10$0.033$3.30

Bedrock rows from the Bedrock model card, checked December 1, 2026. Bedrock also lists cache writes at $1.25 (global) and $1.375 (US) per million with a 30-minute TTL; Morph has no cache-write surcharge. Morph rows are Morph's live billing rates, flat across the full 1M context.

Morph vs Amazon Bedrock

Both serve the same model. The differences are setup, cache writes, client support, and what sits around the model.

Calling Amazon Ergo: Morph vs Amazon Bedrock
MorphAmazon Bedrock
OpenAI-compatible base URLhttps://api.morphllm.com/v1https://bedrock-runtime.<region>.amazonaws.com/openai/v1
Anthropic Messages APIhttps://api.morphllm.comNot listed; Claude Code needs a LiteLLM proxy
Model IDmorph-ergoglobal.amazon.ergo-1.0 or us.amazon.ergo-1.0
CredentialsMorph API keyAWS account, plus a Bedrock API key or IAM credentials
Cache writesNo surcharge$1.25 global, $1.375 US (30 min TTL)
Sampling parameters declared on OpenRoutertemperature, top_p, top_k, min_p, penalties, seed, logit_bias, logprobstop_k, stop, max_tokens
Same key also servesKimi K3.1 Pro, GLM-5.3, DeepSeek V4.1 Flash and the rest of Morph's modelsOther Bedrock models

Supported parameters as declared on OpenRouter's amazon/ergo-1.0 endpoints, read December 1, 2026. Both providers declare tools, all four tool_choice modes, response_format and structured outputs.

Quickstart: curl, Python, TypeScript

Create a key at dashboard/api-keys and export it as MORPH_API_KEY. Every example below runs unedited.

curl

curl https://api.morphllm.com/v1/chat/completions \
  -H "Authorization: Bearer $MORPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "morph-ergo",
    "messages": [
      {"role": "user", "content": "Write a Python function that parses ISO 8601 durations."}
    ]
  }'

Python (OpenAI SDK)

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.morphllm.com/v1",
    api_key=os.environ["MORPH_API_KEY"],
)

resp = client.chat.completions.create(
    model="morph-ergo",
    messages=[{"role": "user", "content": "Find the race condition in this worker loop: ..."}],
)
print(resp.choices[0].message.content)
print(resp.usage)  # reasoning tokens bill as output

TypeScript (OpenAI SDK, streaming)

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.MORPH_API_KEY,
  baseURL: "https://api.morphllm.com/v1",
});

const stream = await client.chat.completions.create({
  model: "morph-ergo",
  messages: [{ role: "user", content: "Write a migration that indexes users.email." }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Anthropic SDK

import os
import anthropic

client = anthropic.Anthropic(
    api_key=os.environ["MORPH_API_KEY"],
    base_url="https://api.morphllm.com",  # no /v1 suffix
)

msg = client.messages.create(
    model="morph-ergo",
    max_tokens=16384,
    messages=[{"role": "user", "content": "Explain this stack trace: ..."}],
)
# The response can lead with a thinking block. Read the last text block.
print([b.text for b in msg.content if b.type == "text"][-1])

Cline, Cursor, and other OpenAI-compatible clients

In any client that accepts an OpenAI-compatible base URL, enter https://api.morphllm.com/v1, your Morph key, and morph-ergo as the model. No extra headers are required.

Use It in Claude Code

Morph serves the Anthropic Messages API directly, so Claude Code needs four environment variables and no proxy. On Bedrock, Amazon's model card says Claude Code requires a LiteLLM proxy. ANTHROPIC_MODEL remaps the Sonnet and Opus slots. ANTHROPIC_SMALL_FAST_MODEL remaps Haiku, which handles background calls for titles and summaries; Morph's Claude Code guide puts GLM-5.3-Flash there.

export ANTHROPIC_BASE_URL="https://api.morphllm.com"
export ANTHROPIC_AUTH_TOKEN="YOUR_MORPH_API_KEY"
export ANTHROPIC_MODEL="morph-ergo"
export ANTHROPIC_SMALL_FAST_MODEL="morph-glm53flash"
claude

To keep it across terminals, put the same values in ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.morphllm.com",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_MORPH_API_KEY",
    "ANTHROPIC_MODEL": "morph-ergo",
    "ANTHROPIC_SMALL_FAST_MODEL": "morph-glm53flash"
  }
}
  • 401 on every request: an Anthropic key is still set. Claude Code sends ANTHROPIC_AUTH_TOKEN as a bearer token, and ANTHROPIC_API_KEY also works; do not leave an Anthropic key in either.
  • Model not found: use the Morph ID morph-ergo, not a Claude model name or a Bedrock profile ID.

Full reference: Claude Code on Morph.

Tool Calling

Amazon built Ergo for agents that call tools and check their own results. On Morph, morph-ergo takes standard OpenAI tools and all four tool_choice modes: auto, none, required, and a named function. Append the whole assistant message each turn, tool calls included, then one tool result per call with the matching tool_call_id. Bedrock's own sample appends the assistant message the same way.

TOOLS = [{
    "type": "function",
    "function": {
        "name": "run_tests",
        "description": "Run the test suite under a path and return the failures.",
        "parameters": {
            "type": "object",
            "properties": {"path": {"type": "string"}},
            "required": ["path"],
        },
    },
}]

messages = [{"role": "user", "content": "Find and fix the failing test in src/."}]

while True:
    resp = client.chat.completions.create(
        model="morph-ergo",
        messages=messages,
        tools=TOOLS,
        tool_choice="auto",
    )
    msg = resp.choices[0].message
    messages.append(msg.model_dump(exclude_none=True))  # keep tool_calls intact
    if not msg.tool_calls:
        break
    for call in msg.tool_calls:
        messages.append({
            "role": "tool",
            "tool_call_id": call.id,
            "content": run_tool(call),
        })

The replayed conversation is a byte-identical prefix every turn, so it bills at the cached rate ($0.03 per million). Keep timestamps and request IDs out of the system prompt; one changed token early in the prefix turns every later token into a cache miss.

Structured Outputs and JSON Mode

morph-ergo supports both forms of response_format. Use json_schema when a program reads the result, and json_object when any valid JSON will do. Parse message.content.

import json

resp = client.chat.completions.create(
    model="morph-ergo",
    messages=[{"role": "user", "content": "List the functions this diff changes: ..."}],
    response_format={
        "type": "json_schema",
        "json_schema": {
            "name": "changed_functions",
            "strict": True,
            "schema": {
                "type": "object",
                "properties": {
                    "functions": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {"type": "string"},
                                "file": {"type": "string"},
                            },
                            "required": ["name", "file"],
                            "additionalProperties": False,
                        },
                    },
                },
                "required": ["functions"],
                "additionalProperties": False,
            },
        },
    },
)
data = json.loads(resp.choices[0].message.content)

For plain JSON mode, pass response_format={"type": "json_object"} and say in the prompt what keys you expect.

Reasoning: Always On, Billed as Output

Ergo always reasons. On Morph, reasoning is on by default and reasoning tokens bill as output at $3.00 per million. A one-line question still pays for the thinking in front of its answer.

Always on
“Amazon Ergo always reasons, which helps on hard tasks but uses more output tokens on simple ones.”
Amazon FMR, Ergo model card

The effort controls are less settled than the model card suggests. The card lists "Fixed reasoning effort" as a limitation. Bedrock's sample code still passes reasoning_effort with levels from low to max and notes that "none" returns a 400. Morph accepts the reasoning and reasoning_effort fields on morph-ergo. Measure output tokens on your own prompts before you count on an effort setting to cut them.

Budget for reasoning

Bedrock's sample keeps max_completion_tokens at 8,192 or more because reasoning uses part of it. Start there if you cap max_tokens, and watch usage.completion_tokens on real traffic.

On the Anthropic Messages API, a response can lead with a thinking block, so read the last text block, not content[0].text.

Supported Parameters

morph-ergo request support
GroupParameters
Samplingtemperature, top_p, top_k, min_p, frequency_penalty, presence_penalty, repetition_penalty, stop, seed, max_tokens, logit_bias
Toolstools, tool_choice (auto, none, required, named function)
Output formatresponse_format: json_object (JSON mode) or json_schema (structured outputs)
ReasoningOn by default; reasoning, reasoning_effort; reasoning tokens bill as output
Diagnosticslogprobs, top_logprobs
InputText only
Limits1,048,576-token context, 131,072 max output tokens

Live per-token rates and limits for every Morph model are at /api/models/json?prices=list.

Amazon Ergo Pricing and the Caching Math

An agent loop resends the whole conversation every turn. That makes the cached-input rate, not the input rate, the number that decides an agent bill. Here is one session worked through at each price, computed from the rates above:

  • 20,000-token system prompt and tool definitions
  • 3,000 new input tokens per turn (tool results, user text)
  • 2,000 output tokens per turn, reasoning included
  • 30 turns, ending at a 168,000-token context (well inside the 1M window)

In this model each token bills at the full input rate once, the first time it is sent, and every resend after that is a cache hit. That puts 94% of the session's 2,865,000 input tokens at the cached rate: 168,000 uncached, 2,697,000 cached, plus 60,000 output. The previous reply is counted as uncached on the next turn, which errs high.

One 30-turn agent session (USD)
Model and billingInputCached inputOutputSession total
Amazon Ergo on Morph$0.17$0.08$0.18$0.43
Amazon Ergo on Bedrock, global (before cache writes)$0.17$0.08$0.18$0.43
Amazon Ergo on Bedrock, US (before cache writes)$0.18$0.09$0.20$0.47
GLM-5.3 on Morph$0.28$0.84$0.32$1.44
Kimi K3.1 Pro on Morph$0.42$0.78$0.84$2.04
Amazon Ergo on Morph, every turn a cache miss$2.87$0.00$0.18$3.05

The same session on Kimi K3.1 Pro costs $2.04 on Morph, 4.8x Ergo's $0.43. The Bedrock rows leave out cache writes, which Bedrock lists at $1.25 per million globally; they are the floor for Bedrock. The last row is the real lesson: with no cache hits the session costs $3.05, about 7x more. If an Ergo bill looks wrong, check the cache-hit ratio before the sticker price.

Every response reports what it reused in usage.prompt_tokens_details.cached_tokens. Real hit rates fall short of this model when a prefix changes mid-session (a timestamp in the system prompt, an edited earlier turn). Put stable content first: system prompt, then tool definitions, then history. The full mechanics are on the prompt caching page and in the caching docs.

Morph or Amazon Bedrock?

Both serve Amazon Ergo at the same per-token rates on the global profile, so the choice comes down to setup and what sits around the model.

One key, many models

A Morph key calls Ergo, Kimi K3.1 Pro, GLM-5.3 and DeepSeek V4.1 Flash on the same OpenAI-compatible and Anthropic-compatible endpoints. Switching models is a string change.

No AWS plumbing

No AWS account, no inference profile, no region choice. Bedrock serves Ergo through cross-Region profiles only and needs AWS credentials.

Choose Morph when
  • You run Claude Code: Morph speaks the Anthropic Messages API, and Bedrock's card says Claude Code needs a LiteLLM proxy there
  • You want no cache-write charge: Bedrock lists $1.25 per million for writes; Morph has none
  • You tune sampling: Morph's OpenRouter route declares temperature, top_p, seed, logit_bias and logprobs; the Bedrock routes declare none of them
  • You run several models: one key for Ergo, Kimi K3.1 Pro, GLM-5.3 and DeepSeek V4.1 Flash
Choose Amazon Bedrock when
  • Your spend and compliance already live in AWS
  • You need US-only routing: the us.amazon.ergo-1.0 profile keeps traffic in US Regions, at 10% more per token
  • You need Bedrock features: Guardrails, server-side web search, or zero data retention with zero operator access

To compare every hosted price, OpenRouter lists three endpoints for amazon/ergo-1.0: Morph and Amazon Bedrock's global and US profiles.

FAQ

How much does the Amazon Ergo API cost?

On Morph, morph-ergo costs $1.00 per million input tokens, $0.03 per million cached input tokens and $3.00 per million output tokens, flat across the 1,048,576-token context. Reasoning tokens bill as output. Prefix caching is automatic and there is no cache-write surcharge. On Amazon Bedrock, the global profile lists $1.00 / $0.03 / $3.00 plus $1.25 per million for cache writes, and the US geo profile lists $1.10 / $0.033 / $3.30.

Is Morph cheaper than Amazon Bedrock for Amazon Ergo?

Per token, Morph matches Bedrock's global profile on input, cached input and output ($1.00 / $0.03 / $3.00). Bedrock's US geo profile costs 10% more. Bedrock also lists a cache-write rate of $1.25 per million (30-minute TTL); Morph has no cache-write surcharge. In the 30-turn session worked through on this page, Morph comes to $0.43, Bedrock global to $0.43 before any cache-write charges, and Bedrock US to $0.47.

How do I get an Amazon Ergo API key?

Create a Morph account and make a key on the API keys page of the dashboard. Use it with base URL https://api.morphllm.com/v1 for OpenAI-compatible clients or https://api.morphllm.com for the Anthropic Messages API, and pass morph-ergo as the model. The same key works for every model on Morph. To try Ergo before writing code, the dashboard chat playground opens with Ergo selected. On Amazon Bedrock you need an AWS account and a Bedrock API key, and you call the global.amazon.ergo-1.0 or us.amazon.ergo-1.0 profile.

What is the Amazon Ergo model ID?

On Morph it is morph-ergo. On Amazon Bedrock the model ID is amazon.ergo-1.0, but Bedrock serves Ergo through cross-Region inference only, so requests use the global.amazon.ergo-1.0 or us.amazon.ergo-1.0 profile. On OpenRouter it is amazon/ergo-1.0, where Morph is one of three endpoints.

Can I use Amazon Ergo in Claude Code?

Yes. Set ANTHROPIC_BASE_URL to https://api.morphllm.com, ANTHROPIC_AUTH_TOKEN to your Morph key and ANTHROPIC_MODEL to morph-ergo, then run claude. Morph serves the Anthropic Messages API directly, so no proxy is needed. Amazon's Bedrock model card says Claude Code on Bedrock requires a LiteLLM proxy.

Does Amazon Ergo support tool calling and structured outputs?

Yes. On Morph, morph-ergo supports tools with tool_choice auto, none, required or a named function, JSON mode (response_format json_object), structured outputs (response_format json_schema), and logprobs. Parse the answer from message.content.

Can I turn off reasoning on Amazon Ergo?

Amazon's model card says Ergo always reasons, which helps on hard tasks but uses more output tokens on simple ones. Bedrock's sample passes reasoning_effort from low to max and notes that "none" returns a 400. On Morph, reasoning is on by default, the reasoning and reasoning_effort fields are accepted, and reasoning tokens bill as output.

What are Amazon Ergo's context window and max output?

On Morph, morph-ergo has a 1,048,576-token context window and up to 131,072 output tokens. Amazon's model card lists 1M tokens of context and 128K tokens of output.

Can I send images to Amazon Ergo?

No. Amazon's model card says Ergo cannot read images, screenshots or diagrams in this release, and Morph serves it as a text-only model. For image input on the same Morph key, Kimi K3.1 Pro (morph-kimik31) accepts images.

Related Articles

Private deployments

The fastest endpoints are private deployments

Morph's top speeds come from dedicated deployments, not shared public endpoints: speculators trained on your traffic, caching tuned to your workload, and volume discounts over public per-token rates. Over 1 trillion tokens per day run this way.

Talk to us about a private deployment

Try Amazon Ergo on Morph

Open the chat playground with Ergo selected, then get a key and call morph-ergo on the OpenAI and Anthropic formats at $1.00 input, $0.03 cached and $3.00 output per million tokens.

Sources