Home/Tools/@tpmjs/tools-e2b

uploadFile

@tpmjs/tools-e2b

Upload a file to the E2B sandbox from base64 content or URL.

Official
sandbox
v0.1.0
MIT
⚠️

This tool is currently broken

Execution Failed
Runtime error with test parameters
Failed to connect to sandbox test: 401: authorization header is missing

Last checked: 3/6/2026, 4:14:36 AM

Interactive Playground

Test @tpmjs/tools-e2b (uploadFile) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/tools-e2b
pnpm add @tpmjs/tools-e2b
yarn add @tpmjs/tools-e2b
bun add @tpmjs/tools-e2b
deno add npm:@tpmjs/tools-e2b

2. Import the tool

import { uploadFile } from '@tpmjs/tools-e2b';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { uploadFile } from '@tpmjs/tools-e2b';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { uploadFile },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Signature

(path: string, sandboxId: string, url?: string, content?: string) => Promise<unknown>

Tags

ai
base64
cloud
code-execution
code-interpreter
content
e2b
file
sandbox
tpmjs
upload
url

Parameters

Available configuration options

Auto-extracted
sandboxId
Required
Type: string

ID of the sandbox

path
Required
Type: string

Destination path in sandbox

content
Optional
Type: string

Base64 encoded file content

url
Optional
Type: string

URL to fetch file from (alternative to content)

Schema extracted: 3/6/2026, 4:14:36 AM

README

ERROR: No README data found!

Statistics

Downloads/month

3

GitHub Stars

19

Quality Score

78%

Bundle Size

NPM Keywords

tpmjs
e2b
sandbox
code-interpreter
ai
code-execution
cloud

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai
uploadFile | TPMJS | TPMJS