Skip to main content
buntime.sh Hero Light

What is buntime.sh?

buntime.sh is a serverless API that lets AI agents execute JavaScript and TypeScript code in isolated Bun containers with persistent sessions. Give your AI the ability to write code and immediately see if it works.

Fast Execution

Sub-3 second cold starts with Bun 1.3 runtime

Persistent Sessions

Files, processes, and databases stay alive during conversations

Web Preview

Instantly preview web apps with built-in HMR

Safe Isolation

Each session runs in its own container with resource limits

Why buntime.sh?

AI agents write code but can’t test it themselves. They guess, give it to users, get error messages back, and guess again. This wastes time and breaks flow. With buntime.sh, AI agents can:
  • ✅ Execute code and see real results instantly
  • ✅ Iterate on bugs with actual error messages
  • ✅ Build multi-file projects that persist across messages
  • ✅ Run web servers and preview them live
  • ✅ Work with databases without external services

Quick Example

import { Buntime } from 'buntime.sh';

const client = new Buntime({ apiKey: process.env.BUNTIME_API_KEY });

// Create a session
const session = await client.sessions.create();

// Execute code
const result = await client.execute({
  sessionId: session.id,
  code: `
    const data = [1, 2, 3, 4, 5];
    const sum = data.reduce((a, b) => a + b, 0);
    console.log('Sum:', sum);
  `
});

console.log(result.stdout); // "Sum: 15"

Key Features

One-Shot Execution

Run calculations, fetch data, or execute algorithms without any state management.

Iterative Development

Build applications over multiple messages. Files persist, processes stay alive, and AI can fix bugs based on real errors.

Web Applications

Create Express, React, or any HTTP server. Get a live preview URL with automatic hot reload when code updates.

Built-in Databases

Use Redis, PostgreSQL, MySQL, or SQLite without external services. All powered by Bun 1.3.

Auto Package Installation

Import any npm package and Bun automatically installs it. No explicit npm install needed.

Use Cases

AI writes code to process CSV, Excel, or PDF files. Sees real output and iterates until correct.
AI builds full-stack applications with live preview. Updates code and sees changes instantly.
AI spins up databases, seeds data, and queries it—all within a session.
Give your AI agents the ability to execute code as part of their tool suite via MCP or function calling.

Powered by Bun 1.3

buntime.sh leverages the latest Bun features:
  • Built-in HMR in Bun.serve() for instant hot reload
  • Native Redis, MySQL, PostgreSQL, and SQLite support
  • Run HTML directly without bundlers
  • Async stack traces for better debugging
  • Cookie API for web applications
  • Blazing fast performance

Get Started

Pricing

Simple, usage-based pricing

  • Free Tier: 1,000 executions/month
  • Paid: $10/month for 100,000 executions
  • Enterprise: Custom limits and SLA
View full pricing →
Ready to get started? Create an account and get your API key in seconds.