עברית 📰 Blog
← Back to Blog
AI News

Anthropic Moved Its Messages API From Python to Rust: 70% Less CPU, About 20% Faster First Token

Masterphub Editorial
AI News Desk
November 27, 2026

Share this article

Anthropic Moved Its Messages API From Python to Rust: 70% Less CPU, About 20% Faster First Token
Short answer: Anthropic moved the Messages API, the main way apps reach Claude, from Python to Rust. It reports about 70% less CPU per request and a median time to first token down about 20% for Claude Code requests. Public traffic moved in September 2026.

What Anthropic reports

The Messages API is how customers and Anthropic's own apps, including Claude Code and Cowork, reach Claude. Anthropic says API traffic grew roughly 1,800 times from early 2024 to fall 2026, and the Python service became costly to run at that size.

  • CPU per request: about 70% lower after the full migration.
  • Memory per request: more than 80% lower, according to a chart caption.
  • Median time to first token: about 20% lower. The chart covers customers' Claude Code requests, in a shorter window than the CPU numbers.

How they checked it was safe

Anthropic ran production traffic in shadow mode. The model was called once and its reply was passed to both versions, so each worked from the same output. The team compared each step and stored only the shape of any difference, not the text, to protect user privacy.

In April, the Rust version passed about 98% of roughly 700 existing tests, but only about a quarter of production inputs matched. By August the match rate reached 99.6%. The team also found more than 100 weakened assertions while auditing the ported tests.

Timeline and Claude's part

A smaller Rust rewrite of the parser in March 2026 saved 8% to 10% CPU, which the team judged not worth the added complexity. The full rewrite started in April, and public traffic moved to Rust in September. Anthropic says Claude wrote a first version of the core request path in about a week.

What this means for your apps

  • These are Anthropic's own measurements on its own traffic. Your results depend on prompt size, model and region.
  • The time to first token gain is measured on Claude Code requests, so do not assume the same number for every use.
  • No API changes or price changes are announced in the post.

Source: Anthropic, "Migrating our Messages API to Rust" (Nov 25, 2026)

Share this article