Most Rust frameworks force you to choose: Speed (Actix) OR Ergonomics (Axum). RustAPI gives you both.
We built the framework we wanted: FastAPI's developer experience backed by Rust's raw performance. No boilerplate. No fighting the borrow checker for simple handlers. Just code that flies.
Problem: Standard JSON APIs are verbose and expensive for Large Language Models (LLMs). Solution: RustAPI natively supports TOON (Token-Oriented Object Notation).
Top-tier LLMs (Claude, GPT-4o) charge by the token. RustAPI's TOON format reduces response token counts by 50-58% compared to standard JSON.
- 💰 Save 50% on API Costs: Half the tokens, same data.
- 🌊 Zero-Latency Streaming: Built for real-time AI agents.
- 🔌 MCP-Ready: Out-of-the-box support for Model Context Protocol.
"RustAPI isn't just a web server; it's the native language of your AI agents."
Production debugging shouldn't be a nightmare. RustAPI's Replay system records and replays HTTP requests with surgical precision.
// 1. Enable replay recording in production
RustApi::new()
.layer(ReplayLayer::new(store, config))
.run("0.0.0.0:8080").await;
// 2. Replay ANY request from the CLI
$ cargo rustapi replay list
$ cargo rustapi replay run <id> --target http://localhost:8080
$ cargo rustapi replay diff <id> --target http://stagingWhat makes it special:
- 🎬 Zero-Code Recording: Middleware automatically captures request/response pairs
- 🔐 Security First: Sensitive headers redacted, bearer auth required, disabled by default
- 💾 Flexible Storage: In-memory (dev) or filesystem (production) with TTL cleanup
- 🧪 Integration Testing:
ReplayClientfor programmatic test automation - 🕵️ Root Cause Analysis: Replay exact production failures in local environment
"Fix production bugs in 5 minutes instead of 5 hours."
We optimize for Developer Joy without sacrificing Req/Sec.
| Feature | RustAPI | Actix-web | Axum | FastAPI (Python) |
|---|---|---|---|---|
| Performance | ~92k req/s | ~105k | ~100k | ~12k |
| DX (Simplicity) | 🟢 High | 🔴 Low | 🟡 Medium | 🟢 High |
| Boilerplate | Zero | High | Medium | Zero |
| AI/LLM Native | ✅ Yes | ❌ No | ❌ No | ❌ No |
| Time-Travel Debug | ✅ Built-in | ❌ No | ❌ No | |
| Stability Logic | 🛡️ Facade | ✅ Stable |
Write your API in 5 lines. It's that simple.
use rustapi_rs::prelude::*;
#[derive(Serialize, Schema)]
struct Message { text: String }
#[rustapi_rs::get("/hello/{name}")]
async fn hello(Path(name): Path<String>) -> Json<Message> {
Json(Message { text: format!("Hello, {}!", name) })
}
#[rustapi_rs::main]
async fn main() {
// 1 line to rule them all: Auto-discovery, OpenAPI, Validation
RustApi::auto().run("127.0.0.1:8080").await
}Prefer a shorter macro prefix? You can rename the crate in Cargo.toml and use the same macros:
[dependencies]
api = { package = "rustapi-rs", version = "0.1.335" }use api::prelude::*;
#[api::get("/users")]
async fn list_users() -> &'static str { "ok" }That's it. You get:
- ✅ Swagger UI at
/docs - ✅ Input Validation
- ✅ Multi-threaded Runtime
- ✅ Zero Config
RustAPI now groups features into three namespaces:
| Namespace | Purpose | Examples |
|---|---|---|
core-* |
Core framework capabilities | core-openapi, core-tracing, core-http3 |
protocol-* |
Optional protocol crates | protocol-toon, protocol-ws, protocol-view, protocol-grpc |
extras-* |
Optional production middleware/integrations | extras-jwt, extras-cors, extras-rate-limit, extras-replay |
Meta features:
core(default)protocol-allextras-allfull = core + protocol-all + extras-all
- ✅ Dual-Stack Runtime: Simultaneous HTTP/1.1 (TCP) and HTTP/3 (QUIC/UDP) support
- ✅ WebSocket: Full permessage-deflate negotiation and compression
- ✅ OpenAPI: Improved reference integrity and native validation docs
- ✅ Async Validation: Deep integration with application state for complex rules
- ✅ gRPC Foundation: New optional
rustapi-grpccrate with Tonic/Prost integration and side-by-side HTTP + gRPC runners (run_rustapi_and_grpc,run_rustapi_and_grpc_with_shutdown) - ✅ CLI DX Update:
cargo rustapi newinteractive feature selection now includesgrpc
We build in public. Here is our immediate focus for February 2026:
- Visual Status Page: Automatic health dashboard for all endpoints.
- gRPC Integration (Foundation): First-class optional crate via Tonic (
rustapi-grpc) with RustAPI facade-level feature flag support. - Distributed Tracing: One-line OpenTelemetry setup.
- RustAPI Cloud: One-click deploy to major cloud providers.
We moved our detailed architecture, recipes, and deep-dives to the Cookbook.
