← All integrationsAPI · OpenAI-compatible

The Amazon Ergo OpenAI compatible API

Amazon Ergo can be called with the OpenAI SDKs you already use. Ergo Model hosts the model behind an OpenAI Chat Completions endpoint, so you change three things — the base URL, the API key and the model name — and keep the rest of your code. This page lists the exact values, what "compatible" covers on our endpoint, what it does not, and working configs for common frameworks.

Every example needs an ergo_live_ key. Grab one → Creating a key is free; calls draw on prepaid credits (packs from $5). Ergo Model is an independent service, not affiliated with Amazon or AWS.

The three constants

Keep these the same across every SDK, framework and CLI and the Amazon Ergo OpenAI compatible API behaves like any other OpenAI endpoint.

SettingValue
base_urlhttps://ergomodel.net/api/v1
api_keyan ergo_live_ key from /get-api-key (suggested env var: ERGO_API_KEY)
modelergo-1.0 — aliases ergo, amazon-ergo and amazon/ergo-1.0 are accepted
endpointPOST /api/v1/chat/completions

There is one model on this endpoint. Any other model name in the request is also served by ergo-1.0, so a client with a hard-coded model field still works.

Drop-in with the OpenAI SDKs

Python (openai)

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://ergomodel.net/api/v1",
    api_key=os.environ["ERGO_API_KEY"],  # ergo_live_...
)

resp = client.chat.completions.create(
    model="ergo-1.0",
    max_tokens=8192,  # reasoning tokens come out of this budget
    messages=[{"role": "user", "content": "Refactor this function..."}],
)
print(resp.choices[0].message.content)

Node / TypeScript (openai)

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://ergomodel.net/api/v1",
  apiKey: process.env.ERGO_API_KEY, // ergo_live_...
});

const resp = await client.chat.completions.create({
  model: "ergo-1.0",
  max_tokens: 8192, // reasoning tokens come out of this budget
  messages: [{ role: "user", content: "Explain this stack trace..." }],
});
console.log(resp.choices[0].message.content);

curl

curl https://ergomodel.net/api/v1/chat/completions \
  -H "Authorization: Bearer $ERGO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "ergo-1.0",
    "max_tokens": 4096,
    "reasoning": {"effort": "low"},
    "messages": [{"role": "user", "content": "Hello Ergo"}]
  }'

Streaming

Add "stream": true to the request body and the endpoint returns standard OpenAI-style server-sent events — a series of data: chunks ending with data: [DONE]. A final usage frame is always sent on streams, so you can read the token counts without asking for them. The OpenAI SDKs parse all of this for you.

# same request, just add stream: true
curl https://ergomodel.net/api/v1/chat/completions \
  -H "Authorization: Bearer $ERGO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "ergo-1.0",
    "max_tokens": 4096,
    "messages": [{"role": "user", "content": "Write a haiku"}],
    "stream": true
  }'
# -> standard OpenAI SSE: data: {...} chunks, a final chunk carrying usage,
#    then data: [DONE]

Point your framework or gateway at it

Libraries that accept a custom OpenAI base URL reach Ergo the same way as the raw SDK: the base URL, an ergo_live_ key and the model name. The snippets below are the standard public configuration for each library; we have not end-to-end tested every framework against the hosted endpoint, so treat them as drop-in config rather than a certified integration.

LangChain (langchain-openai)

Pass a custom base_url to ChatOpenAI. Set use_responses_api=False: our endpoint implements Chat Completions, not the Responses API.

import os
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="ergo-1.0",
    base_url="https://ergomodel.net/api/v1",
    api_key=os.environ["ERGO_API_KEY"],  # ergo_live_...
    max_tokens=8192,                     # leave room for reasoning
    use_responses_api=False,             # our endpoint is Chat Completions only
)
print(llm.invoke("Refactor this function...").content)

LlamaIndex (OpenAILike)

Use OpenAILike with api_base and is_chat_model=True so calls go to /chat/completions, and set context_window to 1,048,576 so the library does not assume a smaller default. Tool definitions are forwarded to the model, so you can add is_function_calling_model=True for agents; test it on your own workload first. Embeddings need a different provider — this endpoint has none.

import os
from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(
    model="ergo-1.0",
    api_base="https://ergomodel.net/api/v1",
    api_key=os.environ["ERGO_API_KEY"],  # ergo_live_...
    is_chat_model=True,                  # route to /chat/completions
    context_window=1048576,              # declare the full window
    max_tokens=8192,                     # leave room for reasoning
)
print(llm.complete("Summarize this file...").text)

LiteLLM

Prefix the model with openai/ to force LiteLLM's OpenAI-compatible route, then point api_base at the /api/v1 endpoint. The same two settings work in a LiteLLM proxy config.yaml (a model: openai/ergo-1.0 entry plus an api_base line). A LiteLLM proxy is also the usual way to put the model behind tools that speak the Anthropic Messages format, such as Claude Code.

import os
import litellm

resp = litellm.completion(
    model="openai/ergo-1.0",              # openai/ -> OpenAI-compatible route
    api_base="https://ergomodel.net/api/v1",
    api_key=os.environ["ERGO_API_KEY"],  # ergo_live_...
    max_tokens=8192,                     # leave room for reasoning
    messages=[{"role": "user", "content": "Explain this stack trace..."}],
)
print(resp.choices[0].message.content)

Coding agents and editors have their own pages: opencode, Cline, Cursor and TypeScript.

What "compatible" covers

What it does not cover

Reasoning and max_tokens

This is the one place where code written for a non-reasoning model needs a change. Reasoning tokens come out of max_tokens and are billed as output. We measured about 300–450 reasoning tokens for a one-line haiku. With a small budget (for example max_tokens: 300) the reply can come back with empty content and finish_reason: "length". Set max_tokens to at least 2048 for short answers; AWS's own guidance is an output limit of 8,192 or higher. The ceiling is 131,072 output tokens inside a 1,048,576-token context window.

Pricing

Input and output tokens are priced separately, and reasoning counts as output. Cached input is billed at the normal input rate. Credits are prepaid (packs from $5), never expire, and there is no subscription.

ModelInput / 1M tokensOutput / 1M tokens
ergo-1.0$1.50$4.50

A key at a zero balance returns HTTP 402 insufficient_credits with a top-up link. Full numbers on the pricing page.

Amazon Bedrock has an OpenAI-compatible endpoint too

You do not need this site to use the OpenAI SDKs with the model. Amazon Bedrock exposes its own OpenAI-compatible base URL, where the model is named global.amazon.ergo-1.0 ($1.00 input / $3.00 output per 1M tokens) or us.amazon.ergo-1.0 ($1.10 / $3.30). It needs an AWS account. On Bedrock the reasoning_effort parameter accepts low, medium, high, xhigh and max.

from openai import OpenAI

# Amazon Bedrock's own OpenAI-compatible endpoint (needs an AWS account)
client = OpenAI(
    base_url="https://bedrock-runtime.<region>.amazonaws.com/openai/v1",
    api_key="<your Amazon Bedrock API key>",
)
# model: "global.amazon.ergo-1.0" or "us.amazon.ergo-1.0"

Bedrock and OpenRouter are cheaper per token than we are. Our endpoint is for people who want one key, card payment and no AWS setup. The Amazon Ergo API comparison puts all the providers side by side.

FAQ

Is there an Amazon Ergo OpenAI compatible API?

Yes, more than one. Ergo Model (this site, independent of Amazon) hosts an OpenAI Chat Completions endpoint for the model at https://ergomodel.net/api/v1/chat/completions. Amazon Bedrock also exposes an OpenAI-compatible base URL for it, and OpenRouter lists it as amazon/ergo-1.0. On all three you keep your OpenAI SDK and change the base URL, API key and model name.

What base URL and model name do I use here?

Base URL https://ergomodel.net/api/v1, a key that starts with ergo_live_, and model ergo-1.0. The aliases ergo, amazon-ergo and amazon/ergo-1.0 are accepted too. There is only one model, so requests land on POST /api/v1/chat/completions and are served by ergo-1.0.

Does it support streaming, tools and structured outputs?

Yes. stream, tools, tool_choice and response_format are forwarded as-is, along with temperature, top_p, max_tokens, stop, seed and the reasoning field. Streams are standard OpenAI server-sent events and always end with a usage frame before [DONE].

What is not supported on this endpoint?

Image input (Amazon Ergo is text in, text out), embeddings and the OpenAI Responses API. Reasoning cannot be turned off: the model always reasons before it answers, and a request that tries to disable reasoning returns HTTP 400.

Why did I get an empty reply with finish_reason "length"?

Reasoning tokens are taken out of max_tokens. With a small budget such as 300, the model can spend all of it on reasoning and return empty content. Set max_tokens to at least 2048 for short answers; AWS's own guidance is an output limit of 8,192 or higher.

What does it cost?

The hosted API is prepaid: $1.50 per 1M input tokens and $4.50 per 1M output tokens, with reasoning counted as output. Credit packs start at $5 and never expire. A key with a zero balance returns HTTP 402 insufficient_credits with a top-up link. Amazon Bedrock and OpenRouter are cheaper per token; this endpoint trades that for one key, card payment and no AWS account.

See also: How to call the API · API docs · All API providers · OpenRouter · Pricing

Start calling Amazon Ergo

Try a prompt in the free browser playground, or create a key and drop it into your OpenAI client.

Open the playgroundGet an API key
Amazon Ergo OpenAI-Compatible API — base URL, model & keys · Ergo Model