Skip to main content
Blaxel is a cloud-based container platform optimized for AI agents and development workflows. With sub-25ms cold starts from standby mode and automatic scale-to-zero, Blaxel provides cost-effective, high-performance sandboxes for running AI-generated code. Learn more at blaxel.com.

Installation

First, install the Blaxel provider package:

Prerequisites

Before using the Blaxel provider, you need to:
  1. Sign up for a Blaxel account at https://blaxel.com
  2. Get your Workspace ID and API Key from the Blaxel dashboard
  3. Set them as environment variables:
Alternatively, you can authenticate using the Blaxel CLI:

Configuration

VibeKit uses a builder pattern with method chaining for type safety and flexibility. Configure your Blaxel provider and VibeKit instance:

Using the provider directly

Using configuration object

Configuration Options

The createBlaxelProvider function accepts these configuration options:

Required Options

  • workspace (string): Your Blaxel workspace ID from the dashboard (can be omitted if using CLI authentication)
  • apiKey (string): Your Blaxel API key (can be omitted if using CLI authentication)

Optional Options

  • image (string): Custom Docker image. If not provided, it will be auto-selected based on the agent type:
    • claudeblaxel/vibekit-claude
    • codexblaxel/vibekit-codex
    • opencodeblaxel/vibekit-opencode
    • geminiblaxel/vibekit-gemini
    • grokblaxel/vibekit-grok
    • Default: blaxel/vibekit-codex
  • memory (number): Memory allocation in MB (default: 4096)
  • region (string): Deployment region (e.g., “us-pdx-1”, “eu-west-1”). If not specified, Blaxel chooses the optimal region automatically
  • ttl (string): Time-to-live for automatic sandbox cleanup (e.g., “24h”, “30m”, “7d”). Supported units: s (seconds), m (minutes), h (hours), d (days), w (weeks)
  • ports (array): Port configuration for exposing services. Default: [{ target: 3000, name: "web-server" }]

ENV variables and secrets

Configure your Blaxel provider using environment variables:
Reference them in your code:

Unique Features

Lightning-Fast Cold Starts

Blaxel’s innovative architecture enables sub-25ms cold starts from standby mode, making it one of the fastest sandbox providers available. This means near-instant resumption of sandboxes after periods of inactivity.

Automatic Scale-to-Zero

  • Cost optimization - Sandboxes automatically enter standby mode when inactive
  • Instant resume - Sub-25ms wake-up time from standby
  • No manual management - Blaxel handles lifecycle automatically
  • TTL-based cleanup - Set automatic deletion timers to prevent resource waste

Automatic Image Selection

Blaxel automatically selects the appropriate pre-built Docker image based on your agent type, ensuring optimal compatibility and performance without manual configuration.

Performance Features

  • Fast execution - Optimized container runtime for AI workloads
  • Flexible resources - Configure memory allocation per sandbox
  • Port exposure - Dynamically expose ports for web services
  • Background processes - Run long-running commands in the background

Advanced Usage

Custom Docker Image

Use your own Docker image with pre-installed dependencies:

High-Memory Configuration

For memory-intensive workloads:

Background Command Execution

Run long-running processes in the background:

Exposing Multiple Ports

Expose multiple services running on different ports:

Regional Deployment

Deploy to specific regions for lower latency:

Time-to-Live Management

Set automatic cleanup timers to manage costs:

System Requirements

  • Node.js 18+ - Runtime environment
  • Blaxel account - Active account with workspace and API key
  • Internet connection - Required for cloud sandbox execution

Limitations

  • Pause/Resume: Blaxel automatically handles standby mode, so manual pause operations are not required. Sandboxes automatically enter standby when inactive and resume in sub-25ms when needed.
  • Resource limits: Memory and CPU resources are based on your Blaxel plan tier. Check your dashboard for current limits.

Troubleshooting

Authentication errors:
Sandbox creation timeout:
Port exposure issues:
Image pull errors:
Region availability:

Cost Optimization Tips

  1. Use TTL wisely: Set appropriate TTL values based on your usage pattern
  2. Leverage automatic scale-to-zero: Blaxel automatically puts sandboxes in standby mode when idle, reducing costs without manual intervention
  3. Right-size memory: Start with minimal memory and scale up as needed
  4. Clean up promptly: Always call kill() when done to avoid unnecessary charges
  5. Use CLI authentication: For local development, use bl login to avoid storing credentials in code

Support

For issues related to:

Next Steps