Anthropic moves Messages API to Rust so builders get faster responses
Developers calling Anthropic's Messages API get lower latency while teams planning large rewrites can see how production traffic can verify agent-written code.
- Time to first token
- About 20% lower median latency
- CPU per request
- About 70% less (vs. about 8% to 10% incremental)
- API traffic growth
- Roughly 1,800 times (early 2024 to fall 2026)
- Service impact
- No downtime or feature freeze
Anthropic reports that its Rust rewrite of the Messages API cuts median time to first token by about 20% and uses about 70% less CPU per request. The company completed the migration without taking the service offline or freezing feature development. Traffic on the API grew roughly 1,800 times from early 2024 to fall 2026, straining the original Python service.
AI Infrastructure
The Messages API is the primary way customers and Anthropic's own apps, including Claude Code and Cowork, reach Claude. Anthropic first tried an incremental rewrite by moving output-parsing code to Rust and calling it from Python, which cut CPU usage by about 8% to 10% but forced each token to cross between Python and Rust three times.
Verifying the full rewrite was difficult because the Python API kept changing, Claude can reply nondeterministically to the same request, and Anthropic could not read customer requests. By turning the production API itself into a verifier, Anthropic tested the Rust version on production traffic, found where it differed, and automatically dispatched agents to fix those differences.