The High-Performance API Framework for Modern Bun
Build APIs with routing, request validation, middleware, OpenAPI, and explicit service composition. Start with a complete example and add integrations as you need them.
Install with Bun, save the example below as index.ts, then run bun run index.ts.
import { Volt, t } from 'voltts';
const app = new Volt({ port: 3000 });
app.get('/hello', () => ({ message: 'Hello Volt' }));
app.post('/tasks', (c) => c.json(c.body, 201), {
body: t.Object({ title: t.String({ minLength: 2 }) }),
});
app.listen(3000);Measure your workload
Reproduce the HTTP benchmarks
The repository includes in-memory and localhost HTTP harnesses. Run them with the same routes, runtime versions, and load settings before comparing frameworks.
bun run bench:allHigh-Throughput Architectural Pillars
A thoughtful architecture that does not force you to sacrifice code maintainability for raw execution speed.
Native Bun HTTP
Volt registers routes on Bun's native HTTP server. Measure your own workload with the repository's checked-in benchmark scripts.
O(1) Radix Tree Router
Static endpoints resolve via instant hash lookups, while dynamic parameters (:id) and wildcards match in a compressed prefix tree.
Prisma ORM Plugin
Official @voltts/plugin-prisma provides context store injection (c.store.prisma), automated P2002 error translation, and graceful connection teardown.
Built-in Dependency Injection
Compose services with explicit providers and Container, singleton and transient lifetimes, and circular dependency detection.
OpenAPI & Swagger
Generates OpenAPI specifications automatically from validation schemas and serves interactive Swagger UI and Scalar UI documentation out of the box.
Automatic Type Coercion
With a GET query schema, strings like ?limit=20&active=true can be validated and coerced into numbers and booleans. See the coercion guide for current method restrictions.
Explore API Request and Response Shapes
Explore preset responses in the browser, then run the documented examples locally to test real HTTP behavior.
These are preset examples, not requests to a running Volt API. Follow the Tasks API tutorial to run and test real endpoints.
{
"status": "ok",
"uptime": 142.85,
"database": "connected",
"orm": "Prisma Plugin (@voltts/plugin-prisma)",
"framework": "Volt",
"runtime": "Bun v1.4.4"
}Ready to build your first API?
Follow a runnable tutorial, verify its responses, and add tests as you build.