compute

Serverless Compute

Code Execution

Code Execution is a serverless compute capability available through E2B on Aweb. Execute code in sandboxed environments with filesystem and process access. Access it through a single unified API with automatic failover and intelligent routing.

Try Code ExecutionAPI docs

Best for

Highest quality

E2B

Premium tier

Contract

Max Latency10000ms
Streaming RequiredNo

Providers (1)

ProviderScoreQualityPricing
E2BDEFAULT
85premiumstandard

Quick start

Call Code Execution through Alfred — automatic provider selection, failover, and load balancing included.

cURL

curl -X POST https://api.alfred-ai.app/v1/execute \
  -H "Authorization: Bearer $ALFRED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "capability": "compute.execute",
    "input": { "prompt": "Hello world" }
  }'

TypeScript

import { Alfred } from '@alfred/core';

const alfred = new Alfred({ apiKey: process.env.ALFRED_API_KEY });

// Alfred automatically selects the best provider
const result = await alfred.execute({
  capability: 'compute.execute',
  input: { prompt: 'Hello world' },
});

console.log(result.output);

Orchestration pipeline

import { Alfred } from '@alfred/core';

const alfred = new Alfred({ apiKey: process.env.ALFRED_API_KEY });

// Multi-step pipeline with automatic failover
const result = await alfred.orchestrate({
  steps: [
    { id: 'step1', capability: 'compute.execute', input: { prompt: 'Hello world' } },
    { id: 'step2', capability: 'llm.chat', dependsOn: ['step1'],
      input: { prompt: 'Summarize: $step1.output' } },
  ],
});

Related Serverless Compute capabilities

Serverless GPU

compute

Code Sandbox

compute

Synthetic Data Generation

compute

Data Anonymization

compute

Cloud Browser

compute

Getting started →API reference →All providers →All capabilities →