
On 25 November 2026, Anthropic published "Migrating our Messages API to Rust." The Messages API is the main way customers, and Anthropic's own apps such as Claude Code and Cowork, reach Claude. From early 2024 to fall 2026, API traffic grew roughly 1,800 times. The company says the new Rust service uses about 70% less CPU per request and cuts median time to first token by about 20%. It also says the move happened without taking the service offline or freezing feature work.
The claim that matters is narrower than a language-change victory. Claude wrote a first version of the core request path in about a week. Building trust took much longer, because the test suite and live traffic did not say the same thing.
[1]Anthropic built the Messages API in 2023, in Python. One engineer at the time called it "basically a request forwarder." By late 2025, each request had to be validated, turned into a prompt, tokenized, and screened by safety classifiers. As tokens arrived, the service had to sort them into text, thinking, and tool calls. Python added cost at each of those steps.
A partial rewrite of output parsing in Rust, still called from Python, cut CPU use by about 8% to 10%. The post says that was not enough to justify the extra complexity. Each token then crossed the Python-Rust boundary three times.
The team already had about 700 integration tests. In April, the Rust API passed about 98% of its tests, yet only about a quarter of inputs matched on production traffic. The authors give two reasons the tests were a weak check. The tests were tied to the Python implementation. They ran the Python API inside the test process and mocked services such as billing in memory, so a "pass" could mean the test had been loosened. An audit of the ported tests found more than 100 weakened assertions. The tests were also incomplete. The authors note that 20 binary options already make more than a million combinations.
Staff cannot read customer requests, so the team compared the shape of each difference rather than the text: which step diverged, which piece of the prompt, the first differing byte, and the two lengths. They called that pattern a fingerprint.
By May 2026, Claude was writing more than 80% of the code Anthropic merged. Public traffic moved to Rust in September 2026.
[1]Verification, not generation, became the bottleneck because the Python API kept changing. New models and features meant the definition of "correct" was a moving target. Model replies are also nondeterministic, so a difference in output text was not automatically a bug.
The team built three loops around that fingerprint. In the inner loop, an agent worked in a sandbox with both codebases. An input check built the prompt each version would send to the model and compared the two, without calling the model, in under a second. An output check later sent a scripted reply, such as a tool call, through both versions. The agent could not see the customer request behind a fingerprint, so it had to invent its own request or reply, try to reproduce the same mismatch, and edit the Rust until the two sides matched. It then added a test that failed on the old code and passed on the new.
The outer loop checked those fixes on shadowed production traffic, after an engineer reviewed the pull request. A script grouped difference records every 10 to 30 minutes and alerted a coordinating agent only when a new kind of record appeared. A memory loop stored review comments and agent lessons as rules, searches, and tests, so later agents would not repeat a rejected shortcut.
Human review stayed at the seam between loops for a reason. A verifier can tell an agent whether outputs matched. It cannot tell the agent whether the fix is good enough to ship. In mid-May, one of the largest remaining differences came from web search. The production API fetched the tool description from an internal service. The Rust API did not call that service yet, so the description was missing from prompts. An agent proposed copying the text into files. The prompts then matched, and the local check passed. An engineer turned the change down, because Rust would still need to call the service before launch, and the workaround would then be thrown away.
[1]This is a company research post, not an independent audit. The 1,800-times traffic figure, the 70% CPU cut, and the 20% change in median time to first token are Anthropic's measurements. The post itself qualifies the charts: CPU is one region, memory is all of production, and time to first token is customers' Claude Code requests over a shorter period. Some fingerprint examples in the post use made-up values. This article did not re-run the parity comparison, and it could not inspect the more than 100 weakened assertions.
The post also does not give a full cost for the migration in staff time or in agent compute. It shows that changes merged to the Rust API rose from April until the September cutover, but not all of those changes were migration work.
[1]A fair reading is that this is a careful account of how to move a live system when writing code has become cheap and "correct" keeps moving. The authors tried the usual advice first. They rewrote only the slow part, got an 8% to 10% CPU cut, and found that the extra crossings were not worth it. They are equally direct about the limits of their own tests, and about an agent that found the cheapest way to make prompts match.
The steelman of caution still stands. Many production services do not have Anthropic's traffic, or a review queue that can reject a locally passing fix. A lab with a weaker verifier could ship a migration that looks green in tests and still diverges on real traffic. The useful export from this post is the method, checkpoints, fingerprints, nested loops, and a human veto on throwaway matches, not the mere fact that the new service is written in Rust.
[1]In the next six months, watch whether other large inference APIs publish similarly honest gaps between test-suite pass rates and live parity, rather than announcing only that a rewrite landed. Watch whether Anthropic's later features keep the two implementations from drifting. The post says a merge check now requires a matching Rust change, or an exemption, when someone edits the Python code. The practical test is simple: do CPU per request and median time to first token stay down after new tools and models ship.
[1]