Home/Tools/@tpmjs/tools-e2b

uploadFile

@tpmjs/tools-e2b

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

Official
sandbox
v0.1.0
MIT

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);

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: 1/20/2026, 3:49:51 AM

README

ERROR: No README data found!

Statistics

Downloads/month

0

Quality Score

0%

Bundle Size

NPM Keywords

tpmjs
e2b
sandbox
code-interpreter
ai
code-execution
cloud

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai