From 8b5f6c7b060b5cad33d8bcd346550a64f864b415 Mon Sep 17 00:00:00 2001 From: alitariksahin Date: Wed, 1 Apr 2026 18:57:27 +0300 Subject: [PATCH 1/3] feat: add openclaw setup guideline in box --- box/guides/openclaw-setup.mdx | 111 ++++++++++++++++++++++++++++++++++ docs.json | 2 +- 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 box/guides/openclaw-setup.mdx diff --git a/box/guides/openclaw-setup.mdx b/box/guides/openclaw-setup.mdx new file mode 100644 index 00000000..0fda15ef --- /dev/null +++ b/box/guides/openclaw-setup.mdx @@ -0,0 +1,111 @@ +--- +title: "OpenClaw Setup" +--- +This guide covers a basic setup to run [OpenClaw](https://docs.openclaw.ai/start/wizard-cli-automation) inside an Upstash Box. For advanced non-interactive configuration options, refer to the [full CLI automation docs](https://docs.openclaw.ai/start/wizard-cli-automation). + +--- + +## 1. Create a Box + +Create a box with a Node runtime and attach your LLM provider API key as a header. Using `attachHeaders` ensures your key is injected securely at the network level and never exposed inside the container. + + + +```typescript +import { Box } from "@upstash/box" + +const box = await Box.create({ + runtime: "node", + size: "large", + attachHeaders: { + "api.anthropic.com": { + Authorization: `Bearer ${process.env.ANTHROPIC_API_KEY}`, + }, + }, +}) +``` + + +```typescript +import { Box } from "@upstash/box" + +const box = await Box.create({ + runtime: "node", + size: "large", + attachHeaders: { + "api.openai.com": { + Authorization: `Bearer ${process.env.OPENAI_API_KEY}`, + }, + }, +}) +``` + + +```typescript +import { Box } from "@upstash/box" + +const box = await Box.create({ + runtime: "node", + size: "large", + attachHeaders: { + "openrouter.ai": { + Authorization: `Bearer ${process.env.OPENROUTER_API_KEY}`, + }, + }, +}) +``` + + + + + +## 2. Install OpenClaw + +Install the OpenClaw CLI globally inside the box. + +```bash +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. + + + +```bash +openclaw onboard --non-interactive --accept-risk --mode local --auth-choice apiKey --gateway-port 18789 --gateway-bind loopback --skip-skills --skip-health +``` + + +```bash +openclaw onboard --non-interactive --accept-risk --mode local --auth-choice openai-api-key --gateway-port 18789 --gateway-bind loopback --skip-skills --skip-health +``` + + +```bash +openclaw onboard --non-interactive --accept-risk --mode local --auth-choice custom-api-key --custom-base-url "https://openrouter.ai/api/v1" --custom-model-id "anthropic/claude-sonnet-4-6" --custom-provider-id "openrouter" --custom-compatibility anthropic --gateway-port 18789 --gateway-bind loopback --skip-skills --skip-health +``` + + + +See the [CLI automation docs](https://docs.openclaw.ai/start/wizard-cli-automation) 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. + +```bash +# 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?" +``` diff --git a/docs.json b/docs.json index 4b6673c6..9b79ea33 100644 --- a/docs.json +++ b/docs.json @@ -1592,7 +1592,7 @@ "box/overall/security", { "group": "Guides", - "pages": ["box/guides/code-review-agent"] + "pages": ["box/guides/code-review-agent", "box/guides/openclaw-setup"] } ] } From 376e07a139339d07df7d554557aeb909cd1ed56d Mon Sep 17 00:00:00 2001 From: alitariksahin Date: Thu, 2 Apr 2026 15:59:04 +0300 Subject: [PATCH 2/3] fix: remove box size settings , and redirect user to use attach headers in console --- box/guides/openclaw-setup.mdx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/box/guides/openclaw-setup.mdx b/box/guides/openclaw-setup.mdx index 0fda15ef..46be8148 100644 --- a/box/guides/openclaw-setup.mdx +++ b/box/guides/openclaw-setup.mdx @@ -5,9 +5,11 @@ This guide covers a basic setup to run [OpenClaw](https://docs.openclaw.ai/start --- -## 1. Create a Box +## 1. Create box -Create a box with a Node runtime and attach your LLM provider API key as a header. Using `attachHeaders` ensures your key is injected securely at the network level and never exposed inside the container. +Create a `node` box with [attach headers](/box/overall/security#attach-headers) for the LLM provider your OpenClaw agent will call. + +In the console, use **Settings > Attach headers**, or set `attachHeaders` in code: @@ -16,7 +18,6 @@ import { Box } from "@upstash/box" const box = await Box.create({ runtime: "node", - size: "large", attachHeaders: { "api.anthropic.com": { Authorization: `Bearer ${process.env.ANTHROPIC_API_KEY}`, @@ -31,7 +32,6 @@ import { Box } from "@upstash/box" const box = await Box.create({ runtime: "node", - size: "large", attachHeaders: { "api.openai.com": { Authorization: `Bearer ${process.env.OPENAI_API_KEY}`, @@ -46,7 +46,6 @@ import { Box } from "@upstash/box" const box = await Box.create({ runtime: "node", - size: "large", attachHeaders: { "openrouter.ai": { Authorization: `Bearer ${process.env.OPENROUTER_API_KEY}`, From 0a86d677c53ef85dbd135a829cc8b8a37f0d02e4 Mon Sep 17 00:00:00 2001 From: alitariksahin Date: Thu, 2 Apr 2026 16:38:16 +0300 Subject: [PATCH 3/3] fix: put dummy api keys --- box/guides/openclaw-setup.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/box/guides/openclaw-setup.mdx b/box/guides/openclaw-setup.mdx index 46be8148..3c4977de 100644 --- a/box/guides/openclaw-setup.mdx +++ b/box/guides/openclaw-setup.mdx @@ -75,17 +75,17 @@ Configure OpenClaw non-interactively for your provider. This sets up the local g ```bash -openclaw onboard --non-interactive --accept-risk --mode local --auth-choice apiKey --gateway-port 18789 --gateway-bind loopback --skip-skills --skip-health +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 ``` ```bash -openclaw onboard --non-interactive --accept-risk --mode local --auth-choice openai-api-key --gateway-port 18789 --gateway-bind loopback --skip-skills --skip-health +openclaw onboard --non-interactive --accept-risk --mode local --auth-choice openai-api-key --openai-api-key "dummy" --gateway-port 18789 --gateway-bind loopback --skip-skills --skip-health ``` ```bash -openclaw onboard --non-interactive --accept-risk --mode local --auth-choice custom-api-key --custom-base-url "https://openrouter.ai/api/v1" --custom-model-id "anthropic/claude-sonnet-4-6" --custom-provider-id "openrouter" --custom-compatibility anthropic --gateway-port 18789 --gateway-bind loopback --skip-skills --skip-health +openclaw onboard --non-interactive --accept-risk --mode local --auth-choice custom-api-key --custom-base-url "https://openrouter.ai/api/v1" --custom-model-id "anthropic/claude-sonnet-4-6" --custom-api-key "dummy" --custom-provider-id "openrouter" --custom-compatibility anthropic --gateway-port 18789 --gateway-bind loopback --skip-skills --skip-health ```