Project-F Agent API

Claude AI + E2B Sandbox — Streaming Agent Service

POST /agent

Submit a prompt to the agent. Returns a Server-Sent Events (SSE) stream.

Request Body

FieldTypeRequiredDescription
promptstringYesThe user prompt to send to the agent
session_idstring | nullNoResume a previous session
sandbox_idstring | nullNoReuse a paused sandbox
filesFileInfo[]NoFiles to download into sandbox: [{"id": "...", "url": "..."}]
sandbox_mode"persistent" | "ephemeral"NoDefault "persistent" (pause after completion). "ephemeral" kills sandbox after completion.
initial_skillsInitialSkill[]NoSkills to download from blob storage into new sandboxes: [{"skill_id": "dcf", "url": "skills/dcf-.../v2/"}]
callback_urlstring | nullNoURL to POST completion results to
user_idstringNoUser ID for app storage (default "user-test-001")
app_idstring | nullNoApp ID for versioning. If null, auto-generated on first app creation

Example

curl -N -X POST /agent \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Screen for S&P500 companies with positive estimate revisions"}'

SSE Response Event Stream

EventWhenKey Fields
sandbox:init_startSandbox creation beginssandbox_id
sandbox:init_completeSandbox readysandbox_id, is_existing, workspace_files
files:download_startFile download beginsfile_urls, count
files:download_progressEach file completesfile.filename, file.status
files:download_completeAll files downloaded
agent:startAgent begins processingprompt
agent:messageEach Claude stream-json chunktype (system / assistant / user / result)
agent:completeAgent finishedoutput, session_id, sandbox_id
app:artifactApp files changed & uploadedapp_id, version_id, result_urls, source_urls, name, description
errorAny stage failserror

GET /files/list

List files in a sandbox directory.

GET /files/list?sandbox_id=xxx&path=/home/user/workspace

GET /files

Download a file from sandbox.

GET /files?sandbox_id=xxx&path=/home/user/workspace/result.csv

GET /health

{"status": "healthy"}