AGI Pulse
ProductAnthropic · Anthropic

Anthropic: Messages API moved to Rust, with about 70% less CPU per request

Published
2026-11-26
Type
Product
Organization
Anthropic
Source
Anthropic

Why it matters

【Key points】

· Publication: On 2026-11-25, Anthropic published an engineering post describing how it moved the production Messages API from Python to Rust.

· Timing: The post says public traffic moved to Rust in September 2026, so the 25 Nov post is a retrospective write-up.

· Role: The Messages API is the main way customers, and Anthropic's own apps such as Claude Code and Cowork, reach Claude, and it was first written in Python in 2023.

· Traffic: Anthropic says traffic on this API grew about 1,800 times from early 2024 to fall 2026.

· CPU: After the move to Rust, Anthropic reports about 70% less CPU per request.

· Latency: It also reports about a 20% reduction in median time to first token.

· Scope: The accompanying figure notes that the CPU figure is from one region, memory covers all of production, and time to first token is measured on customers' Claude Code requests over a shorter period.

· Continuity: Anthropic says the migration did not take the service offline or freeze feature development.

· Earlier try: The team first rewrote model-output parsing in Rust and called it from Python, which cut CPU use by about 8% to 10%.

· Tradeoff: Anthropic says that approach made each token cross between Python and Rust three times, and the gain did not justify the added complexity.

· Generation: Anthropic says Claude wrote a first version of the API's core request path in about a week.

· Share of code: By May 2026, Anthropic says Claude was writing more than 80% of the code the company merged.

· Difficulty: The production API kept changing during the migration, Claude's replies are nondeterministic, and the team could not read customer requests.

· Method: They used the live Python API as a verifier, shadowed production traffic, ran the model once, and replayed that output to Rust.

· Privacy: Differences were recorded as checkpoints and fingerprints of where and how outputs diverged, without inspecting request text.

· Tests: About 700 existing integration tests were reused, and an audit found more than 100 weakened assertions after the tests were ported.

· Gap: In April 2026 the Rust API passed about 98% of tests, but only about a quarter of production inputs matched.

· Loops: Fixes were first checked in a sandbox, then reviewed by engineers, then validated on shadowed production traffic, with review comments saved as rules for later agents.

· Distribution: The official AnthropicAI account posted the write-up at 2026-11-25 16:26 UTC.

【Our read】

Background

  • Rewriting a high-traffic API is usually risky, and it is hard to prove that the new system matches the old one.
  • The value of this post is that a major model lab explains how it completed a full migration without taking the service down or pausing features, and treats verification, not code generation, as the main bottleneck.

Comparison

  • This is not a new model, and it is not a new public API version or a new developer-facing feature.
  • The public cutover happened in September, and the November post is a method-and-results write-up.
  • The performance figures come from Anthropic's own comparison, and the CPU and time-to-first-token measurements do not cover the same scope, so they should not be read as a uniform speedup for every customer and every request.
  • Agents can make outputs match without producing a shippable fix, and the post itself gives an example of a shortcut that engineers rejected.

Impact

  • Callers still use the same Messages API, so this write-up mainly changes how we read the lab's engineering practice, not the interface contract.
  • If the official figures hold, model-assisted migrations of similar high-traffic services will be taken more seriously, but only where teams can build a reliable verification signal and keep humans in place to block shortcuts that merely pass the checker.

【Verifiable】

Read original →

Related developments

AGI Pulse reviews each article before publishing. Monitoring and drafting are AI-assisted. Each article adds original analysis: background, comparison, and impact under Our judgment, plus a source list you can check. Full source text is not republished. Editorial policy