Skip to main content
GET
This endpoint provides full CRUD access to individual files in the task’s sandbox workspace. Use GET to read a file, PUT to create or overwrite it, and DELETE to remove it.

Authentication

To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:
  1. Go to app.blackbox.ai/agent-api and click Get an API Key (requires a Pro subscription)
  2. Once provisioning completes, you will be redirected to your Dashboard
  3. From the Dashboard, create an API key to use with all Agent API requests
Your API key will be in the format: sk-xxxxxxxxxxxxxxxxxxxxxx

Headers

string
required
API Key of the form Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560
string
Required for PUT requests. Must be application/json.

Path Parameters

string
required
The unique run identifier returned when the task was created.
string
required
Absolute path to the file inside the sandbox, without a leading slash in the URL.Example: For file /vercel/sandbox/src/index.ts, use vercel/sandbox/src/index.ts in the URL path.

GET — Read a File

Returns the file content as text (UTF-8) or base64 for binary files.

Response Fields (GET)

string
Absolute path of the file inside the sandbox.
string
File content. UTF-8 text for text files, base64-encoded for binary files.
string
"text" for text files, "base64" for binary files.
string
MIME type: "text/plain" for text, "application/octet-stream" for binary.
number
File size in bytes.

PUT — Write a File

Creates or overwrites a file. Parent directories are created automatically.

Request Body (PUT)

string
required
File content to write. Use UTF-8 text or base64-encoded string depending on encoding.
string
default:"text"
Encoding of the content field.
  • "text" — plain UTF-8 string (default)
  • "base64" — base64-encoded binary content

Response Fields (PUT)

boolean
Whether the write succeeded.
string
Absolute path of the written file.
number
Size of the written file in bytes.

DELETE — Delete a File or Directory

Deletes a file or directory (recursively). Cannot delete the workspace root (/vercel/sandbox or /).

Response Fields (DELETE)

boolean
Whether the deletion succeeded.
string
Absolute path of the deleted file or directory.

Error Codes