Anthropic describes a Rust version of its Messages API
Anthropic has published a research post on migrating the Messages API to Rust. It describes how the company built a Rust version of the API and checked it.
According to the post, Anthropic built the Messages API in 2023 and wrote it in Python.
Anthropic says Messages API traffic grew roughly 1,800 times from early 2024 to fall 2026.
A partial rewrite
The post describes rewriting the code that parses model output in Rust and calling that code from Python. Anthropic says this cut the API's CPU usage by about 8% to 10%.
Code written by Claude
According to the post, Claude wrote a first version of the API's core request path in about a week.
Anthropic also says that by May 2026, Claude was writing more than 80% of the code the company merged.
What the tests missed
When Anthropic audited the ported tests, it found more than 100 weakened assertions.
The post also says the Rust API passed about 98% of its tests in April, but only about a quarter of inputs matched on production traffic. The post does not give the year for that April figure.
The reported result
Anthropic says the Rust version of the API uses about 70% less CPU per request and cuts median time to first token by about 20%. According to the company, it shipped without taking the service offline or freezing feature development.
Limits of this article
This article is educational information based on a single post from Anthropic. It is not investment advice and does not recommend any company, product or asset. It does not independently check the figures Anthropic reports. It does not cover how other systems might perform after a similar migration.
