From 2d5f886e0561bb011c3db63fedd012a4c193853d Mon Sep 17 00:00:00 2001 From: EthanW Date: Mon, 20 Jul 2026 15:27:46 -0500 Subject: [PATCH] Add OpenClaw + Token Station tutorial (en/zh/ja/ko) New Writings article walking through configuring OpenClaw as a Token Station custom provider, swapping models, and smart routing. Adapted from a plain-text draft into house Markdown style with translations for all four languages, plus sitemap entries. Co-Authored-By: Claude Sonnet 5 --- sitemap.xml | 20 +++ ...model-in-openclaw-through-token-station.md | 148 ++++++++++++++++++ ...model-in-openclaw-through-token-station.md | 148 ++++++++++++++++++ ...model-in-openclaw-through-token-station.md | 148 ++++++++++++++++++ ...model-in-openclaw-through-token-station.md | 148 ++++++++++++++++++ 5 files changed, 612 insertions(+) create mode 100644 src/content/writings/en/run-any-model-in-openclaw-through-token-station.md create mode 100644 src/content/writings/ja/run-any-model-in-openclaw-through-token-station.md create mode 100644 src/content/writings/ko/run-any-model-in-openclaw-through-token-station.md create mode 100644 src/content/writings/zh/run-any-model-in-openclaw-through-token-station.md diff --git a/sitemap.xml b/sitemap.xml index 471828f..02a5b48 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -105,6 +105,26 @@ 2026-07-13 0.6 + + https://bytefuture.ai/blog/run-any-model-in-openclaw-through-token-station.html + 2026-07-20 + 0.7 + + + https://bytefuture.ai/blog/run-any-model-in-openclaw-through-token-station-zh.html + 2026-07-20 + 0.6 + + + https://bytefuture.ai/blog/run-any-model-in-openclaw-through-token-station-ja.html + 2026-07-20 + 0.6 + + + https://bytefuture.ai/blog/run-any-model-in-openclaw-through-token-station-ko.html + 2026-07-20 + 0.6 + https://bytefuture.ai/blog/glm-5-2-zai-stock-jump.html 2026-06-15 diff --git a/src/content/writings/en/run-any-model-in-openclaw-through-token-station.md b/src/content/writings/en/run-any-model-in-openclaw-through-token-station.md new file mode 100644 index 0000000..f200aa4 --- /dev/null +++ b/src/content/writings/en/run-any-model-in-openclaw-through-token-station.md @@ -0,0 +1,148 @@ +--- +slug: "run-any-model-in-openclaw-through-token-station" +lang: "en" +title: "Run any model in OpenClaw through Token Station" +summary: "OpenClaw supports custom providers through its onboarding wizard and CLI. Point it at Token Station's OpenAI-compatible endpoint, covering 250+ models across 21 providers, and run GPT-5.5, Claude Opus, Kimi K2, or Grok without changing anything else in your setup." +category: "tutorial" +date: "2026-07-20" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +OpenClaw supports custom providers (any OpenAI-compatible or Anthropic-compatible endpoint) through its onboarding wizard and CLI. Token Station's unified API lives at `https://models.bytefuture.ai/v1` and exposes over 250 models across 21 providers through an OpenAI-compatible interface. Point OpenClaw at Token Station and you can run GPT-5.5, Claude Opus, Kimi K2, Grok, or any other model on Token Station without changing anything else in your setup. One key, one endpoint, any model. + +## What you need before starting + +- Node 22.22.3+, 24.15+, or 25.9+ (Node 24 is the recommended default). Check with `node --version`. +- A Token Station account and API key. Sign up free at [models.bytefuture.ai](https://models.bytefuture.ai): $1 in credit on registration, no card required. +- OpenClaw installed (see Step 1 below). + +## Step 1: Install OpenClaw + +**macOS / Linux / WSL2**: the `--no-onboard` flag skips the auto-launched wizard so you can configure Token Station specifically in Step 2: + +```bash +curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard +``` + +**Windows (PowerShell) or any platform via npm**: npm install does not auto-launch onboarding: + +```bash +npm install -g openclaw@latest +``` + +Verify the binary is working: + +```bash +openclaw --version +``` + +## Step 2: Configure Token Station as your provider + +Export your Token Station key, then run onboarding with the custom provider flags: + +```bash +# macOS / Linux / WSL2 +export TOKEN_STATION_API_KEY="YOUR_TOKEN_STATION_KEY" + +# Windows PowerShell +$env:TOKEN_STATION_API_KEY = "YOUR_TOKEN_STATION_KEY" +``` + +```bash +openclaw onboard --install-daemon --non-interactive --accept-risk \ + --auth-choice custom-api-key \ + --custom-base-url "https://models.bytefuture.ai/v1" \ + --custom-model-id "openai/gpt-5.4-mini" \ + --custom-api-key "$TOKEN_STATION_API_KEY" \ + --secret-input-mode plaintext \ + --custom-compatibility openai +``` + +This configures OpenClaw with Token Station as the provider, installs the background daemon, and sets `openai/gpt-5.4-mini` as the default model. + +**What each flag does** + +| Flag | Meaning | +|---|---| +| `--auth-choice custom-api-key` | Selects the custom API key provider path instead of a named provider (OpenAI, Anthropic, etc.). | +| `--custom-base-url` | The endpoint OpenClaw sends requests to. Token Station's OpenAI-compatible base is `https://models.bytefuture.ai/v1`. | +| `--custom-model-id` | The default model ID OpenClaw will use, in `provider/model` form. | +| `--custom-api-key` | Your Token Station API key. The `$TOKEN_STATION_API_KEY` reference keeps the secret out of your shell history. | +| `--secret-input-mode` | How OpenClaw stores the API key. `plaintext` stores it directly in the agent's auth profile on disk. | +| `--custom-compatibility` | Controls the wire protocol. `openai` uses standard chat completions, correct for Token Station. Only use `openai-responses` for endpoints that support `/v1/responses` but not `/v1/chat/completions`. Use `anthropic` for Anthropic-native endpoints. | +| `--install-daemon` | Installs OpenClaw as a background service (LaunchAgent on macOS, systemd on Linux/WSL2, Scheduled Task on Windows, with a Startup-folder fallback if task creation is denied). | + +**Prefer the interactive wizard?** Run `openclaw onboard --install-daemon` without the other flags. When the wizard reaches the Model/Auth step, choose the custom provider option and select OpenAI-compatible, then enter `https://models.bytefuture.ai/v1` as the base URL and your Token Station key as the API key. + +## Step 3: Verify the gateway is running + +```bash +openclaw gateway status +``` + +The daemon installed in Step 2 should have the gateway running already. If not, the status command will tell you what's wrong. + +## Step 4: Open the Control UI and confirm + +```bash +openclaw dashboard +``` + +The dashboard opens at `http://127.0.0.1:18789/` in your browser. Start a chat. If the agent responds, OpenClaw is talking to Token Station and the model is answering. + +## Swap the model with one command + +Every model on Token Station sits behind the same endpoint and the same key. To change the default model: + +```bash +openclaw configure --section model +``` + +Or re-run onboarding with a different `--custom-model-id`. Some IDs to choose from: + +| Model ID | Good for | +|---|---| +| `openai/gpt-5.5` | Premium flagship; hard planning, debugging, and architecture. | +| `openai/gpt-5.4` | Strong reasoning at a lower price than the flagship. | +| `openai/gpt-5.4-mini` | Balanced daily driver for most tasks at lower cost. | +| `anthropic/claude-opus-4-8` | Long-horizon agentic reasoning and deep analysis. | +| `kimi/kimi-k2.7-code` | Routine coding tasks when cost matters more than depth. | +| `xai/grok-build-0.1` | Fast and affordable for quick responses. | +| `glm/glm-5.2` | 1M context window; strong on code at a low price. | + +The gateway, channels, and daemon don't change when you swap the model. Only the model ID sent to Token Station changes. + +## Smart routing: let a policy pick the model + +Hardcoding a model is fine for most setups. Token Station also lets you define routing policies server-side: cheapest model above a quality floor, latency-capped with a provider allowlist, or a primary model with an automatic fallback if the primary is unavailable. + +For OpenClaw this means you point `--custom-model-id` at a routed workload on Token Station and the routing logic stays on Token Station's side. If your primary model goes down, the fallback answers and OpenClaw never has to know. You update the policy in Token Station; nothing in your OpenClaw config changes. + +## Useful environment variables + +Set these before starting the daemon if you need non-default locations: + +| Variable | Purpose | +|---|---| +| `OPENCLAW_HOME` | Overrides the home directory used for internal path resolution. | +| `OPENCLAW_STATE_DIR` | Overrides the state directory. | +| `OPENCLAW_CONFIG_PATH` | Overrides the config file path. | + +## If something does not connect + +**401 / auth error.** Confirm your Token Station key is correct. Re-run the onboard command with the corrected `--custom-api-key`, or run `openclaw configure --section model` to update credentials interactively. + +**Wrong model or model not found.** Confirm the model ID exactly as it appears in the Token Station catalog at [models.bytefuture.ai/models](https://models.bytefuture.ai/models). Run `openclaw configure --section model` to update the model ID. + +**The gateway is not running.** Run `openclaw gateway status`. To restart the gateway, use `openclaw gateway restart`. To reinstall the daemon from scratch, re-run `openclaw onboard --install-daemon`. + +**The dashboard does not load.** The gateway must be running first. Confirm with `openclaw gateway status`, then retry `openclaw dashboard`. + +**Config issues or unexpected behavior.** Run `openclaw doctor` to diagnose invalid or legacy config, then re-run `openclaw configure` to fix what it finds. + +## Get started + +Setting up Token Station in OpenClaw is one command and one environment variable. Once the daemon is running, switching models is a single `openclaw configure --section model` call and nothing else in your setup changes. + +Sign up at [models.bytefuture.ai](https://models.bytefuture.ai) ($1 in free credit, no card; up to $50 bonus on your first top-up), export your key, run the onboard command, and open the dashboard. One key, one endpoint, every model your OpenClaw setup needs. diff --git a/src/content/writings/ja/run-any-model-in-openclaw-through-token-station.md b/src/content/writings/ja/run-any-model-in-openclaw-through-token-station.md new file mode 100644 index 0000000..a16dee2 --- /dev/null +++ b/src/content/writings/ja/run-any-model-in-openclaw-through-token-station.md @@ -0,0 +1,148 @@ +--- +slug: "run-any-model-in-openclaw-through-token-station" +lang: "ja" +title: "Token Station 経由で OpenClaw に任意のモデルを使う" +summary: "OpenClaw はオンボーディングウィザードと CLI からカスタムプロバイダーに対応する。Token Station の OpenAI 互換エンドポイント(21 プロバイダーにまたがる 250 以上のモデル)を指定すれば、GPT-5.5、Claude Opus、Kimi K2、Grok を、既存の設定を一切変えずに実行できる。" +category: "tutorial" +date: "2026-07-20" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +OpenClaw はオンボーディングウィザードと CLI から、カスタムプロバイダー(任意の OpenAI 互換または Anthropic 互換のエンドポイント)に対応している。Token Station の統一 API は `https://models.bytefuture.ai/v1` にあり、OpenAI 互換インターフェースを通じて 21 プロバイダーにまたがる 250 以上のモデルを提供する。OpenClaw を Token Station に向ければ、GPT-5.5、Claude Opus、Kimi K2、Grok、その他 Token Station 上のどのモデルでも、設定の他の部分を一切変えずに実行できる。1 つのキー、1 つのエンドポイント、あらゆるモデル。 + +## 始める前に必要なもの + +- Node 22.22.3+、24.15+、または 25.9+(推奨デフォルトは Node 24)。`node --version` で確認する。 +- Token Station のアカウントと API キー。[models.bytefuture.ai](https://models.bytefuture.ai) から無料登録できる。登録時に 1 ドル分のクレジットが付与され、クレジットカードは不要。 +- OpenClaw のインストール(以下のステップ 1 を参照)。 + +## ステップ 1:OpenClaw をインストールする + +**macOS / Linux / WSL2**:`--no-onboard` フラグは自動起動するウィザードをスキップするので、ステップ 2 で Token Station を個別に設定できる。 + +```bash +curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard +``` + +**Windows(PowerShell)、または npm を使う任意のプラットフォーム**:npm install はオンボーディングを自動起動しない。 + +```bash +npm install -g openclaw@latest +``` + +バイナリが動作しているか確認する。 + +```bash +openclaw --version +``` + +## ステップ 2:Token Station をプロバイダーとして設定する + +Token Station のキーをエクスポートし、カスタムプロバイダーのフラグを付けてオンボーディングを実行する。 + +```bash +# macOS / Linux / WSL2 +export TOKEN_STATION_API_KEY="YOUR_TOKEN_STATION_KEY" + +# Windows PowerShell +$env:TOKEN_STATION_API_KEY = "YOUR_TOKEN_STATION_KEY" +``` + +```bash +openclaw onboard --install-daemon --non-interactive --accept-risk \ + --auth-choice custom-api-key \ + --custom-base-url "https://models.bytefuture.ai/v1" \ + --custom-model-id "openai/gpt-5.4-mini" \ + --custom-api-key "$TOKEN_STATION_API_KEY" \ + --secret-input-mode plaintext \ + --custom-compatibility openai +``` + +これで OpenClaw に Token Station がプロバイダーとして設定され、バックグラウンドデーモンがインストールされ、デフォルトモデルとして `openai/gpt-5.4-mini` が設定される。 + +**各フラグの意味** + +| フラグ | 意味 | +|---|---| +| `--auth-choice custom-api-key` | 名前付きプロバイダー(OpenAI、Anthropic など)ではなく、カスタム API キーのプロバイダー経路を選択する。 | +| `--custom-base-url` | OpenClaw がリクエストを送るエンドポイント。Token Station の OpenAI 互換ベースは `https://models.bytefuture.ai/v1`。 | +| `--custom-model-id` | OpenClaw が使用するデフォルトモデル ID。`provider/model` の形式。 | +| `--custom-api-key` | あなたの Token Station API キー。`$TOKEN_STATION_API_KEY` という参照にしておけば、シークレットがシェル履歴に残らない。 | +| `--secret-input-mode` | OpenClaw が API キーを保存する方式。`plaintext` はキーをエージェントの認証プロファイルにそのまま保存する。 | +| `--custom-compatibility` | ワイヤープロトコルを制御する。`openai` は標準の chat completions を使い、Token Station には正しい選択。`/v1/responses` はサポートするが `/v1/chat/completions` はサポートしないエンドポイントに限り `openai-responses` を使う。Anthropic ネイティブのエンドポイントには `anthropic` を使う。 | +| `--install-daemon` | OpenClaw をバックグラウンドサービスとしてインストールする(macOS では LaunchAgent、Linux/WSL2 では systemd、Windows ではタスクスケジューラ。タスク作成が拒否された場合はスタートアップフォルダにフォールバックする)。 | + +**対話型ウィザードの方がよければ**、他のフラグなしで `openclaw onboard --install-daemon` を実行する。ウィザードが Model/Auth のステップに達したら、カスタムプロバイダーのオプションを選び、OpenAI 互換を選択し、ベース URL に `https://models.bytefuture.ai/v1` を、API キーに Token Station のキーを入力する。 + +## ステップ 3:ゲートウェイが動いているか確認する + +```bash +openclaw gateway status +``` + +ステップ 2 でインストールしたデーモンが、すでにゲートウェイを起動しているはずだ。動いていなければ、ステータスコマンドが何が問題かを教えてくれる。 + +## ステップ 4:コントロール UI を開いて確認する + +```bash +openclaw dashboard +``` + +ダッシュボードはブラウザで `http://127.0.0.1:18789/` に開く。チャットを始めてみよう。エージェントが応答すれば、OpenClaw が Token Station と通信しており、モデルが答えているということだ。 + +## モデルを 1 コマンドで切り替える + +Token Station 上のすべてのモデルは同じエンドポイント、同じキーの背後にある。デフォルトモデルを変更するには次のようにする。 + +```bash +openclaw configure --section model +``` + +または `--custom-model-id` を変えてオンボーディングを再実行する。選べるモデル ID の例: + +| モデル ID | 向いている用途 | +|---|---| +| `openai/gpt-5.5` | プレミアムなフラッグシップ。難しいプランニング、デバッグ、アーキテクチャ設計に。 | +| `openai/gpt-5.4` | フラッグシップより低価格で高い推論力。 | +| `openai/gpt-5.4-mini` | 多くのタスクに向くバランス型の日常使いモデルで、コストも低い。 | +| `anthropic/claude-opus-4-8` | 長時間にわたるエージェント的推論と深い分析に。 | +| `kimi/kimi-k2.7-code` | 深さよりコストを優先したい日常的なコーディングタスクに。 | +| `xai/grok-build-0.1` | 高速で手頃、素早い応答に向く。 | +| `glm/glm-5.2` | 100 万トークンのコンテキストウィンドウ。コードに強く低価格。 | + +モデルを切り替えても、ゲートウェイ、チャネル、デーモンは変わらない。変わるのは Token Station に送られるモデル ID だけだ。 + +## スマートルーティング:ポリシーにモデルを選ばせる + +ほとんどの環境ではモデルをハードコードするだけで十分だ。Token Station ではサーバー側でルーティングポリシーを定義することもできる。品質の下限を満たす中で最も安いモデル、プロバイダーの許可リスト付きでレイテンシに上限を設けたもの、あるいはプライマリモデルに自動フォールバックを組み合わせたものなどだ。 + +OpenClaw の場合、`--custom-model-id` を Token Station 上のルーティング対象ワークロードに向ければ、ルーティングのロジックは Token Station 側に留まる。プライマリモデルがダウンしても、フォールバックが応答し、OpenClaw 側は何も気づく必要がない。ポリシーは Token Station 側で更新するだけで、OpenClaw の設定は何も変わらない。 + +## 便利な環境変数 + +デフォルト以外の場所を使いたい場合は、デーモンを起動する前に次を設定する。 + +| 変数 | 用途 | +|---|---| +| `OPENCLAW_HOME` | 内部のパス解決に使われるホームディレクトリを上書きする。 | +| `OPENCLAW_STATE_DIR` | 状態ディレクトリを上書きする。 | +| `OPENCLAW_CONFIG_PATH` | 設定ファイルのパスを上書きする。 | + +## 接続できないとき + +**401 / 認証エラー。** Token Station のキーが正しいか確認する。修正した `--custom-api-key` でオンボーディングコマンドを再実行するか、`openclaw configure --section model` で対話的に認証情報を更新する。 + +**モデルが違う、または見つからない。** [models.bytefuture.ai/models](https://models.bytefuture.ai/models) の Token Station カタログに記載されたモデル ID と完全に一致しているか確認する。`openclaw configure --section model` でモデル ID を更新する。 + +**ゲートウェイが起動していない。** `openclaw gateway status` を実行する。ゲートウェイを再起動するには `openclaw gateway restart` を使う。デーモンをゼロから再インストールするには `openclaw onboard --install-daemon` を再実行する。 + +**ダッシュボードが読み込まれない。** まずゲートウェイが起動している必要がある。`openclaw gateway status` で確認してから、`openclaw dashboard` を再試行する。 + +**設定の問題や予期しない動作。** `openclaw doctor` を実行して、無効な設定や古い設定を診断し、見つかった問題を直すために `openclaw configure` を再実行する。 + +## はじめよう + +OpenClaw に Token Station を設定するのは、コマンド 1 つと環境変数 1 つだけで済む。デーモンが起動すれば、モデルの切り替えも `openclaw configure --section model` を 1 回呼ぶだけで、設定の他の部分は何も変わらない。 + +[models.bytefuture.ai](https://models.bytefuture.ai) で登録し(1 ドル分の無料クレジット、クレジットカード不要。初回チャージで最大 50 ドルのボーナスも)、キーをエクスポートし、オンボーディングコマンドを実行し、ダッシュボードを開こう。1 つのキー、1 つのエンドポイントで、あなたの OpenClaw 環境に必要なすべてのモデルが揃う。 diff --git a/src/content/writings/ko/run-any-model-in-openclaw-through-token-station.md b/src/content/writings/ko/run-any-model-in-openclaw-through-token-station.md new file mode 100644 index 0000000..af47dcd --- /dev/null +++ b/src/content/writings/ko/run-any-model-in-openclaw-through-token-station.md @@ -0,0 +1,148 @@ +--- +slug: "run-any-model-in-openclaw-through-token-station" +lang: "ko" +title: "Token Station을 통해 OpenClaw에서 어떤 모델이든 실행하기" +summary: "OpenClaw는 온보딩 위저드와 CLI를 통해 커스텀 프로바이더를 지원한다. Token Station의 OpenAI 호환 엔드포인트(21개 프로바이더에 걸친 250개 이상의 모델)를 가리키기만 하면, 기존 설정의 다른 부분을 전혀 바꾸지 않고 GPT-5.5, Claude Opus, Kimi K2, Grok을 실행할 수 있다." +category: "tutorial" +date: "2026-07-20" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +OpenClaw는 온보딩 위저드와 CLI를 통해 커스텀 프로바이더(어떤 OpenAI 호환 또는 Anthropic 호환 엔드포인트든)를 지원한다. Token Station의 통합 API는 `https://models.bytefuture.ai/v1`에 있으며, OpenAI 호환 인터페이스를 통해 21개 프로바이더에 걸친 250개 이상의 모델을 제공한다. OpenClaw를 Token Station으로 향하게 하면 GPT-5.5, Claude Opus, Kimi K2, Grok, 그 밖에 Token Station에 있는 어떤 모델이든 설정의 다른 부분을 전혀 바꾸지 않고 실행할 수 있다. 키 하나, 엔드포인트 하나, 어떤 모델이든. + +## 시작하기 전에 필요한 것 + +- Node 22.22.3+, 24.15+, 또는 25.9+(기본값으로는 Node 24를 권장). `node --version`으로 확인한다. +- Token Station 계정과 API 키. [models.bytefuture.ai](https://models.bytefuture.ai)에서 무료로 가입할 수 있다. 가입 시 1달러 크레딧이 지급되며 카드는 필요 없다. +- OpenClaw 설치(아래 1단계 참고). + +## 1단계: OpenClaw 설치하기 + +**macOS / Linux / WSL2**: `--no-onboard` 플래그는 자동으로 실행되는 위저드를 건너뛰어, 2단계에서 Token Station을 따로 설정할 수 있게 해준다. + +```bash +curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard +``` + +**Windows(PowerShell) 또는 npm을 쓰는 모든 플랫폼**: npm install은 온보딩을 자동으로 실행하지 않는다. + +```bash +npm install -g openclaw@latest +``` + +바이너리가 제대로 동작하는지 확인한다. + +```bash +openclaw --version +``` + +## 2단계: Token Station을 프로바이더로 설정하기 + +Token Station 키를 export한 다음, 커스텀 프로바이더 플래그와 함께 온보딩을 실행한다. + +```bash +# macOS / Linux / WSL2 +export TOKEN_STATION_API_KEY="YOUR_TOKEN_STATION_KEY" + +# Windows PowerShell +$env:TOKEN_STATION_API_KEY = "YOUR_TOKEN_STATION_KEY" +``` + +```bash +openclaw onboard --install-daemon --non-interactive --accept-risk \ + --auth-choice custom-api-key \ + --custom-base-url "https://models.bytefuture.ai/v1" \ + --custom-model-id "openai/gpt-5.4-mini" \ + --custom-api-key "$TOKEN_STATION_API_KEY" \ + --secret-input-mode plaintext \ + --custom-compatibility openai +``` + +이 명령은 OpenClaw에 Token Station을 프로바이더로 설정하고, 백그라운드 데몬을 설치하고, 기본 모델로 `openai/gpt-5.4-mini`를 지정한다. + +**각 플래그의 역할** + +| 플래그 | 의미 | +|---|---| +| `--auth-choice custom-api-key` | 이름이 지정된 프로바이더(OpenAI, Anthropic 등) 대신 커스텀 API 키 프로바이더 경로를 선택한다. | +| `--custom-base-url` | OpenClaw가 요청을 보내는 엔드포인트. Token Station의 OpenAI 호환 베이스는 `https://models.bytefuture.ai/v1`이다. | +| `--custom-model-id` | OpenClaw가 사용할 기본 모델 ID로, `provider/model` 형식이다. | +| `--custom-api-key` | 당신의 Token Station API 키. `$TOKEN_STATION_API_KEY` 참조를 쓰면 시크릿이 셸 히스토리에 남지 않는다. | +| `--secret-input-mode` | OpenClaw가 API 키를 저장하는 방식. `plaintext`는 키를 에이전트의 인증 프로필에 그대로 디스크에 저장한다. | +| `--custom-compatibility` | 와이어 프로토콜을 제어한다. `openai`는 표준 chat completions를 사용하며, Token Station에는 이것이 맞는 선택이다. `/v1/responses`는 지원하지만 `/v1/chat/completions`는 지원하지 않는 엔드포인트에서만 `openai-responses`를 사용한다. Anthropic 네이티브 엔드포인트에는 `anthropic`을 사용한다. | +| `--install-daemon` | OpenClaw를 백그라운드 서비스로 설치한다(macOS에서는 LaunchAgent, Linux/WSL2에서는 systemd, Windows에서는 예약 작업이며, 작업 생성이 거부되면 시작 프로그램 폴더로 대체된다). | + +**대화형 위저드를 선호한다면**, 다른 플래그 없이 `openclaw onboard --install-daemon`을 실행하면 된다. 위저드가 Model/Auth 단계에 도달하면 커스텀 프로바이더 옵션을 선택하고 OpenAI 호환을 고른 다음, 베이스 URL에 `https://models.bytefuture.ai/v1`을, API 키에 Token Station 키를 입력한다. + +## 3단계: 게이트웨이가 실행 중인지 확인하기 + +```bash +openclaw gateway status +``` + +2단계에서 설치한 데몬이 이미 게이트웨이를 실행 중이어야 한다. 그렇지 않다면 상태 명령이 무엇이 문제인지 알려준다. + +## 4단계: 컨트롤 UI를 열어 확인하기 + +```bash +openclaw dashboard +``` + +대시보드는 브라우저에서 `http://127.0.0.1:18789/`로 열린다. 채팅을 시작해 보자. 에이전트가 응답하면 OpenClaw가 Token Station과 통신하고 있고 모델이 답하고 있다는 뜻이다. + +## 명령 하나로 모델 바꾸기 + +Token Station의 모든 모델은 같은 엔드포인트, 같은 키 뒤에 있다. 기본 모델을 바꾸려면: + +```bash +openclaw configure --section model +``` + +또는 다른 `--custom-model-id`로 온보딩을 다시 실행한다. 선택할 수 있는 모델 ID 몇 가지: + +| 모델 ID | 적합한 용도 | +|---|---| +| `openai/gpt-5.5` | 프리미엄 플래그십. 어려운 플래닝, 디버깅, 아키텍처 설계에 적합. | +| `openai/gpt-5.4` | 플래그십보다 낮은 가격에 강력한 추론력. | +| `openai/gpt-5.4-mini` | 대부분의 작업에 균형 잡힌 일상용 모델로, 비용도 낮다. | +| `anthropic/claude-opus-4-8` | 장기간에 걸친 에이전트형 추론과 깊이 있는 분석에 적합. | +| `kimi/kimi-k2.7-code` | 깊이보다 비용이 중요한 일상적인 코딩 작업에 적합. | +| `xai/grok-build-0.1` | 빠르고 저렴해서 빠른 응답에 적합. | +| `glm/glm-5.2` | 100만 토큰 컨텍스트 윈도우. 코드에 강하고 저렴. | + +모델을 바꿔도 게이트웨이, 채널, 데몬은 그대로다. 바뀌는 것은 Token Station으로 전송되는 모델 ID뿐이다. + +## 스마트 라우팅: 정책이 모델을 고르게 하기 + +대부분의 설정에서는 모델을 하드코딩하는 것으로 충분하다. Token Station은 서버 측에서 라우팅 정책을 정의할 수도 있게 해준다. 품질 하한선을 만족하는 가장 저렴한 모델, 프로바이더 허용 목록과 함께 지연 시간에 상한을 둔 정책, 또는 주 모델에 자동 폴백을 붙인 방식 등이다. + +OpenClaw의 경우, `--custom-model-id`를 Token Station의 라우팅 대상 워크로드로 향하게 하면 라우팅 로직은 Token Station 쪽에 남는다. 주 모델이 다운되면 폴백이 대신 응답하고, OpenClaw는 그 사실을 알 필요조차 없다. 정책은 Token Station에서 업데이트하면 되고, OpenClaw 설정은 아무것도 바뀌지 않는다. + +## 유용한 환경 변수 + +기본이 아닌 위치를 써야 한다면 데몬을 시작하기 전에 다음을 설정한다. + +| 변수 | 용도 | +|---|---| +| `OPENCLAW_HOME` | 내부 경로 해석에 쓰이는 홈 디렉터리를 재정의한다. | +| `OPENCLAW_STATE_DIR` | 상태 디렉터리를 재정의한다. | +| `OPENCLAW_CONFIG_PATH` | 설정 파일 경로를 재정의한다. | + +## 연결이 안 될 때 + +**401 / 인증 오류.** Token Station 키가 올바른지 확인한다. 수정한 `--custom-api-key`로 온보딩 명령을 다시 실행하거나, `openclaw configure --section model`로 대화형으로 자격 증명을 업데이트한다. + +**모델이 틀렸거나 찾을 수 없음.** [models.bytefuture.ai/models](https://models.bytefuture.ai/models)의 Token Station 카탈로그에 나온 그대로 모델 ID가 일치하는지 확인한다. `openclaw configure --section model`로 모델 ID를 업데이트한다. + +**게이트웨이가 실행되고 있지 않음.** `openclaw gateway status`를 실행한다. 게이트웨이를 재시작하려면 `openclaw gateway restart`를 사용한다. 데몬을 처음부터 다시 설치하려면 `openclaw onboard --install-daemon`을 다시 실행한다. + +**대시보드가 로드되지 않음.** 게이트웨이가 먼저 실행 중이어야 한다. `openclaw gateway status`로 확인한 다음 `openclaw dashboard`를 다시 시도한다. + +**설정 문제 또는 예기치 않은 동작.** `openclaw doctor`를 실행해 잘못되었거나 오래된 설정을 진단한 다음, 발견된 문제를 고치기 위해 `openclaw configure`를 다시 실행한다. + +## 시작하기 + +OpenClaw에 Token Station을 설정하는 것은 명령 하나와 환경 변수 하나로 끝난다. 데몬이 실행되면, 모델을 바꾸는 것도 `openclaw configure --section model` 호출 한 번이면 되고 설정의 다른 부분은 아무것도 바뀌지 않는다. + +[models.bytefuture.ai](https://models.bytefuture.ai)에서 가입하고(1달러 무료 크레딧, 카드 불필요, 첫 충전 시 최대 50달러 보너스), 키를 export하고, 온보딩 명령을 실행하고, 대시보드를 열어보자. 키 하나, 엔드포인트 하나로 당신의 OpenClaw 환경에 필요한 모든 모델을 쓸 수 있다. diff --git a/src/content/writings/zh/run-any-model-in-openclaw-through-token-station.md b/src/content/writings/zh/run-any-model-in-openclaw-through-token-station.md new file mode 100644 index 0000000..dee8fd9 --- /dev/null +++ b/src/content/writings/zh/run-any-model-in-openclaw-through-token-station.md @@ -0,0 +1,148 @@ +--- +slug: "run-any-model-in-openclaw-through-token-station" +lang: "zh" +title: "在 OpenClaw 中通过 Token Station 运行任意模型" +summary: "OpenClaw 通过引导向导和 CLI 支持自定义提供方。将其指向 Token Station 的 OpenAI 兼容端点(覆盖 21 家提供商的 250 多个模型),即可运行 GPT-5.5、Claude Opus、Kimi K2 或 Grok,无需更改你现有设置中的其他任何部分。" +category: "tutorial" +date: "2026-07-20" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +OpenClaw 通过其引导向导和 CLI 支持自定义提供方(任意 OpenAI 兼容或 Anthropic 兼容的端点)。Token Station 的统一 API 位于 `https://models.bytefuture.ai/v1`,通过一个 OpenAI 兼容接口提供 21 家提供商的 250 多个模型。把 OpenClaw 指向 Token Station,你就可以运行 GPT-5.5、Claude Opus、Kimi K2、Grok,或 Token Station 上的任何其他模型,而无需更改你设置中的其他任何部分。一个密钥,一个端点,任意模型。 + +## 开始之前需要准备什么 + +- Node 22.22.3+、24.15+ 或 25.9+(推荐默认使用 Node 24)。用 `node --version` 检查版本。 +- 一个 Token Station 账户和 API 密钥。免费注册:[models.bytefuture.ai](https://models.bytefuture.ai),注册即送 1 美元额度,无需信用卡。 +- 已安装 OpenClaw(见下方步骤 1)。 + +## 步骤 1:安装 OpenClaw + +**macOS / Linux / WSL2**:`--no-onboard` 参数会跳过自动启动的向导,这样你可以在步骤 2 中专门配置 Token Station: + +```bash +curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard +``` + +**Windows(PowerShell)或通过 npm 安装(任意平台)**:通过 npm 安装不会自动启动引导流程: + +```bash +npm install -g openclaw@latest +``` + +验证程序是否可用: + +```bash +openclaw --version +``` + +## 步骤 2:将 Token Station 配置为你的提供方 + +先导出你的 Token Station 密钥,然后带上自定义提供方参数运行引导流程: + +```bash +# macOS / Linux / WSL2 +export TOKEN_STATION_API_KEY="YOUR_TOKEN_STATION_KEY" + +# Windows PowerShell +$env:TOKEN_STATION_API_KEY = "YOUR_TOKEN_STATION_KEY" +``` + +```bash +openclaw onboard --install-daemon --non-interactive --accept-risk \ + --auth-choice custom-api-key \ + --custom-base-url "https://models.bytefuture.ai/v1" \ + --custom-model-id "openai/gpt-5.4-mini" \ + --custom-api-key "$TOKEN_STATION_API_KEY" \ + --secret-input-mode plaintext \ + --custom-compatibility openai +``` + +这会把 Token Station 配置为 OpenClaw 的提供方,安装后台守护进程,并将 `openai/gpt-5.4-mini` 设为默认模型。 + +**每个参数的作用** + +| 参数 | 含义 | +|---|---| +| `--auth-choice custom-api-key` | 选择自定义 API 密钥的提供方路径,而不是使用具名提供方(OpenAI、Anthropic 等)。 | +| `--custom-base-url` | OpenClaw 发送请求的目标端点。Token Station 的 OpenAI 兼容基础地址是 `https://models.bytefuture.ai/v1`。 | +| `--custom-model-id` | OpenClaw 使用的默认模型 ID,格式为 `provider/model`。 | +| `--custom-api-key` | 你的 Token Station API 密钥。使用 `$TOKEN_STATION_API_KEY` 变量引用可以避免密钥出现在 shell 历史记录中。 | +| `--secret-input-mode` | OpenClaw 存储 API 密钥的方式。`plaintext` 会将密钥直接存储在磁盘上的 agent 认证配置文件中。 | +| `--custom-compatibility` | 控制通信协议。`openai` 使用标准的 chat completions,这是 Token Station 的正确选项。仅当端点支持 `/v1/responses` 而不支持 `/v1/chat/completions` 时才使用 `openai-responses`。Anthropic 原生端点请使用 `anthropic`。 | +| `--install-daemon` | 将 OpenClaw 安装为后台服务(macOS 上为 LaunchAgent,Linux/WSL2 上为 systemd,Windows 上为计划任务;若任务创建被拒绝,则回退到启动文件夹方式)。 | + +**更喜欢交互式向导?** 不带其他参数运行 `openclaw onboard --install-daemon` 即可。当向导进行到 Model/Auth 步骤时,选择自定义提供方选项并选择 OpenAI 兼容,然后输入 `https://models.bytefuture.ai/v1` 作为基础地址,并把你的 Token Station 密钥作为 API 密钥。 + +## 步骤 3:验证网关是否正在运行 + +```bash +openclaw gateway status +``` + +步骤 2 中安装的守护进程应该已经让网关处于运行状态。如果没有,该状态命令会告诉你问题出在哪里。 + +## 步骤 4:打开控制界面并确认 + +```bash +openclaw dashboard +``` + +控制面板会在你的浏览器中打开 `http://127.0.0.1:18789/`。发起一次对话。如果 agent 有回应,说明 OpenClaw 正在与 Token Station 通信,模型也在正常应答。 + +## 一条命令切换模型 + +Token Station 上的每个模型都在同一个端点、同一个密钥背后。要更改默认模型: + +```bash +openclaw configure --section model +``` + +或者用不同的 `--custom-model-id` 重新运行引导流程。可选的一些模型 ID: + +| 模型 ID | 适用场景 | +|---|---| +| `openai/gpt-5.5` | 高端旗舰模型;适合复杂规划、调试与架构设计。 | +| `openai/gpt-5.4` | 推理能力强,价格低于旗舰版本。 | +| `openai/gpt-5.4-mini` | 大多数日常任务的均衡之选,成本更低。 | +| `anthropic/claude-opus-4-8` | 长周期 agent 推理与深度分析。 | +| `kimi/kimi-k2.7-code` | 当成本比深度更重要时,适合日常编码任务。 | +| `xai/grok-build-0.1` | 快速且实惠,适合快速响应。 | +| `glm/glm-5.2` | 100 万 token 上下文窗口;代码能力强,价格低。 | + +切换模型时,网关、频道和守护进程都不会改变。改变的只是发送给 Token Station 的模型 ID。 + +## 智能路由:让策略来选择模型 + +对大多数场景来说,硬编码一个模型就够用了。Token Station 还允许你在服务端定义路由策略:在满足质量下限的前提下选择最便宜的模型、结合提供商白名单的延迟上限策略,或是主模型加自动回退的方案。 + +对 OpenClaw 而言,这意味着你把 `--custom-model-id` 指向 Token Station 上的一个路由型工作负载,路由逻辑留在 Token Station 一侧。如果主模型出现故障,会由回退模型来应答,OpenClaw 完全无需知晓。你只需在 Token Station 中更新策略,OpenClaw 配置无需任何改动。 + +## 常用环境变量 + +如果你需要使用非默认路径,请在启动守护进程之前设置以下变量: + +| 变量 | 作用 | +|---|---| +| `OPENCLAW_HOME` | 覆盖内部路径解析所使用的主目录。 | +| `OPENCLAW_STATE_DIR` | 覆盖状态目录。 | +| `OPENCLAW_CONFIG_PATH` | 覆盖配置文件路径。 | + +## 如果无法连接 + +**401 / 认证错误。** 确认你的 Token Station 密钥是正确的。用修正后的 `--custom-api-key` 重新运行引导命令,或运行 `openclaw configure --section model` 以交互方式更新凭据。 + +**模型错误或找不到模型。** 请对照 Token Station 目录 [models.bytefuture.ai/models](https://models.bytefuture.ai/models) 核实模型 ID 是否完全一致。运行 `openclaw configure --section model` 来更新模型 ID。 + +**网关未运行。** 运行 `openclaw gateway status`。要重启网关,使用 `openclaw gateway restart`。要从头重新安装守护进程,重新运行 `openclaw onboard --install-daemon`。 + +**控制面板无法加载。** 网关必须先处于运行状态。用 `openclaw gateway status` 确认后,再重试 `openclaw dashboard`。 + +**配置问题或异常行为。** 运行 `openclaw doctor` 来诊断无效或过时的配置,然后重新运行 `openclaw configure` 修复发现的问题。 + +## 开始使用 + +在 OpenClaw 中设置 Token Station,只需要一条命令和一个环境变量。守护进程运行起来之后,切换模型只需一次 `openclaw configure --section model` 调用,你设置中的其他部分都不会改变。 + +前往 [models.bytefuture.ai](https://models.bytefuture.ai) 注册(1 美元免费额度,无需信用卡;首次充值最高可再获得 50 美元奖励),导出你的密钥,运行引导命令,打开控制面板。一个密钥,一个端点,满足你 OpenClaw 设置所需的每一个模型。