Anthropic on its Rust API: "Verification, not generation, had become the bottleneck"

Anthropic has moved its Messages API from Python to Rust. In a post of 25 November its engineers write that Claude produced a first version of the core request path in about a week, and describe the months of checks against live traffic that followed.

Three charts from Anthropic's post as requests moved from Python to Rust: CPU used per request about 70% less, memory used per request more than 80% less, median time to first token about 20% less
Figure: Anthropic
In this material
  1. From a partial rewrite to a full one
  2. Tests passed, live traffic did not
  3. The result in Anthropic’s figures

Anthropic published “Migrating our Messages API to Rust” on 25 November, written by Lance Martin, Jake Eaton, Arvin Aminpour, Emma Webb, Bharat Mediratta and Ravi Trivedi. The Messages API carries requests from customers and from Anthropic’s own apps, among them Claude Code and Cowork. Its traffic grew roughly 1,800 times between early 2024 and the autumn of 2026, the post says, and Claude wrote a first version of the API’s core request path in about a week. “Verification, not generation, had become the bottleneck,” the authors write.

From a partial rewrite to a full one

The first attempt moved only the parsing of model output to Rust. It cut CPU use by about 8% to 10%, but each token then crossed between Python and Rust three times. The post gives a second reason the team went further: by May 2026 Claude was writing more than 80% of the code Anthropic merged, so the effort of a full rewrite was falling.

The Messages API, from Python to Rust
  1. 2023Built in PythonOne engineer called it "basically a request forwarder"
  2. 2024A rewrite is ruled outAn engineer: "We are not rewriting the API in go or rust!"
  3. March 2026Partial rewriteRust parses model output for the Python service
  4. April 2026First comparison on live trafficAbout 98% of tests pass, about a quarter of inputs match
  5. August 202699.6% of inputs matchAfter fixes written by agents and reviewed by engineers
  6. September 2026Public traffic moves to Rust

Tests passed, live traffic did not

Anthropic had about 700 integration tests, but they were tied to the Python code and had to change with it, and Claude helped on both sides. “When we audited the ported tests, we found more than 100 weakened assertions,” the authors write. “Our Rust API passed about 98% of its tests in April, yet only about a quarter of inputs matched on production traffic.” One cause was emoji: Python escaped them with text codes in JSON tool calls, Rust wrote them as they were, and the prompts differed by a few bytes.

The team could not read customer requests, so it ran the model once, replayed the output to Rust and recorded only where each difference appeared and how large it was. A coordinating Claude agent passed each new kind of difference to a worker agent, which reproduced it in a sandbox and proposed a fix for engineers to review in Slack. When one agent made the prompts match by copying the web search tool’s description into files, an engineer turned the fix down as throwaway code.

Anthropic's chart of the share of inputs on which the Rust API matched the Python one: 24% in late April, 6.5% in early May, then a sharp rise as fixes rolled out and 99.6% in August
How often the Rust API built the same input as the Python one, late April to August. The comparison began on Anthropic's own traffic and later moved to a wider sample.Figure: Anthropic

The result in Anthropic’s figures

Public traffic moved to Rust in September. Anthropic says the new API uses about 70% less CPU and more than 80% less memory per request, and that median time to first token on customers’ Claude Code requests fell by about 20%. The figures are the company’s own.

Over the project, the authors write, engineers moved from chasing differences themselves to reviewing fixes, and then to writing the rules and checks the agents worked within.

From the pulse

All news →
  1. Models

    Lean and Mathlib communities certify a Riemann hypothesis proof an Anthropic mathematician made with Claude

    Levent Alpöge released the proof on 20 November as Lean code, saying he found it working with Claude; on 21 November the Lean and Mathlib communities certified the statement and the proof, which also cover the generalisation to Dirichlet L-functions. No version for human readers has been published. Fields medallist James Maynard told Nature he suspects it is correct; Andrew Granville called the note Alpöge released garbled.

    Sources: leanprover-community.github.io, alpo.ge, nature.com In the catalog: Claude

  2. Tools

    Thousands of passwords and tokens found in Claude Code settings files on GitHub

    Apiiro found database passwords, API tokens and root logins in .claude/settings.local.json files committed to public repositories. When a user approves a shell command with "Yes, and don't ask again", the command is saved in that file as written; Anthropic's documentation adds the file to the global .gitignore, which usually keeps it private.

    Source: arstechnica.com In the catalog: Claude

  3. Business

    Anthropic shares open at $111.50 on Nasdaq, 33% above the IPO price

    The Claude maker priced the offering at $83 a share on 18 November, above the expected range of $70 to $78, and raised more than $81 billion for its employees and the company. At the opening price its market value was over $2 trillion, TechCrunch reported; Dario Amodei said the listing puts the company in a stronger financial position.

    Source: techcrunch.com

More in this section

All materials →
News

OpenAI's Thibault Sottiaux: "We made a billing mistake at launch of GPT-6.2"

Thibault Sottiaux, who heads Core Products & Platform at OpenAI, wrote on X on 26 November that a launch error had counted too little of most users' GPT-6.2 Astra and Sol usage. With the fix, subscribers reach their limits 40% faster on Astra and 25% faster on Sol than a week earlier.

News

OpenAI claims matrix multiplication exponent is 9/4; Bubeck "never thought" he'd see it

An OpenAI preprint of 25 November claims that ω, the exponent of matrix multiplication, is exactly 9/4, with the first proved lower bound above 2. Sébastien Bubeck of OpenAI called it a result he never thought he would see in his lifetime.

News

RSA rumour: Aaronson "virtually certain" of AI labs' crypto "bombshells", not of details

A rumour says OpenAI or Anthropic can factor integers in polynomial time, which would threaten RSA. Scott Aaronson is "virtually certain" the labs hold "bombshells" for cryptography but much less sure what they are; neither lab had commented by the evening of 25 November.