boxlite exec.
Complete the workstation setup. Run all commands below on your workstation.
Create the box and install Codex
Savecreate.py. Before running it, replace <YOUR_MODEL_HOST> with your model endpoint’s hostname, without the scheme or path. The prompt reads the real model key on your workstation; only BoxLite’s Secret configuration receives it.
create.py
node image includes glibc and system CA certificates, which the native Codex binary needs.
Connect your model
Use an existing Responses-compatible endpoint that supports tool calls. SetSecret.hosts in create.py to its hostname. Save this native Codex configuration as config.toml, replacing the API base URL and model ID:
config.toml
Run a task
turn.failed events and verify the file before treating a task as successful.
Optional: wake on a request
This walkthrough creates a separatecodex-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 Codex 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.
Use the same model endpoint and Secret settings as the CLI deployment above.
2. Save the HTTP service
Save the complete code below asserver.mjs. The service accepts {"prompt":"..."}, runs one Codex task at a time with a three-minute limit, and returns Codex’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. Keep config.toml from the model setup above. Install Codex, upload the model configuration, service and token hash, then register port 8080:
4. Send the first task
SetCODEX_URL to the HTTPS URL returned by the last command. Keep this shell open for the wake-up check.
"ok": true and the independent file check prints CODEX_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 Codex 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.

