Anthropic Migrates Its Messages API From Python to Rust, Using Claude Agents to Reach Parity
We recently migrated our Messages API from Python to Rust. On our engineering blog, we share how we used the existing service to verify the new one, with teams of Claude agents tracking down and fixing differences between the two versions.
Context
Anthropic says Claude agents helped it replace a live customer API that now carries far more traffic, with lower compute cost and faster replies, a sign that labs can move production systems without pausing new work.
Anthropic's Messages API is the main way customers and its own apps reach Claude. The company built it in Python in 2023, when it was still a relatively simple request forwarder. Traffic then grew far beyond what that first service was built for, and Anthropic says the cost of each request rose as the API took on validation, tokenization, safety checks, and streaming.
Deep dive
Anthropic says it has moved its Messages API from Python to Rust after traffic on the service grew roughly 1,800 times from early 2024 to fall 2026. In a research post published today, the company writes that Rust lets it use far less CPU per request, and that the new service uses about 70 percent less CPU and cuts median time to first token by about 20 percent. It says it did this without taking the API offline or freezing feature work.
The hard part, Anthropic says, was not writing a first Rust version. It says Claude wrote a first version of the core request path in about a week. The hard part was proving the new service matched the live Python API. The Python service kept changing during the move, Claude can reply in more than one way to the same request, and the company says it could not read customer requests, so it was difficult to see where the two versions diverged.
The approach was to turn the production API itself into a verifier. Anthropic says it tested the Rust service on production traffic, found where outputs differed, and sent teams of Claude agents to track down and fix those differences. Public traffic, the post says, moved to Rust in September 2026. The writeup is by Lance Martin, Jake Eaton, Arvin Aminpour, Emma Webb, Bharat Mediratta, and Ravi Trivedi.
What to expect next
Watch whether Anthropic shares more detail on remaining edge cases and on how long the two services ran side by side. Also watch whether other labs copy this pattern, using a live service as a checker and agents to close the gaps, when they move other heavily used APIs. Open questions include how far this method extends to systems without a clear way to score a correct reply, and whether the CPU and latency gains hold as traffic keeps growing.
