Anthropic Migrates Its API to Rust and Announces 70% Less CPU Usage

Anthropic announced on November 25 the migration of its Messages API to Rust with the help of Claude, claiming approximately 70% less CPU consumption per request. A functional first version took about a week for the model; preparing it for millions of real requests required months of testing and human revisions.
An engineer rejects a validated correction
At Anthropic, a Claude agent proposed storing the description of a web search tool in local files, which Rust was unable to retrieve. According to the company, this modification produced consistent outputs and passed the automated checks. However, an engineer rejected it: the description was to continue coming from the original service.
The agents' proposals remained subject to human review before deployment. The Claude agents examined the traces of discrepancies, sought their origins, and suggested modifications. According to Anthropic, they reproduced the anomalies in isolated environments, where a fix could be tested in less than a second.
Once approved, the changes were confronted with production requests to verify that the anomaly had disappeared. Recurring errors then fed into the tests, programming rules, and guidelines for the agents.
Real requests reveal discrepancies despite testing
In April 2026, the Rust version succeeded in about 98% of integration tests, Anthropic reports. However, during the initial comparisons with Python on real client inputs, the results only matched for about a quarter of them. Among the discrepancies were characters escaped by Python in JSON tool calls, but sometimes retained directly by Rust: the outputs could be valid while altering the data received by the model.
Anthropic also stated that it identified over 100 assertions that had become less strict among approximately 700 tests transposed from Python. These changes made it easier to overlook certain incorrect behaviors. Completeness presented another challenge: according to the company, 20 binary options represent over a million combinations. Testing them would take about 12 days at one second per test, without even varying the prompts.
The AI brief the pros read every evening
The 7 best AI stories, the essentials in 5 min. Free.
Included when you join: our pick of the best AI guides & comparisons.
Choose your rhythm
Free · No spam · Unsubscribe in 1 click
To confront Rust with client activity without disclosing their requests or double billing them, Anthropic used Python as a reference. The versions received the same requests, but the model was executed only once; its response was then reinjected into Rust. This setup distinguished programming discrepancies from normal variations in Claude's responses.
The comparisons covered request processing, prompt preparation, tool calls, and usage counting. Rather than private messages, the traces preserved the characteristics of the differences and their magnitude.
A rewrite after a partial first attempt
The Messages API serves Anthropic's clients as well as Claude Code and Cowork. The company reports an approximately 1,800-fold increase in its traffic between early 2024 and fall 2026. It deemed its operation under Python to have become costly: validation, tokenization, security checks, and response processing came with a computational overhead.
A limited attempt focused on processing the model's output had already yielded, according to Anthropic, a CPU saving of about 8% to 10%. But each token had to cross the boundary between Python and Rust three times, adding more complexity and overhead. The company chose to redo the entire request path rather than maintain this mixed architecture.
Rust offers low-level performance and memory safety protections; it also topped the list of preferred languages in the 2026 JetBrains developer survey. At Anthropic, the use of Claude exceeded this migration: by May 2026, the company attributed over 80% of the merged code across all its development activities to it. This proportion does not measure its contribution to the Rust project alone.
The measures focus on distinct scopes
The announced CPU reduction comes from only one area, Anthropic clarifies. The company also claims over 80% less memory consumption per request.
The approximately 20% decrease in the median time before the first token, which corresponds to the wait before the response begins, was measured on Claude Code requests. The period considered was shorter than for the CPU. Anthropic indicates that all its production traffic was running on Rust by September 2026, without service interruption or suspension of feature development.
Brief AI — AI news in French
The essentials of artificial intelligence news, decoded and explained every day.