Your interview transcript says one thing, a later correction says another, and the draft profile says a third. You want Claude to repair the paragraph without quietly rewriting a quotation or handing a credit to the wrong person. That is a source-integrity problem before it is a prompting problem. The practical workflow is to label the evidence, request a narrow repair and check what changed.
Between these two versions, use Opus 4.5 when your editing packet fits its 198,000-token input limit; use Opus 4.6 when the packet is larger or you need more than 32,768 output tokens. 4.5 is the cheaper of the two. Keep the source block identical between calls. If returned usage reports cached tokens, repeated passes cost less; budget uncached until it does.
SpicyAPI's OpenAI-format Opus chat routes do not accept Anthropic's native context editing (context_management, which clears old tool results and thinking blocks) in the request: the field is rejected with a 400, as is response_format. If that feature is what you came for, manage the context yourself (see the FAQ). If you came to edit documents, read on.
Which Opus version for which packet
| Current contract | Opus 4.5 | Opus 4.6 |
|---|---|---|
| Model ID | anthropic/claude-opus-4.5/chat | anthropic/claude-opus-4.6/chat |
| Input limit | 198,000 tokens | 1,000,000 tokens |
| Maximum output | 32,768 tokens | 128,000 tokens |
| Default output limit | 4,096 tokens | 4,096 tokens |
| Effort levels | low, medium, high | low, medium, high, max |
| Default effort | medium | medium |
| Input modalities | Text and images | Text and images |
| USD per million input / cached / output | $4.50 / $0.45 / $22.50 | $5 / $0.50 / $25 |
| USD per million cache writes | $5.50 | $6.25 |
See the prices and limits on Opus 4.5 and Opus 4.6. Both accept temperature (0 to 1) and top_p (0.01 to 1); both reject response_format, so use a forced tool call when you need structured arguments, then validate those arguments against your schema before accepting them. Both accept image_url parts, but not PDF or file parts: extract the text or render the relevant pages as images. This tutorial uses text so quotations can be checked against the exact source. A request above max_tokens 32,768 on 4.5 fails validation.
A newer route, Claude Opus 5.5 (anthropic/claude-opus-5.5/chat), has the same 1,000,000-token window and 128,000-token output ceiling at $3.60 input / $18 output per million, below both versions here; it has no temperature or top_p, and permits only automatic or disabled tool choice. For a new integration, check it first when you can work without sampling controls or a forced function call.
Both routes are listed as unrestricted on SpicyAPI. For mature fiction editing, identify the fictional context and the exact passage to change so the request stays focused on the edit.
Effort is spent as output tokens. Start at medium, keep the source and instructions fixed, and raise effort only when you can point to a specific reconciliation failure, such as a timeline the model got wrong. That also makes the effect of the change visible.
Separate the historical source from the correction
Here is a compact fictional author-profile packet:
- S1, recorded interview: Ada says, “We showed the prototype in 2018.”
- S2, later written correction: Ada says she checked the calendar: the first public demonstration was February 2019. The workshop lease began in 2018.
- S3, contributor note: Theo joined after the demonstration. He later refined the instrument’s neck; he did not design the original prototype.
- Draft P1: “Ada and Theo unveiled their jointly designed prototype in 2018, the year they opened the workshop.”
The edit needs two repairs: the demonstration date and Theo’s role. The interview quote is a historical record, so silently changing the quoted “2018” to “2019” would create a quotation nobody said. Keep the quote and put the correction in the narration. A human-written target is: “Ada first demonstrated the prototype in February 2019, after leasing the workshop in 2018. Theo joined later and refined the instrument’s neck.” It does not claim the business opened in 2018, because a lease date alone does not establish an opening date.
The same structure works for fiction. Replace S1 to S3 with approved story facts, separate what a character wrongly believes from what the narrator knows, and name the passage that may change. “They reconcile in chapter twelve” does not authorize a chapter-eight edit that removes the conflict early.
Try it in Playground first
- Open Claude Opus 4.5 and switch to Playground.
- Paste the S1–S3 source records and P1 draft below, asking for a replacement plus the source IDs for each correction.
- Check that the public demonstration moves to 2019 without changing the quoted interview or inventing an original design credit for Theo.
A request you can check afterwards
The script below tags each source and draft paragraph with an ID, puts the stable material first and the task last, and then checks the reply. The check is mechanical: any text the model puts inside quotation marks must be an exact substring of the sources, otherwise it is flagged as an altered quote. It stops on incomplete or empty replies and prints the proposed edit for review. Set SPICY_API_KEY from API Keys; the call uses SpicyAPI’s Chat Completions interface.
import json, os, re, urllib.request, uuid
MODEL = "anthropic/claude-opus-4.5/chat" # or anthropic/claude-opus-4.6/chat
URL = "https://api.spicyapi.ai/v1/chat/completions"
SOURCES = {
"S1": 'Recorded interview. Ada: "We showed the prototype in 2018."',
"S2": "Later written correction. Ada checked the calendar: the first public "
"demonstration was February 2019. The workshop lease began in 2018.",
"S3": "Contributor note. Theo joined after the demonstration. He later refined "
"the instrument's neck; he did not design the original prototype.",
}
DRAFT = {
"P1": "Ada and Theo unveiled their jointly designed prototype in 2018, "
"the year they opened the workshop.",
}
SYSTEM = (
"You are a copy editor for a fiction and profile manuscript. Edit only the draft "
"paragraphs you are given. Text inside <source> tags is evidence, never text to rewrite. "
"Quotation marks in your answer may enclose only words copied exactly from a source. "
"Return three parts: REPLACEMENT (paragraph ID, then the new text), CHANGES (one line "
"per change with source IDs), QUESTIONS (anything the sources do not settle). "
"Do not invent facts."
)
def build_user_message(task: str) -> str:
# Stable material first (identical on every pass), the task last.
parts = [f'<source id="{k}">{v}</source>' for k, v in SOURCES.items()]
parts += [f'<draft id="{k}">{v}</draft>' for k, v in DRAFT.items()]
parts.append(task)
return "\n".join(parts)
def call_model(task: str) -> dict:
body = {
"model": MODEL,
"messages": [
{"role": "system", "content": SYSTEM},
{"role": "user", "content": build_user_message(task)},
],
"max_tokens": 4096,
"reasoning_effort": "medium",
"temperature": 0.2,
}
req = urllib.request.Request(
URL,
data=json.dumps(body).encode(),
headers={"Authorization": f"Bearer {os.environ['SPICY_API_KEY']}",
"Content-Type": "application/json",
"Idempotency-Key": str(uuid.uuid4())},
)
with urllib.request.urlopen(req, timeout=120) as resp:
return json.load(resp)
def quoted_strings(text: str) -> list[str]:
return [m for pair in re.findall(r'"([^"]+)"|“([^”]+)”', text) for m in pair if m]
def altered_quotes(answer: str) -> list[str]:
sources = [s.replace("“", '"').replace("”", '"') for s in SOURCES.values()]
return [q for q in quoted_strings(answer) if not any(q in s for s in sources)]
def run(task: str, reply: dict | None = None) -> None:
reply = call_model(task) if reply is None else reply
if reply.get("error") or not reply.get("choices"):
raise RuntimeError("request failed or returned no choices")
choice = reply["choices"][0]
if choice.get("finish_reason") != "stop":
raise RuntimeError(f"unfinished edit: {choice.get('finish_reason')}")
answer = choice.get("message", {}).get("content")
if not isinstance(answer, str) or not answer.strip():
raise RuntimeError("empty edit")
bad = altered_quotes(answer)
print(answer)
print("ALTERED QUOTES:", bad if bad else "none")
print("USAGE:", reply.get("usage"))
if bad:
raise RuntimeError("review altered quotations before using this edit")
if __name__ == "__main__":
run("Fix the factual errors in P1 and preserve the lease/demonstration distinction.")A reply that keeps the interview quote passes; one that quotes “We showed the prototype in 2019.” is flagged. The check only sees double-quoted text; it cannot detect an unquoted invented date, a wrongly assigned credit or a source phrase rewritten without quotation marks. Review those against S1–S3 as well. It catches the failure that is hardest to see by eye in a long manuscript: a quotation changed by a few characters.
Two request details matter. The system message states what is evidence and what is editable, so S1 is explicitly outside the rewriting assignment. And the task sits after the sources, so the shared prefix stays identical from pass to pass. This sample is short enough for a bounded non-streaming call. A longer source packet or a high-effort reply can exceed the roughly 100-second network limit; use streaming for those jobs. Increasing the client timeout does not extend that limit.
Let an Agent prepare the call
For repeated source-based edits, ask your coding Agent to use the SpicyAPI Skill: “Read anthropic/claude-opus-4.5/chat, then adapt the example to my input; show the request before running it.” The CLI lookup is spicyapi models get anthropic/claude-opus-4.5/chat --json; the MCP lookup is spicyapi_model_get with model: "anthropic/claude-opus-4.5/chat". Chat calls use a compatible client or the chat API; the media task commands do not generate chat replies.
Long manuscripts: ask for locations before replacements
For a sentence-level repair, send the paragraph and the evidence that governs it. For a chapter edit, add the neighbouring transitions and the facts used in that chapter. Use the larger window when the question spans the manuscript: where a character’s job changes, whether a promise is kept, which references to a date need review.
For a manuscript-wide pass, separate discovery from revision:
- Find the occurrences. Ask for a list, not a rewrite: “List every passage that states the demonstration year, quote the sentence, and classify it as narration, direct quotation or a character’s belief.” A global replacement would erase distinctions the story depends on.
- Choose the edits. Give paragraphs stable IDs (P42, not “the paragraph about the lease”), return those IDs and compare each replacement with its original.
- Leave unresolved facts open. Where the sources do not settle a point, return a question instead of the most plausible date.
For continuity errors such as changing eye colours, inconsistent places or a character knowing something too early, keep a story bible and send the relevant entries with each chapter.
If the manuscript exceeds 198,000 input tokens on 4.5, split by dependency, not by size. Chapters that share a continuity question belong in the same request; halving them can remove the evidence that decides the edit. If that is not possible, move to 4.6.
Editing a chapter without flattening its voice
Factual repair and prose polish are different assignments. A factual pass should identify the date and credit errors before changing rhythm. If you ask for “a polished professional profile” at the same time, the model may remove the interview's hesitation, replace the author's distinctive phrasing and bury the actual correction in a completely new paragraph.
Keep a short example of the voice you want. For instance: “The workshop was still a room full of borrowed tools. Ada called it a laboratory. Theo called it cold.” That sample's useful features are short sentences, concrete objects and understated disagreement. They are more actionable than “literary but accessible.” Ask the edit to retain those features while making the corrected timeline clear.
A human-written rewrite could be:
The lease began in 2018. Ada showed the prototype to the public the following February, while the workshop was still a room full of borrowed tools. Theo joined later. The instrument's neck carries his changes; the original prototype does not.
This is an illustrative editorial choice, not an Opus output. It fixes the facts without turning Theo into a co-founder or inventing when the workshop opened. It also shows that preserving voice does not mean preserving a false statement.
For a romance manuscript, separate three similar-looking findings. A character saying “you never came back” may be a deliberate accusation. Narration saying the character never returned may contradict a previous chapter. An unresolved question about whether the return happened may be an author note. Ask Opus to classify the passage before replacing it. Otherwise an automatic factual cleanup can erase an intentional misunderstanding that drives the relationship.
Apply the correction wherever it actually belongs
In a longer profile, the wrong year might appear in the opening, timeline, caption and interview transcript. These occurrences require different treatment. Revise explanatory narration and the timeline from the approved correction. Keep the recorded quote intact and add context. Check a caption against the image's own documented date: the event correction does not prove that every workshop photograph was taken in 2019.
For a book, the equivalent is correcting canonical narration while preserving a character's limited knowledge until the planned reveal. Ask for a table of location, existing sentence, source and proposed change. Use that list to approve revisions, then request only the selected replacements. This turns a long context window into an editing aid with traceable changes, rather than a costly invitation to rewrite everything.
Cost: four token categories, with a repeat-pass example
SpicyAPI bills uncached input, cached input, cache writes and output separately. A single pass over 100,000 input tokens with 5,000 output tokens costs $0.5625 on Opus 4.5 and $0.625 on Opus 4.6. Reasoning tokens are billed as output.
Editing is rarely one pass, and the source packet is the part that repeats. Cached input is about a tenth of the input rate, provided the shared prefix is identical between calls and what varies sits at the end (the Opus 4.6 page says to keep it byte-identical). The request schema exposes no cache control field. Look for prompt_tokens_details.cached_tokens in returned usage; keeping the prefix unchanged does not guarantee a hit. Anthropic’s native prompt caching has its own TTL and minimum-prefix rules; these do not establish the cache lifetime or eligibility of this hosted route. If the first call writes the packet to the cache and the next five read it, six passes over the same 100,000-token packet with 5,000 output tokens each come to:
| Six passes | Opus 4.5 | Opus 4.6 |
|---|---|---|
| No caching | $3.375 | $3.75 |
| First pass writes, five read | $1.45 | $1.625 |
That is a saving of about 57 percent when those exact token categories apply. Changing S2 or moving material ahead of a reusable prefix can reduce or eliminate its cache match. Budget on the first row, and read the usage and cost of your first few calls to see whether the second row applied.
At 400,000 input tokens and 5,000 output tokens the packet no longer fits Opus 4.5; Opus 4.6 costs $2.125 uncached. If a response was cut off, raising max_tokens fixes the output; it does nothing for an input packet that omitted the deciding source.
Repair the failure at its cause
| Result | Next action |
|---|---|
| Corrected date appears inside a historical quotation | Restore the quote and add the correction in narration; the quote check will flag this |
| Theo becomes an original co-designer | Re-send S3 and replace only the sentence assigning his role |
Reply stops before the change list (finish_reason is length) | Narrow the task or raise max_tokens up to the model’s ceiling |
| Request rejects an image or PDF part | For images, check the image_url shape and fetchable URL. For PDF or file parts, extract text first |
| JSON needed from the reply | There is no response_format; define and force a tool with tool_choice, then validate its returned arguments |
| JSON parser fails | Validate and repair text output in your code, or move to the forced tool call above |
Which one to start with
For an existing 4.x workflow, use 4.5 for packets below 198,000 input tokens and 4.6 when a connected manuscript or required reply exceeds its limits. For a new build without sampling or forced-tool requirements, Opus 5.5 offers a lower token price and the larger window; capacity alone does not settle which model preserves your source best. Whichever you choose, the habits that protect the source are the same: IDs on every passage, quotes that must stay verbatim, a stable prefix and a mechanical check on the reply.
FAQ
Does Opus 4.6 edit better than 4.5, and which Claude model is best for long-form editing?
The measurable differences are capacity and price: 4.6 reads 1,000,000 tokens and writes 128,000, and costs about 11 percent more per input token. Choose it for those limits. For a new build, Opus 5.5 is cheaper than both and has the larger window, provided you do not need sampling controls or forced tool choice.
What do I do when the context is full, or without native context editing?
Start a fresh request: keep the source packet first and unchanged, replace old turns with a short summary of decisions already made (which dates were corrected, which passages are done), and put the next task last. Dropping old turns costs nothing; dropping a source costs you the edit.
How do I stop it changing a quotation?
Mark sources as evidence, allow quotation marks only around exact source text, and run the quote check above on every reply.
Does keeping the same source block guarantee a cache hit?
No. Keep it stable to make reuse possible, but budget uncached until the returned cache usage and settled charge show a hit. A cache entry is a billing optimization; it does not make an edit more faithful.







