Claude Sonnet 5.5 API in Production, from $1.20 per 1M Input Tokens
If you are putting Claude Sonnet 5.5 behind a production feature, the short version is this: short answers come back in about 7 seconds at the median and answers over 4,000 tokens in about a minute, so stream long outputs and keep your SDK's default timeout; leave a fixed temperature and "thinking disabled" out of new code, because Sonnet 5.5 rejects both; and plan on $1.20 per million input tokens and $6 per million output tokens, 40% below Anthropic's $2 / $10 list price. The rest of this post backs each point.
Disclosure up front: the numbers below come from apimodels.app, which is the API I work on. apimodels.app is a multi-model API gateway: one API key and one OpenAI-compatible endpoint for image, video, audio and language models. Sonnet 5.5 is served there as claude-sonnet-5-5 on both /v1/chat/completions and the native Anthropic /v1/messages. Timing and failure figures come from our production traffic over the last 7 days (sample size not disclosed), rounded; model facts come from Anthropic's documentation.
Sonnet 5.5, Opus 5.5 or Haiku 5.5
All three have a 1M-token context window, up to 128K output tokens and adaptive thinking switched on by default. They differ in price and in the job Anthropic built them for.
- claude-sonnet-5-5 is the one Anthropic calls "the best combination of speed and intelligence": the sensible default for coding agents, bug fixing, documents and most chat features. Effort defaults to
high. - claude-opus-5-5 costs twice as much per token. Anthropic positions it for complex, open-ended work that needs sustained judgment. Its effort defaults to
medium, so set effort explicitly when comparing. - claude-haiku-5-5 is for high-volume, latency-sensitive work such as classification, extraction and routing. One rule to remember: when a single prompt goes over 100,000 tokens, every rate on that request is five times higher.
Anthropic itself suggests Haiku 5.5 as a subagent next to Sonnet 5.5 or Opus 5.5 on coding work. All three run on the same key, so moving a route is a one-word change.
Two ways to call it
Examples below, written against our docs and not run for this post; supply your own key and diff_text. With the OpenAI SDK:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["APIMODELS_API_KEY"],
base_url="https://api.apimodels.app/v1",
max_retries=0, # retry in your own code, by error type
)
raw = client.chat.completions.with_raw_response.create(
model="claude-sonnet-5-5",
messages=[
{"role": "system", "content": "You review Python pull requests. Be specific."},
{"role": "user", "content": diff_text},
],
max_tokens=8000, # thinking tokens count against this too
reasoning_effort="medium", # becomes Claude's effort setting
stream=True,
stream_options={"include_usage": True},
)
request_id = raw.headers.get("x-apimodels-request-id") # keep it for billing lookups
for chunk in raw.parse():
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
With the Anthropic SDK, set base_url to the host only; the SDK adds /v1/messages itself:
import os
import anthropic
client = anthropic.Anthropic(
api_key=os.environ["APIMODELS_API_KEY"],
base_url="https://api.apimodels.app",
)
with client.messages.stream(
model="claude-sonnet-5-5",
max_tokens=8000,
output_config={"effort": "medium"},
system="You review Python pull requests. Be specific.",
messages=[{"role": "user", "content": diff_text}],
) as stream:
for text in stream.text_stream:
print(text, end="")
message = stream.get_final_message()
print(message.stop_reason, message.usage)
What Sonnet 5.5 rejects, and what happens here
Code written for older Claude models trips over Sonnet 5.5 in four places:
- Sampling parameters. A non-default
temperature,top_portop_kis a 400 on Anthropic's API, and many OpenAI-style clients sendtemperatureon every call. Here these fields are dropped for Sonnet 5.5 on both endpoints, so the call succeeds but the value has no effect. - Turning thinking off.
thinking: {"type": "disabled"}is also a 400. The lowest setting Anthropic accepts is{"type": "between_tools"}, and only at efforthighor below. On the native endpoint,disabledis rewritten tobetween_toolswhen the effort allows it; otherwise thinking stays adaptive. - Effort. On the OpenAI-compatible endpoint,
reasoning_effort(low,medium,high,xhighormax) is passed on as Claude's effort;noneandminimalbecomelow. Lower effort means fewer thinking tokens: the main lever on speed and cost. - max_tokens. Left out on the OpenAI-compatible endpoint, it becomes 120,000 rather than a small default, so long answers are not cut off early. Thinking counts against it, so a tight value can end a response before any visible text.
In streaming UIs, note that Sonnet 5.5 returns its thinking with the text left empty by default, so the first visible words can arrive well after the request starts. Effort is the speed control: for chat-style routes, try low or medium and measure.
How long it takes
End-to-end time from request to last token, successful requests only, grouped by output length (output tokens include thinking):
| Output length | p50 (s) | p90 (s) |
|---|---|---|
| Under 1,000 tokens | 7 | 31 |
| 1,000 to 4,000 tokens | 32 | 105 |
| 4,000 tokens or more | 68 | 200 |
| All requests | 12 | 87 |
What to do with them:
- Stream anything long. One answer in ten above 4,000 tokens takes more than three minutes. Streaming shows progress and keeps idle-connection limits from cutting you off.
- Keep generous timeouts on non-streaming calls. Both official SDKs default to 10 minutes; leave it there. A non-streaming request that runs past about 95 seconds gets its response headers early and is kept alive, and the request id and cost then arrive in an
apimodelsfield of the JSON body instead of in headers.
What fails, and what to retry
Over the same 7 days, fewer than 1% of Sonnet 5.5 requests failed. Those failures were long streamed answers where output stopped arriving partway through. The gateway closes such a stream after 180 seconds without progress, appends an error event so your client knows the answer is incomplete, and does not bill it.
Sonnet 5.5 has two upstream routes. If the first returns a rate limit, a server error or a connection failure before the answer starts, the request is retried briefly and then sent to the second route; your code sees one normal response. Over these 7 days no Sonnet 5.5 request needed the second route. Once tokens are streaming, a request cannot switch routes, which is why the stall rule above exists.
Rules for your own retry code:
- HTTP 429, a 5xx, or a dropped connection before any output: retry up to twice, a few seconds apart. Failed requests are not billed.
- A stream that ends with an error event: the partial answer is not billed; resend the whole request.
- HTTP 400: do not retry. Fix the request, for example a prompt longer than the 1M-token window.
finish_reason: "content_filter"(OpenAI format) orstop_reason: "refusal"(native): Anthropic's safety classifiers declined the request. It is a completed response, not a transport error: check for it before reading the content, and do not loop on the same prompt.- A timeout on your side: the generation keeps running on the server and may still be billed. That is why the example sets
max_retries=0: an automatic SDK retry after a timeout can pay twice.
Checking what each call cost
Every response carries an x-apimodels-request-id header; non-streaming responses also carry x-apimodels-cost, the amount actually deducted in US dollars. For streaming calls, look the id up with GET https://api.apimodels.app/v1/records/{id}, which returns the final amount, token usage split into input, output, cache reads and cache writes, and whether the charge has settled. Failed requests show 0, and the lookup is free. See the per-request billing reference for the full format.
Prices, as of October 27, 2026
Per 1M tokens, in US dollars, next to Anthropic's standard list price:
| Model | Input | Output | Anthropic list (input / output) |
|---|---|---|---|
| claude-sonnet-5-5 | 1.20 | 6.00 | 2.00 / 10.00 |
| claude-opus-5-5 | 2.40 | 12.00 | 4.00 / 20.00 |
| claude-haiku-5-5, prompt up to 100K | 0.09 | 0.45 | 0.10 / 0.50 |
| claude-haiku-5-5, prompt over 100K | 0.45 | 2.25 | 0.50 / 2.50 |
Input and output on Sonnet 5.5 and Opus 5.5 are 40% below list, and Haiku 5.5 is 10% below at both prompt sizes. On Sonnet 5.5, prompt caching bills cache writes at $1.50 and cache reads at $0.12 per 1M tokens. Thinking tokens bill at the output rate, and there is no monthly fee. Parameters and FAQ are on the Claude Sonnet 5.5 model page.
A worked cost estimate
Say a nightly job reviews 500 pull requests, each sent as about 20,000 input tokens of diff and guidelines, each review coming back at about 2,000 output tokens, thinking included:
Input 500 x 20,000 = 10M tokens x $1.20 = $12.00
Output 500 x 2,000 = 1M tokens x $6.00 = $6.00
Per night $18.00
30 nights $540.00
At Anthropic's list price the same tokens cost $30.00 a night. The job would be $1.35 a night on Haiku 5.5 (every prompt stays under 100,000 tokens) and $36.00 on Opus 5.5. Two caveats: output includes thinking, so measure usage on 20 real requests at your chosen effort before multiplying; and if the guidelines repeat in every prompt, caching them brings the input line down.
When not to use it
- Your pipeline is built on Anthropic's Message Batches API. There is no Batch endpoint here, so keep batch workloads on Anthropic directly.
- You need a direct contract with Anthropic, for example zero data retention terms, committed spend or enterprise compliance paperwork. Those come with an Anthropic account, not with a gateway.
- Most of your calls are short classification or extraction. That is Haiku 5.5's job at a fraction of the price; Sonnet 5.5 there mostly pays for thinking you do not need.
If none of those apply, change base_url in code you already have and send one short request. The LLM API reference covers both endpoints, and every request with its exact charge shows up under Usage in the console.
Drafted with AI assistance; prices and numbers checked against our API docs and records on Oct 25, 2026.
评论
发表评论