@tpmjs/tools-e2b
Execute code in an E2B sandbox. Supports Python, JavaScript, TypeScript, R, Java, and Bash.
Failed to execute code in sandbox test: Failed to connect to sandbox test: 401: authorization header is missing
Last checked: 3/6/2026, 4:14:34 AM
Test @tpmjs/tools-e2b (runCode) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-e2bpnpm add @tpmjs/tools-e2byarn add @tpmjs/tools-e2bbun add @tpmjs/tools-e2bdeno add npm:@tpmjs/tools-e2bimport { runCode } from '@tpmjs/tools-e2b';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { runCode } from '@tpmjs/tools-e2b';
const result = await generateText({
model: openai('gpt-4o'),
tools: { runCode },
prompt: 'Your prompt here...',
});
console.log(result.text);(code: string, sandboxId: string, language?: string, timeoutMs?: number) => Promise<unknown>Available configuration options
sandboxIdstringID of the sandbox to execute in
codestringCode to execute
languagestringLanguage: python (default), javascript, typescript, r, java, bash
timeoutMsnumberExecution timeout in milliseconds (default: 60000)
Schema extracted: 3/6/2026, 4:14:34 AM
ERROR: No README data found!
Downloads/month
3
GitHub Stars
19
Quality Score