Skip to main content

Choose a Claude Sonnet API Version for an Editing Workflow

Compare Sonnet 4.5, 4.6, 5 and 5.5 controls, token costs and output limits, then migrate an editing request with checks for incomplete replies.

Published
Read
13 min read
Updated
Add SpicyAPI to your favorites on Google
Two invented adults discuss a script in a warm radio editing studio beside a microphone and recorder; independent editorial artwork.

An editing integration carries more than a model name: it may depend on a sampling setting, a forced function call or a reply parser. A version upgrade can change all three before it changes the quality of the edit.

Pick Sonnet 5 for a new build, Sonnet 5.5 when you need replies longer than 64,000 tokens, uncensored fiction or the widest effort range, and choose Sonnet 4.6 for temperature, top_p or top_k controls. Sonnet 5 also supports forced tool calls; 5.5 does not. Changing the model ID alone breaks a request: Sonnet 5 and 5.5 return a 400 error for sampling fields, and 5.5 also rejects forced tool choice. Strip those fields per version before you compare any answers.

The table describes SpicyAPI’s hosted contracts. Anthropic’s Sonnet 5.5 migration guide explains native version changes; its field names and defaults are not interchangeable with this interface. Prices below are USD per million tokens.

What each version accepts

ContractSonnet 4.5Sonnet 4.6Sonnet 5Sonnet 5.5
Input limit198,000 tokens1,000,0001,000,0001,000,000
Output ceiling64,00064,00064,000128,000
Default max_tokens4,0964,0964,0964,096
reasoning_effortNot exposedlow, medium, high, maxlow, medium, highnone, low, medium, high, xhigh, max
Default effort—mediummediummedium
temperature, top_p, top_kExposedExposedRejectedRejected
tool_choiceauto, none, required or a named functionsamesameauto or none only
response_formatNot acceptedNot acceptedNot acceptedNot accepted
Content tierSoftenedUncensoredFilteredUncensored

The IDs are anthropic/claude-sonnet-4.5/chat, anthropic/claude-sonnet-5/chat, anthropic/claude-sonnet-5.5/chat and anthropic/claude-sonnet-4.6/chat; the pages are 4.5, 5, 5.5 and 4.6. All four use the same /v1/chat/completions request shape and also accept stop, tools and parallel_tool_calls.

Sonnet 4.6 is an intermediate migration option. It already has the 1M window and reasoning_effort, yet still takes temperature. Moving 4.5 to 4.6 keeps the request shape but raises the input rate 11%, lifts the tier from Softened to Uncensored and defaults to medium reasoning effort; 4.6 to 5 is the step that removes sampling.

The content tier matters for fiction and roleplay. Sonnet 5 is Filtered; Sonnet 4.5 and 4.6 often softened or refused fiction requests at the stronger content levels in our tests. Sonnet 5.5 delivered those tested scenes without softening or refusal, making it the stronger choice here for unfiltered fiction. A softened reply can still be billed. SpicyAPI adds no platform-level content filter; specify the fictional scene and editing constraints in the system message.

Which one to pick

  • New text integration that stays SFW: Sonnet 5. It has the lowest rates, a 1M window and three effort levels.
  • Long deliverables or unfiltered fiction: Sonnet 5.5. It is the only one that can write more than 64,000 tokens in one reply, the only one with none (no thinking) and it is Uncensored.
  • Sampling controls: stay on a pinned 4.5 integration or move to 4.6 for the 1M window. Forced function calls without sampling: Sonnet 5 accepts them at lower rates; use it instead of 5.5 when the call must be forced.
  • A whole 300,000-token manuscript in one call: that is a context and cost question, covered in the Sonnet 4.6 long-manuscript guide.

Price: account for the tokenizer and billed output

USD per million tokens4.54.655.5
Input$2.70$3$1.90$2
Cached input$0.27$0.30$0.19$0.20
Output$13.50$15$9.50$10
Cache writes$3.30$3.75$2.375$2.50

Sonnet 5 and 5.5 use a newer tokenizer. Anthropic's migration guide says the same text produces about 30% more tokens than on 4.x, depending on content, so compare cost per task, not per token. For an illustrative job measuring 20,000 input and 2,000 output tokens on 4.5, assume a 30% increase in both token counts on 5 and 5.5:

ModelTokens billedCost
4.520,000 in, 2,000 out$0.081
4.620,000 in, 2,000 out$0.090
5about 26,000 in, 2,600 outabout $0.074
5.5about 26,000 in, 2,600 outabout $0.078

In that scenario Sonnet 5 is about 9% below 4.5; the saving is not fixed for every document. The output counts must include billed reasoning. Setting effort to low can reduce thinking, but does not turn it off; only 5.5 exposes none here. Read usage from your actual task before treating the estimate as a budget.

Sonnet 5.5’s rates are about 5.3% above Sonnet 5, so that is the difference at identical billed counts and cache categories. Recount long prompts after a tokenizer change: a hypothetical 30% increase would turn a 190,000-token prompt into 247,000, still below the 1M input ceiling but with a different bill.

Try the edit in Playground

Use this small fact-checking edit before migrating a larger workflow:

Source A: the gallery reopened to staff in April. Source B: the public launch event was in June. Draft: "The gallery reopened to the public in April." Preserve the distinction between staff access and the public event. Return the corrected sentence and one sentence explaining the change.

  1. Open the Sonnet 5.5 model page linked above and choose Playground. Put the two sources and draft in the user message, with "Edit from the supplied sources only" as the system instruction.
  2. Use low effort for this line edit. Run it after reviewing the cost, then check that the answer keeps April for staff access and June for the public event, without inventing an exact date.
  3. Try the same text on Sonnet 5 for a lower-cost SFW editing workflow. Keep the source text unchanged so you can judge the edit itself.

Choose a version for the edit you actually deliver

For a 700-word chapter cleanup with a 20,000-token source packet, none of these versions needs its maximum context or output allowance. The useful choice is whether the request's controls and content suitability fit. Sonnet 5 is the lower-price starting point for an ordinary edit. An editor of unfiltered fiction should also consider its Filtered tier before making it the default for the entire manuscript. The same application's non-graphic synopsis and its review of stronger scenes can therefore need different model choices.

If you want three alternate phrasings on 4.5 or 4.6, their sampling controls give you an accepted way to vary generation. That does not mean raising temperature repairs bad story logic. A paragraph that gives a character information they do not yet know needs the knowledge rule and the source passage; it does not need more randomness. On 5 or 5.5, do not invent an equivalent sampling field. Ask for three alternatives with different stated approaches: shorter dialogue, less exposition or a later reveal.

For a tool-assisted edit, imagine the draft names a character's employer but the authoritative series database has the current record. On 4.5, 4.6 or 5, the exposed tool choice can require a lookup. On 5.5, auto can produce a reply without the lookup. If your application must verify the employer, perform the read before asking for the edit, or refuse to accept an answer without the required lookup result. A sentence in the prompt does not give auto the same guarantee as a forced call. Native thinking or output_config examples from Anthropic's migration guide should not be pasted into this request unchanged.

The meaningful output of the sample is a sentence that preserves both April staff access and June public launch. "The gallery reopened in June" is too broad if staff could already enter in April. "The gallery held its public launch in June, after reopening to staff in April" is an acceptable human-written repair. A new version that produces prettier wording while losing this distinction has not improved the editing job.

Migrate the request

A 4.5 integration may use temperature: 0.2, top_p: 0.9 and a forced submit_edit function. Moving to 5 rejects the sampling fields; moving to 5.5 rejects both sampling and forced tool choice.

  1. Remove sampling on 5 and 5.5. Delete temperature, top_p and top_k from those requests. Unsupported fields return 400 unsupported_parameter before a task is created or charged; keep a per-model allowlist instead of sending one shared parameter object.
  2. Use an automatic tool on 5.5. Keep the submit_edit function and request it in the system prompt, but set tool_choice to auto. There is no response_format here, and 5.5 can skip the function, so validate the returned arguments. If your workflow requires a forced call, Sonnet 5 supports it at lower rates.
  3. Leave room for the answer. Reasoning consumes part of max_tokens: a 1,024-token cap can run out before visible text appears. Use low effort for a line edit and high for conflicting sources. Sonnet 5 stops at high; it does not accept 5.5's xhigh or max.
  4. Stream longer edits. The short example below uses a normal JSON response. Large calls can outlast the network edge's roughly 100-second limit; use streaming for those and assemble text and tool arguments separately. The text and streaming guide covers completion events and usage.
  5. Finish the conversation with a user message. Move an intended opening or format hint into the system instruction rather than ending with an assistant prefill when migrating away from 4.5.

Effort names also change meaning. Anthropic recalibrated 5.5's levels, so high is not equivalent across versions. SpicyAPI defaults both 5 and 5.5 to medium, while Anthropic's native 5.5 API defaults to high. For clean short answers, prefer low to none: with none, 5.5 can work through the question in visible text. none remains useful for quick in-character turns.

Run and validate the edit

Save this as sonnet_edit.py, set SPICY_API_KEY from API Keys, then run python3 sonnet_edit.py. It uses Python's standard library. Sonnet 5.5 is chosen here to demonstrate its automatic-tool migration; changing only the model to Sonnet 5 also accepts these fields. This is a paid text call, not a media-generation task. The chat recipes cover multi-turn and streaming integrations.

python
import json
import os
import sys
import uuid
from urllib.error import HTTPError
from urllib.request import Request, urlopen

def read_reply(resp: dict, *, require_edit_tool: bool = False) -> dict:
    if resp.get("error"):
        raise RuntimeError("API error")
    choices = resp.get("choices") or []
    if not choices:
        raise RuntimeError("no choices in response")
    choice = choices[0]
    finish = choice.get("finish_reason")
    if finish not in {"stop", "tool_calls"}:
        raise RuntimeError(f"incomplete or rejected reply: {finish}")
    msg = choice.get("message") or {}
    calls = msg.get("tool_calls") or []
    if calls:
        if len(calls) != 1:
            raise RuntimeError("expected one submit_edit call")
        call = calls[0]
        if call.get("type") != "function" or not isinstance(call.get("id"), str) or not call["id"]:
            raise RuntimeError("missing function type or call ID")
        fn = call.get("function") or {}
        if fn.get("name") != "submit_edit":
            raise RuntimeError("unexpected function")
        args = json.loads(fn.get("arguments") or "")
        if not isinstance(args, dict) or any(
            not isinstance(args.get(key), str) or not args[key].strip()
            for key in ("sentence", "reason")
        ):
            raise RuntimeError("sentence and reason must be nonempty strings")
        return {"kind": "tool", "call": calls[0], "edit": args}
    if require_edit_tool:
        raise RuntimeError("model skipped submit_edit")
    text = msg.get("content")
    if finish != "stop" or not isinstance(text, str) or not text.strip():
        raise RuntimeError("empty or unfinished text")
    return {"kind": "text", "text": text}


def main() -> None:
    body = {
        "model": "anthropic/claude-sonnet-5.5/chat",
        "reasoning_effort": "low",
        "max_tokens": 8192,
        "messages": [
            {"role": "system", "content": "Edit from the supplied sources only. Reply by calling submit_edit."},
            {"role": "user", "content": 'Source A: the gallery reopened to staff in April. Source B: the public launch event was in June. Draft: "The gallery reopened to the public in April." Keep the staff/public distinction.'},
        ],
        "tools": [{"type": "function", "function": {
            "name": "submit_edit",
            "description": "Return the corrected sentence and the reason.",
            "parameters": {
                "type": "object",
                "properties": {"sentence": {"type": "string"}, "reason": {"type": "string"}},
                "required": ["sentence", "reason"],
            },
        }}],
        "tool_choice": "auto",
    }
    request = Request(
        "https://api.spicyapi.ai/v1/chat/completions",
        data=json.dumps(body).encode(),
        headers={
            "Authorization": f"Bearer {os.environ['SPICY_API_KEY']}",
            "Content-Type": "application/json",
            "Idempotency-Key": str(uuid.uuid4()),
            "User-Agent": "sonnet-edit-example/1.0",
        },
    )
    try:
        with urlopen(request, timeout=80) as response:
            task_id = response.headers.get("X-Spicy-Task-Id")
            if task_id:
                print(f"Task ID: {task_id}", file=sys.stderr)
            result = read_reply(json.load(response), require_edit_tool=True)
    except HTTPError as error:
        task_id = error.headers.get("X-Spicy-Task-Id")
        print(f"HTTP {error.code}; task ID: {task_id or 'not returned'}", file=sys.stderr)
        raise
    print(json.dumps(result["edit"], indent=2))


if __name__ == "__main__":
    main()

A valid edit keeps April for staff access and June for the public event. The parser rejects an empty answer, truncation and a skipped or malformed function call; valid arguments still need that factual check. A Sonnet migration report describes an empty fallback reaching users as a successful result.

If finish_reason is length, use more output room or a smaller assignment for a new call. Preserve any partial result and task ID before spending again. In a multi-turn tool workflow, return the tool result with its matching tool_call_id before the next turn. Include one contradiction, one unchanged fact, one "unknown" answer and one "no match" tool result in your migration checks; for longer extractions, check that required sections are present as well as valid JSON.

Let an Agent prepare the integration

Use an Agent when you want it to adapt an existing editor rather than paste a request yourself. Keep the same gallery sources and draft in its assignment.

  • CLI: after setting SPICY_API_KEY, let it inspect the chosen contract with npx @spicyapi/cli models get anthropic/claude-sonnet-5.5/chat --json. The CLI guide documents that read-only command.
  • MCP: with the SpicyAPI MCP server connected, ask: "Use spicyapi_model_get for anthropic/claude-sonnet-5.5/chat, then adapt my gallery edit to its accepted effort and tool-choice settings. Prepare the request without running it."
  • Skill: install the official SpicyAPI Skill with npx skills add spicyapi-ai/spicy-skill, start a new Agent session, then ask: "Use the SpicyAPI Skill to migrate my gallery editor from Sonnet 4.5 to 5.5. Keep the source facts and validate submit_edit; show me the request before calling it."

CLI and MCP supply model discovery for this text workflow; the edit itself uses /v1/chat/completions through the program above or your Agent's HTTP client. Set a spending limit on the API key before delegating repeated edits.

FAQ

Is Sonnet 5.5 cheaper than Sonnet 5?

No. It costs about 5.3% more per token ($2 and $10 against $1.90 and $9.50). A task costs that much more only when billed token counts and cache categories are identical. The extra buys the 128,000-token reply ceiling, none and xhigh effort and the Uncensored tier.

Is Sonnet 5.5 better than Opus 5.5?

Not as a rule. Opus 5.5 costs $3.60 in and $18 out on SpicyAPI, about 1.8 times Sonnet 5.5, with the same 1M window and 128,000 output ceiling. Start on Sonnet 5.5 and move up only if your own hardest passages come back wrong; the Opus 5.5 roleplay guide covers that route.

Can I keep temperature on Sonnet 5.5?

No. Use reasoning effort for depth and put tone rules in the system prompt. If you need sampling controls, 4.5 and 4.6 are the options.

About this article

Who writes
Written by SpicyAPI Engineering and published by SpicyAPI.
How we test
Our model reviews test each model through the public SpicyAPI API with default settings, the way a customer would call it. Methodology v3.3Model reviews
Disclosure
We sell API access to the models in this article; review scores ignore price. Conflict-of-interest statement
Corrections
Spotted an error? Tell us on the contact page

Also in 日本語 · 한국어 · Deutsch · Français · Español · Português (Brasil) · Русский · Italiano · Polski