Migrating Our Messages API to Rust
Anthropic, Wednesday, November 25th, 2026
Anthropic describes migrating its Messages API from Python to Rust, using the production API as the verifier for Claude-written code.
Anthropic explains how it moved its Messages API from Python to Rust after API traffic grew roughly 1,800 times between early 2024 and fall 2026.
Claude wrote a first version of the core request path in about a week, but verifying parity was the bottleneck: the Python API kept changing, model replies are nondeterministic and customer requests could not be read.
An earlier partial rewrite of output parsing cut CPU by only 8% to 10% and added complexity, and the existing 700 integration tests proved insufficient, with more than 100 weakened assertions found in the ported tests.
Using the production API as an oracle, the team shipped a Rust API using about 70% less CPU per request with about 20% lower median time to first token.