{"version":1,"type":"story","url":"https://digestai.news/story/anthropic-migrates-messages-api-to-rust-cutting-cpu-use-by-70","json":"https://digestai.news/story/anthropic-migrates-messages-api-to-rust-cutting-cpu-use-by-70.json","markdown":"https://digestai.news/story/anthropic-migrates-messages-api-to-rust-cutting-cpu-use-by-70.md","slug":"anthropic-migrates-messages-api-to-rust-cutting-cpu-use-by-70","headline":"Anthropic migrates Messages API to Rust, cutting CPU use by 70%","summary":"Anthropic has detailed its migration of the Messages API, the primary interface for customers to access Claude, from Python to Rust. The move was driven by a need for efficiency as API traffic grew roughly 1,800 times between early 2024 and fall 2026. While Claude generated the initial Rust code in about a week, the company faced significant challenges in verifying that the new system matched the behavior of the existing production API.\n\nThe core difficulty was the \"generator-verifier gap\": it is easier to check a solution than to create one, but in live systems, defining \"correct\" is hard due to edge cases and nondeterministic model outputs. Standard testing proved insufficient because the Python API continued to change during the migration, and existing tests were coupled to the old implementation. Anthropic found that while the Rust API passed about 98% of its tests in April, only about a quarter of inputs matched on production traffic.\n\nTo solve this, Anthropic used the production Python API as an oracle, running shadow traffic to compare outputs without reading user data. By using checkpointing and fingerprinting to identify where differences occurred, they could automatically dispatch agents to fix discrepancies. The result is a Rust-based API that uses about 70% less CPU per request and cuts median time to first token by about 20%, all without taking the service offline.","keyPoints":["Anthropic migrated its Messages API from Python to Rust to handle 1,800x traffic growth since 2024.","The new Rust API uses about 70% less CPU per request and cuts median time to first token by about 20%.","Claude wrote the first version of the core request path in about a week, but verification was the main bottleneck."],"whyItMatters":"This demonstrates a scalable method for migrating critical AI infrastructure using AI-generated code, addressing the verification challenge that often hinders large-scale rewrites in production environments.","category":{"slug":"enterprise","name":"Enterprise & Industry","url":"https://digestai.news/category/enterprise"},"entities":{"companies":["Anthropic"],"models":["Claude"],"people":[]},"firstPublishedAt":"2026-11-25T17:05:04Z","updatedAt":"2026-11-25T17:19:06Z","sourceCount":2,"hasPrimarySource":true,"sources":[{"outlet":"anthropic.com","title":"Anthropic details migrating its Messages API, the primary way customers access Claude, from Python to Rust, and using the Python service to verify the migration","url":"https://anthropic.com/research/migrating-api-to-rust","publishedAt":"2026-11-25T17:05:04Z","type":"primary","primary":true,"lead":true},{"outlet":"Unite.AI","title":"Anthropic Details Claude-Assisted Rust Migration of Messages API","url":"https://unite.ai/anthropic-details-claude-assisted-rust-migration-of-messages-api","publishedAt":"2026-11-25T17:19:06Z","type":"press","primary":false,"lead":false}],"sourceNotes":null,"discussions":[],"thread":null,"cite":{"text":"Digest AI, \"Anthropic migrates Messages API to Rust, cutting CPU use by 70%\", 25 November 2026, https://digestai.news/story/anthropic-migrates-messages-api-to-rust-cutting-cpu-use-by-70","publisher":"Digest AI","title":"Anthropic migrates Messages API to Rust, cutting CPU use by 70%","datePublished":"2026-11-25T17:05:04Z","url":"https://digestai.news/story/anthropic-migrates-messages-api-to-rust-cutting-cpu-use-by-70"},"generatedBy":"Written by Digest AI's editorial model from the linked sources; the sources are the record.","license":"Headlines, digests and key points are written by Digest AI and may be quoted with a link to the story page. Linked articles belong to their publishers. Terms: https://digestai.news/terms#reuse"}