Skip to main content
Codex is OpenAI’s terminal coding agent. Run it in a Superserve sandbox so its shell commands and file edits stay isolated from your machine.

Via the console

  1. On the Secrets page, create a secret with the OpenAI provider and paste your API key — you only do this once, and the key never enters the sandbox.
  2. Go to console.superserve.ai and click Create sandbox.
  3. Pick the superserve/node-22 template.
  4. Under Advanced Options → Secrets, bind that secret to OPENAI_API_KEY.
  5. Create the sandbox, open its Terminal, and run:

Via the SDK

Codex reads OPENAI_API_KEY as usual, but its value is a stand-in token — the real key is attached only on requests to OpenAI, never exposed to the agent. Open the sandbox in the console, launch the terminal, and run codex. For non-interactive runs, codex exec does not read OPENAI_API_KEY: run printenv OPENAI_API_KEY | codex login --with-api-key once, or run export CODEX_API_KEY="$OPENAI_API_KEY" first.

Persist sessions

Delete when finished

A paused sandbox is kept until you delete it. When you no longer need the sandbox, delete it. This also deletes its files and saved state.
To delete it from another process, pass its ID to Sandbox.killById() (TypeScript) or Sandbox.kill_by_id() (Python). To delete paused sandboxes automatically, see Auto-delete.