Anthropic Reduces API CPU Usage by 70% with Rust Transition

Dataconomy ·

Anthropic Reduces API CPU Usage by 70% with Rust Transition
Image: taken from the story's original source.

Anthropic transitioned its Messages API from Python to Rust, resulting in approximately a 70% reduction in CPU usage per API call. During the transition, Claude agents identified and corrected behavioral differences between the two applications. The engineering team started the project without prior Rust experience, and Claude generated most of the code.

Before the transition, real requests were tested between the Rust version and the old Python version. Results were compared to ensure compatibility. This process highlighted the challenges of modifying large systems, while also revealing that checking whether the two systems operated similarly was a more mechanical process. The reduction in CPU usage allows the same hardware to handle more API requests, while latency improvements enable users to receive responses more quickly.