Ergo Model API reference
Ergo Model serves Amazon Ergo over an OpenAI-compatible Chat Completions API. There are two endpoints, one model and one key format. This page lists every request field we forward, the response shape, the prices, the limits and the errors.
Ergo Model is an independent service, not affiliated with, endorsed by or operated by Amazon, AWS or OpenRouter. Requests reach the model through OpenRouter, pinned to providers that serve the full 1M-token context. For a step-by-step start, read the how-to-use guide.
Base URL & authentication
All requests go to this base URL.
https://ergomodel.net/api/v1| Endpoint | Auth | Purpose |
|---|---|---|
POST /chat/completions | API key | Create a chat completion, streamed or not. |
GET /models | None | List the model with its context length and prices. |
Authenticate with a bearer token in the Authorization header. Keys start with ergo_live_; create one in the dashboard (see /get-api-key). Keep the key on the server and never ship it in client code. The suggested environment variable name is ERGO_API_KEY.
Authorization: Bearer ergo_live_...Create a chat completion
POST /chat/completions takes a list of messages and returns an assistant message. Ergo always reasons before it answers. The reasoning is returned separately in message.reasoning, and the answer is in message.content.
curl https://ergomodel.net/api/v1/chat/completions \
-H "Authorization: Bearer ergo_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "ergo-1.0",
"messages": [
{ "role": "system", "content": "You are a concise senior engineer." },
{ "role": "user", "content": "How many r are in strawberry?" }
],
"reasoning": { "effort": "low" },
"max_tokens": 2048
}'Request parameters
| Field | Type | Description |
|---|---|---|
model | string | "ergo-1.0". See model names for aliases. Every request is served by this one model. |
messages | array | Required, non-empty. Conversation so far as { role, content } objects with role system, user, assistant or tool. Text only: the model has no image input. |
max_tokens | integer | Cap on generated tokens, reasoning included. Maximum 131,072. Set at least 2048 for short answers; AWS's own guidance is an output limit of 8,192 or higher. A small value (for example 300) returns empty content with finish_reason: "length". |
reasoning | object | Reasoning budget. Either { "effort": "low" | "medium" | "high" } or { "max_tokens": N }. Reasoning cannot be turned off; a request that tries returns 400. |
stream | boolean | When true, the response is sent as Server-Sent Events. Defaults to false. |
tools, tool_choice | array, string | object | Function calling in the OpenAI format. Tool calls come back in message.tool_calls. |
response_format | object | Structured outputs, for example { "type": "json_schema", "json_schema": { ... } }. |
temperature | number | Sampling temperature. The model's Hugging Face card recommends 1.0. |
top_p | number | Nucleus sampling. The model's Hugging Face card recommends 0.99. |
stop | string | array | Sequences that end generation. |
seed | integer | Sampling seed, forwarded as sent. |
Response
The upstream response is returned as received, in the standard OpenAI shape. The answer is at choices[].message.content, the reasoning text at choices[].message.reasoning, and token counts in usage.
{
"id": "gen-...",
"object": "chat.completion",
"created": 1796256000,
"model": "amazon/ergo-1.0",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "There are 3 letter r's in \"strawberry\".",
"reasoning": "s-t-r-a-w-b-e-r-r-y. r at positions 3, 8, 9. Three."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 31,
"completion_tokens": 342,
"total_tokens": 373,
"completion_tokens_details": { "reasoning_tokens": 329 }
}
}usage.prompt_tokensis billed at the input rate andusage.completion_tokensat the output rate.completion_tokensincludes reasoning tokens. When the upstream reports the split, it appears inusage.completion_tokens_details.reasoning_tokens.finish_reasonisstop,length(themax_tokensbudget ran out) ortool_calls.- The
modelfield in the response may show the upstream idamazon/ergo-1.0rather than the name you sent.
Streaming
Set stream: true to receive Server-Sent Events. Each data: line carries a chunk with partial text at choices[].delta.content; reasoning arrives first at choices[].delta.reasoning. A final frame with usage is always sent, whether or not you pass stream_options, and the stream ends with a literal data: [DONE] line.
curl -N https://ergomodel.net/api/v1/chat/completions \
-H "Authorization: Bearer ergo_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "ergo-1.0",
"messages": [{ "role": "user", "content": "Write a haiku about a build server." }],
"max_tokens": 2048,
"stream": true
}'data: {"id":"gen-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","reasoning":"Three lines, 5-7-5..."}}]}
data: {"id":"gen-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Fans spin"}}]}
data: {"id":"gen-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":" in the dark"}}]}
data: {"id":"gen-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"id":"gen-...","object":"chat.completion.chunk","choices":[],"usage":{"prompt_tokens":18,"completion_tokens":402,"total_tokens":420}}
data: [DONE]List models
GET /models is public and needs no key. Coding tools call it to fill their model picker. It returns the one model with its context length, maximum output and prices in USD per 1M tokens.
curl https://ergomodel.net/api/v1/models{
"object": "list",
"data": [
{
"id": "ergo-1.0",
"object": "model",
"created": 0,
"owned_by": "amazon",
"context_length": 1048576,
"max_output_tokens": 131072,
"pricing": {
"input_per_million_tokens_usd": 1.5,
"output_per_million_tokens_usd": 4.5
}
}
]
}Model names
- Model id:
ergo-1.0(Amazon Ergo, listed on Amazon Bedrock as Amazon Ergo-1.0). - Accepted aliases:
ergo,amazon-ergo,amazon/ergo-1.0. - There is only this one model. Any other model name is also served by
ergo-1.0, and is billed at its rate. - Context window: 1,048,576 tokens. Maximum output: 131,072 tokens.
- Modality: text in, text out. No image input.
- Reasoning: always on.
Background on the model itself is at /what-is-amazon-ergo and /context-window.
Pricing
| Token type | Price per 1M tokens |
|---|---|
| Input | $1.50 |
| Output (reasoning tokens included) | $4.50 |
| Cached input | $1.50 (no cache discount) |
The API is prepaid. Credit packs are $5, $10, $20, $50 (credits $55) and $100 (credits $115). Credits never expire and there is no subscription. Signing up and creating a key is free; calls need a balance. A 100,000-token prompt costs $0.15 of input, and 2,000 output tokens cost $0.009. Each response reports its own usage, so you can track spend per call. Details are on the pricing page; Amazon Bedrock and OpenRouter list lower per-token prices, and /amazon-ergo-api compares them.
Rate limits
Each API key may send 30 requests per minute. Beyond that the API returns 429 rate_limit_exceeded with a Retry-After header giving the seconds to wait. There is no separate token-per-minute limit; total usage is bounded by your credit balance. More on /rate-limits.
Errors
Errors use the OpenAI-style envelope, so SDKs surface the message directly.
{
"error": {
"message": "Rate limit exceeded: 30 requests per minute per API key. Retry in 12s.",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}| Status | Code | Meaning |
|---|---|---|
400 | — / upstream_error | Bad request (unparseable JSON, missing or empty messages), or the model rejected the request: check max_tokens, reasoning and context length. Disabling reasoning lands here. |
401 | missing_api_key | No Authorization: Bearer ergo_live_... header, or the key is malformed. |
401 | invalid_api_key | The key is unknown or has been revoked. |
402 | insufficient_credits | Zero balance. The message includes a top-up link to the dashboard. |
429 | rate_limit_exceeded | More than 30 requests per minute on this key. Wait for Retry-After seconds. |
503 | upstream_error | Upstream busy. Retry after a few seconds. |
502 | upstream_error | Upstream unavailable. Retry with backoff. |
A request that fails upstream is not charged: the credit held for it is returned.
What is and is not forwarded
| Handling | Fields |
|---|---|
| Forwarded as sent | messages, tools, tool_choice, response_format, temperature, top_p, max_tokens, stop, seed, reasoning, stream |
| Replaced | model (always resolved to ergo-1.0) |
| Stripped | models, route, plugins, web_search_options |
The stripped fields are OpenRouter routing and web-search options. They are removed so a request cannot fall back to a different model or start a paid web search.
SDKs
Because the API is OpenAI-compatible, any OpenAI SDK works: set base_url to https://ergomodel.net/api/v1 and api_key to your ergo_live_ key. See /openai-compatible-api for compatibility notes and /integrations for coding tools.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["ERGO_API_KEY"], # ergo_live_...
base_url="https://ergomodel.net/api/v1",
)
resp = client.chat.completions.create(
model="ergo-1.0",
messages=[{"role": "user", "content": "Explain a race condition in one line."}],
max_tokens=2048,
)
print(resp.choices[0].message.content)Questions: [email protected].