Skip to main content
This guide covers a basic setup to run OpenClaw inside an Upstash Box. For advanced non-interactive configuration options, refer to the full CLI automation docs.

1. Create box

Create a node box with attach headers for the LLM provider your OpenClaw agent will call. In the console, use Settings > Attach headers, or set attachHeaders in code:
import { Box } from "@upstash/box"

const box = await Box.create({
  runtime: "node",
  attachHeaders: {
    "api.anthropic.com": {
      Authorization: `Bearer ${process.env.ANTHROPIC_API_KEY}`,
    },
  },
})

2. Install OpenClaw

Install the OpenClaw CLI globally inside the box.
sudo npm i -g openclaw

3. Run onboarding

Configure OpenClaw non-interactively for your provider. This sets up the local gateway and authentication without requiring any interactive prompts.
openclaw onboard --non-interactive --accept-risk --mode local --auth-choice apiKey --anthropic-api-key "dummy" --gateway-port 18789 --gateway-bind loopback --skip-skills --skip-health
See the CLI automation docs for the full list of flags and options.

4. Start the gateway and chat with your agent

Start the OpenClaw gateway in the background, verify it’s healthy, then send your first message to the agent.
# Start the gateway in the background
openclaw gateway run &

# Verify it's running
openclaw gateway health

# Chat with your agent
openclaw agent --agent main --message "hello, are you there?"