boxlite exec returns its output.
Complete the workstation setup. Run all commands below on your workstation.
Create the box and install Claude Code
Savecreate.py. The prompt reads the real model key on your workstation; only BoxLite’s Secret configuration receives it.
create.py
node image runs as the non-root boxlite user. Claude Code requires a non-root user for permission-bypass mode.
Connect your model
The create script uses Claude Code’s nativeANTHROPIC_API_KEY setting. Its value inside the box is the literal <BOXLITE_SECRET:anthropic>; BoxLite supplies the real key on outbound requests to api.anthropic.com.
Claude Code selects its default model. To select another, add its native --model option to the command below. For a different supported provider, follow Claude Code’s model configuration and match the Secret’s hosts to its API endpoint.
Run a task
is_error in the JSON response as well as the actual file.
Optional: wake on a request
This walkthrough creates a separateclaude-http box with an authenticated POST /tasks endpoint. After two idle minutes, the box stops. Sending another task to the same URL starts the box and runs Claude Code again.
Run every command below on your workstation, in one directory. You will create two source files and a local caller token. The token’s hash goes into the box; the real model key stays in BoxLite’s Secret.
1. Create the HTTP box
Save this ascreate-http.py. Its startup command waits for the files installed in step 3, then starts the service on every boot.
create-http.py
auto_stop=0 instead if you want this HTTP service to stay running. Keep the value shown to try automatic stop and wake.
For an existing Anthropic Messages-compatible endpoint, add ANTHROPIC_BASE_URL and ANTHROPIC_MODEL to env, and change Secret.hosts to that endpoint’s hostname. Supply its key at the prompt; keep the placeholder unchanged.
2. Save the HTTP service
Save the complete code below asserver.mjs. The service accepts {"prompt":"..."}, runs one Claude task at a time with a three-minute limit, and returns Claude’s JSON result. POST /tasks is this example’s application API.
server.mjs — complete source
server.mjs — complete source
server.mjs
3. Install and start the service
Generate the caller token and its hash locally:http-token on your workstation and out of Git. Install Claude Code, upload the service and token hash, then register port 8080:
4. Send the first task
SetCLAUDE_URL to the HTTPS URL returned by the last command. Keep this shell open for the wake-up check.
"is_error": false and the independent file check prints CLAUDE_HTTP_READY.
5. Wait for automatic stop
Stop sending HTTP requests, including health checks. Run only this control-plane check untilStatus is stopped:
start, exec, or cp before the next request: the HTTP request should be the action that wakes the box.
6. Wake Claude with another task
Send a new task to the same URL:503 BOX_STARTING, wait for Retry-After before retrying. The service returns 401 for a wrong caller token and 409 while another task is running. A timed-out request can have partial effects: inspect its output before resubmitting it.
7. Clean up the HTTP box
exec, the CLI command above also supports wake on access; this HTTP service is optional.

