From bcef069a46c2c03ded5058eb0bb8b654a6780ef0 Mon Sep 17 00:00:00 2001 From: Takagi Date: Mon, 17 Aug 2026 17:06:29 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=9B=9B=E7=AF=87?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E7=9A=84=E6=AD=A3=E5=BC=8F=E5=8F=91=E5=B8=83?= =?UTF-8?q?=EF=BC=9A=20=E6=AF=8F=E7=AF=87=E5=9D=87=E5=8C=85=E5=90=AB=20en?= =?UTF-8?q?=20/=20zh=20/=20ja=20/=20ko=EF=BC=8C=E5=85=B1=2016=20=E4=B8=AA?= =?UTF-8?q?=20Markdown=20=E6=96=87=E4=BB=B6=E3=80=82=20=E5=9B=9B=E7=AF=87?= =?UTF-8?q?=E5=9D=87=E4=B8=BA=20category:=20tutorial=E3=80=81draft:=20fals?= =?UTF-8?q?e=E3=80=81=E6=97=A5=E6=9C=9F=202026-08-17=E3=80=82=20=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E4=B8=BA=E9=BB=98=E8=AE=A4=20canonical=EF=BC=8C?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E8=AF=AD=E8=A8=80=E4=BD=BF=E7=94=A8=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=20slug=E3=80=82sitemap=E6=96=B0=E5=A2=9E=2016=20?= =?UTF-8?q?=E4=B8=AA=20URL;=20I=20have=20completed=20the=20source=20files?= =?UTF-8?q?=20for=20the=20official=20release=20of=20four=20articles:=20Eac?= =?UTF-8?q?h=20article=20includes=20en,=20zh,=20ja,=20and=20ko=20versions,?= =?UTF-8?q?=20for=20a=20total=20of=2016=20Markdown=20files.=20All=20four?= =?UTF-8?q?=20articles=20are=20categorized=20as=20`category:=20tutorial`,?= =?UTF-8?q?=20have=20a=20draft=20status=20of=20`draft:=20false`,=20and=20a?= =?UTF-8?q?re=20dated=20August=2017,=202026.=20The=20English=20version=20s?= =?UTF-8?q?erves=20as=20the=20canonical=20URL,=20while=20the=20other=20lan?= =?UTF-8?q?guage=20versions=20use=20the=20same=20slug.=20Sixteen=20new=20U?= =?UTF-8?q?RLs=20have=20been=20added=20to=20the=20sitemap;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sitemap.xml | 80 +++++++ ...de-app-with-cc-switch-and-token-station.md | 173 ++++++++++++++ ...gure-claude-code-cli-with-token-station.md | 211 +++++++++++++++++ .../configure-codex-app-with-token-station.md | 197 ++++++++++++++++ .../configure-codex-cli-with-token-station.md | 222 ++++++++++++++++++ ...de-app-with-cc-switch-and-token-station.md | 166 +++++++++++++ ...gure-claude-code-cli-with-token-station.md | 211 +++++++++++++++++ .../configure-codex-app-with-token-station.md | 191 +++++++++++++++ .../configure-codex-cli-with-token-station.md | 215 +++++++++++++++++ ...de-app-with-cc-switch-and-token-station.md | 164 +++++++++++++ ...gure-claude-code-cli-with-token-station.md | 209 +++++++++++++++++ .../configure-codex-app-with-token-station.md | 191 +++++++++++++++ .../configure-codex-cli-with-token-station.md | 215 +++++++++++++++++ ...de-app-with-cc-switch-and-token-station.md | 173 ++++++++++++++ ...gure-claude-code-cli-with-token-station.md | 210 +++++++++++++++++ .../configure-codex-app-with-token-station.md | 196 ++++++++++++++++ .../configure-codex-cli-with-token-station.md | 222 ++++++++++++++++++ 17 files changed, 3246 insertions(+) create mode 100644 src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md create mode 100644 src/content/writings/en/configure-claude-code-cli-with-token-station.md create mode 100644 src/content/writings/en/configure-codex-app-with-token-station.md create mode 100644 src/content/writings/en/configure-codex-cli-with-token-station.md create mode 100644 src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md create mode 100644 src/content/writings/ja/configure-claude-code-cli-with-token-station.md create mode 100644 src/content/writings/ja/configure-codex-app-with-token-station.md create mode 100644 src/content/writings/ja/configure-codex-cli-with-token-station.md create mode 100644 src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md create mode 100644 src/content/writings/ko/configure-claude-code-cli-with-token-station.md create mode 100644 src/content/writings/ko/configure-codex-app-with-token-station.md create mode 100644 src/content/writings/ko/configure-codex-cli-with-token-station.md create mode 100644 src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md create mode 100644 src/content/writings/zh/configure-claude-code-cli-with-token-station.md create mode 100644 src/content/writings/zh/configure-codex-app-with-token-station.md create mode 100644 src/content/writings/zh/configure-codex-cli-with-token-station.md diff --git a/sitemap.xml b/sitemap.xml index 97b67a8..742bf7b 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -325,4 +325,84 @@ 2026-08-13 0.6 + + https://bytefuture.ai/blog/configure-claude-code-cli-with-token-station.html + 2026-08-17 + 0.7 + + + https://bytefuture.ai/blog/configure-claude-code-cli-with-token-station-zh.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-claude-code-cli-with-token-station-ja.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-claude-code-cli-with-token-station-ko.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-claude-code-app-with-cc-switch-and-token-station.html + 2026-08-17 + 0.7 + + + https://bytefuture.ai/blog/configure-claude-code-app-with-cc-switch-and-token-station-zh.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-claude-code-app-with-cc-switch-and-token-station-ja.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-claude-code-app-with-cc-switch-and-token-station-ko.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-codex-app-with-token-station.html + 2026-08-17 + 0.7 + + + https://bytefuture.ai/blog/configure-codex-app-with-token-station-zh.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-codex-app-with-token-station-ja.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-codex-app-with-token-station-ko.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-codex-cli-with-token-station.html + 2026-08-17 + 0.7 + + + https://bytefuture.ai/blog/configure-codex-cli-with-token-station-zh.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-codex-cli-with-token-station-ja.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/configure-codex-cli-with-token-station-ko.html + 2026-08-17 + 0.6 + diff --git a/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md new file mode 100644 index 0000000..a889ba5 --- /dev/null +++ b/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -0,0 +1,173 @@ +--- +slug: "configure-claude-code-app-with-cc-switch-and-token-station" +lang: "en" +title: "Configure Token Station for the Claude Code App with CC Switch" +summary: "Create and enable a Token Station provider in CC Switch, reload the configuration in the Claude Code App, and verify the route with a real request and the Token Station activity log." +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Switching the Claude Code App between its official service, Token Station, and other model services can require repeated configuration edits. CC Switch stores each connection as a separate provider and applies the selected provider for you. + +This guide configures Token Station for the Claude Code App through CC Switch, then verifies the route with a real request. + +> This guide is for CC Switch and the Claude Code App. Claude Code CLI starts differently and may read configuration from different locations, so use the dedicated CLI setup for the command-line tool. + +## Before you start + +You need: + +- CC Switch and the Claude Code App installed +- A working Token Station API key +- Access or available credit for the target model + +Open the [Token Station dashboard](https://models.bytefuture.ai/dashboard) and confirm your API key and the complete target model ID. Never expose the key in screenshots, chats, or public documents. + +## Configuration flow + +The setup has five steps: + +1. Create a Claude Code provider in CC Switch +2. Enter the Token Station URL, API key, and model ID +3. Save and enable the provider +4. Fully quit and reopen the Claude Code App +5. Send a request and confirm it in Token Station + +## Add Token Station to CC Switch + +Button labels may vary between CC Switch versions, but the required values stay the same. + +### 1. Create a provider + +Open CC Switch, select **Claude Code**, and enter provider management. Click Add, New Provider, or the plus button. + +Use a clear name: + +```text +Token Station +``` + +If CC Switch asks for a provider type, choose Claude, Anthropic, or a custom Anthropic-compatible service. + +### 2. Enter the connection values + +| Field | Value | +| --- | --- | +| Base URL | `https://models.bytefuture.ai` | +| API Key / Auth Token | Your Token Station API key | +| Model | Complete model ID shown by Token Station | + +If the interface expects environment variables, use: + +```text +ANTHROPIC_BASE_URL=https://models.bytefuture.ai +ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> +ANTHROPIC_MODEL=<完整模型 ID> +``` + +Some CC Switch templates use `ANTHROPIC_API_KEY`. Follow the current template instead of setting several undocumented credential fields at once. + +Do not append `/v1/messages` to the base URL. The client builds the Anthropic Messages API path, and a repeated path can return 404. + +The model ID must match Token Station exactly, including the provider prefix. For example: + +```text +openai/gpt-5.6-sol +``` + +Do not replace it with the display name shown in the Claude Code App. + +### 3. Save and enable the provider + +Before saving, check that: + +- The base URL has no extra path or whitespace +- The API key has no leading or trailing whitespace +- The model ID includes its provider prefix +- Placeholder brackets and instructions were not copied as values + +Save the provider, find **Token Station** in the list, and click Enable, Apply, or Switch. Confirm that CC Switch marks it as the current provider. + +## Restart the Claude Code App + +An App process that is already running usually does not load a provider selected later. Fully quit it before reopening. + +### Windows + +1. Close the Claude Code App window +2. Check the system tray for a background process +3. Select Quit if it is still running +4. Apply the provider in CC Switch and reopen the App + +### macOS + +1. Press `Command + Q` in the Claude Code App +2. Confirm that the process has quit +3. Apply the provider in CC Switch and reopen the App + +Closing a window is not always the same as ending the process. Failure to restart after switching providers is the most common reason an update appears not to work. + +## Verify the complete route + +Create a conversation in the Claude Code App and send: + +```text +请只回复:Token Station 测试成功 +``` + +After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard). Under `Recent Activity`, confirm: + +- The new request appears +- Its time and status match +- The recorded model matches the CC Switch provider + +A response in the App plus a matching Token Station record proves that the route is active. A Current Provider label in CC Switch alone does not. + +## Switch back + +Keep the original official provider instead of overwriting your only configuration. To restore it: + +1. Select the original provider in CC Switch +2. Click Apply or Switch +3. Fully quit the Claude Code App +4. Reopen it and send a test message + +## Troubleshooting + +### The App still uses the old provider + +Make sure the App process has ended, not just its window. Apply the Token Station provider again, then start the App. + +### API key is missing + +Check whether the current CC Switch template expects `ANTHROPIC_AUTH_TOKEN` or `ANTHROPIC_API_KEY`. After correcting the field, apply the provider again and restart the App. + +### 401 or 403 response + +The key may be wrong, expired, padded with whitespace, or missing access and available credit for the target model. + +### 404 response + +Use `https://models.bytefuture.ai` as the base URL and remove manually added `/messages` or other repeated paths. + +### Model not found or access denied + +Copy the complete ID from Token Station. Do not infer it from the display name in the App. + +### The App responds, but Token Station has no record + +The App may still use the original service. Check the current provider, confirm that the App restarted after the switch, and verify the Token Station account and time filter. + +## Security notes + +- Keep real API keys out of tutorial screenshots +- Do not commit CC Switch configuration or credentials to Git +- Revoke and replace a key immediately if it may have leaked +- Back up a working configuration before upgrading CC Switch or the Claude Code App + +## References + +- [Token Station dashboard](https://models.bytefuture.ai/dashboard) +- [CC Switch project](https://github.com/farion1231/cc-switch) diff --git a/src/content/writings/en/configure-claude-code-cli-with-token-station.md b/src/content/writings/en/configure-claude-code-cli-with-token-station.md new file mode 100644 index 0000000..b725136 --- /dev/null +++ b/src/content/writings/en/configure-claude-code-cli-with-token-station.md @@ -0,0 +1,211 @@ +--- +slug: "configure-claude-code-cli-with-token-station" +lang: "en" +title: "Connect Claude Code CLI to Token Station on Windows, macOS, and Linux" +summary: "Configure Claude Code CLI to call models through Token Station on Windows, macOS, and Linux, then verify the connection with a real request and the Token Station activity log." +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Claude Code CLI can connect to third-party model gateways through the Anthropic Messages API. Point its request URL, API key, and model ID at Token Station to keep using the familiar `claude` command with models available through Token Station. + +This guide covers Windows, macOS, and Linux. Two details matter most: do not append `/v1` to the base URL, and keep the provider prefix in model IDs such as `openai/` or `anthropic/`. + +## Before you start + +You need: + +- Claude Code CLI installed, with `claude --version` returning version information +- A [Token Station](https://models.bytefuture.ai/intro.html) account and API key +- Access or available credit for the target model + +The examples use `openai/gpt-5.6-sol`. Model IDs can change, so copy the complete ID from the current [Token Station model list](https://models.bytefuture.ai/models). + +> Never put a real API key in a repository, public document, screenshot, or chat message. + +## Variables to configure + +| Environment variable | Purpose | Example | +| --- | --- | --- | +| `ANTHROPIC_BASE_URL` | Routes Claude Code requests to Token Station | `https://models.bytefuture.ai` | +| `ANTHROPIC_AUTH_TOKEN` | Your Token Station API key | Your real key | +| `ANTHROPIC_MODEL` | Complete default model ID | `openai/gpt-5.6-sol` | + +Claude Code adds the Anthropic Messages API path to the base URL. Use: + +```text +https://models.bytefuture.ai +``` + +Do not use `https://models.bytefuture.ai/v1`. The extra segment can produce a duplicated path and a 404 response. + +Keep the full model ID as well: + +```text +openai/gpt-5.6-sol +``` + +Do not shorten it to `gpt-5.6-sol`. + +## Configure Windows + +### Temporary configuration + +Run this in PowerShell: + +```powershell +$env:ANTHROPIC_BASE_URL = "https://models.bytefuture.ai" +$env:ANTHROPIC_AUTH_TOKEN = "你的真实密钥" +$env:ANTHROPIC_MODEL = "openai/gpt-5.6-sol" + +claude +``` + +These variables apply only to the current PowerShell process and its child processes. This is a good choice for the first test. + +### Save user environment variables + +To make new terminals load the configuration, run: + +```powershell +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_BASE_URL", + "https://models.bytefuture.ai", + "User" +) + +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_AUTH_TOKEN", + "你的真实密钥", + "User" +) + +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_MODEL", + "openai/gpt-5.6-sol", + "User" +) +``` + +Close the current PowerShell window and open a new one before running `claude`. Existing processes do not receive newly saved variables. + +To remove the variables later: + +```powershell +[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", $null, "User") +[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", $null, "User") +[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", $null, "User") +``` + +## Configure macOS and Linux + +Run these commands in the terminal that will start Claude Code: + +```bash +export ANTHROPIC_BASE_URL='https://models.bytefuture.ai' +export ANTHROPIC_AUTH_TOKEN='你的真实密钥' +export ANTHROPIC_MODEL='openai/gpt-5.6-sol' + +claude +``` + +The variables apply only to the current shell and its child processes. To load them in new terminals, add the three `export` lines to the configuration file for your shell: + +| Shell | Common configuration file | +| --- | --- | +| Zsh | `~/.zshrc` | +| Bash | `~/.bashrc` | +| Fish | `~/.config/fish/config.fish`, with different syntax | + +Open a new terminal after editing the file, or reload it for the current shell: + +```bash +source ~/.zshrc +``` + +For Bash: + +```bash +source ~/.bashrc +``` + +> A key stored in a shell configuration file remains as plaintext on disk. Keep that file out of Git and public sync folders. For stricter environments, use a system keychain, password manager, or temporary environment variable. + +## Verify the connection + +Starting Claude Code does not prove that the gateway is in use. Send a real request from the same terminal that contains the variables: + +```bash +claude -p '请只回复:Token Station 测试成功' +``` + +In PowerShell: + +```powershell +claude -p "请只回复:Token Station 测试成功" +``` + +After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard). Check the request time, status, and model under `Recent Activity`. + +The connection is complete only when: + +- Claude Code returns a normal response +- The matching request appears in Token Station +- The recorded model matches your configuration + +## Optional model mappings + +Some Claude Code tasks use the Opus, Sonnet, or Haiku tier. You can map each tier to a different Token Station model: + +```bash +export ANTHROPIC_DEFAULT_OPUS_MODEL='openai/gpt-5.6-sol' +export ANTHROPIC_DEFAULT_SONNET_MODEL='openai/gpt-5.6-terra' +export ANTHROPIC_DEFAULT_HAIKU_MODEL='openai/gpt-5.6-luna' +``` + +The equivalent PowerShell variables are: + +```powershell +$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "openai/gpt-5.6-sol" +$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "openai/gpt-5.6-terra" +$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "openai/gpt-5.6-luna" +``` + +If you want to pin one model, `ANTHROPIC_MODEL` is enough. Always confirm current availability in the Token Station model list. + +## Troubleshooting + +### Claude Code still asks for an Anthropic login + +Confirm that the API key is loaded and start Claude Code from the same terminal that set the variables. On Windows, open a new PowerShell window after saving user variables. + +### 401 or 403 response + +The API key may be invalid, contain extra whitespace, lack model access, or have no available credit. Copy it again and check the account status in Token Station. + +### 404 response + +The base URL must be: + +```text +https://models.bytefuture.ai +``` + +Do not append `/v1` or `/v1/messages`. + +### Model not found + +Use the complete model ID shown by Token Station and keep its provider prefix. + +### Claude Code responds, but Token Station has no record + +The current process may not be using Token Station. Check `ANTHROPIC_BASE_URL`, set the variables again, and run another `claude -p` request from the same terminal. + +## References + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station model list](https://models.bytefuture.ai/models) +- [Token Station dashboard](https://models.bytefuture.ai/dashboard) + diff --git a/src/content/writings/en/configure-codex-app-with-token-station.md b/src/content/writings/en/configure-codex-app-with-token-station.md new file mode 100644 index 0000000..a6a975d --- /dev/null +++ b/src/content/writings/en/configure-codex-app-with-token-station.md @@ -0,0 +1,197 @@ +--- +slug: "configure-codex-app-with-token-station" +lang: "en" +title: "Connect the Codex App to Token Station on Windows, macOS, and Linux" +summary: "Register Token Station as a custom model provider in the Codex App, load the API key on Windows, macOS, or Linux, and verify the complete Responses API route." +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +The Codex App can register a custom model provider in `config.toml`. Point that provider at the Token Station Responses API to use models available through Token Station and bill requests to your Token Station API key. + +This guide covers Windows, macOS, and Linux. Desktop apps and terminal programs may inherit environment variables from different sources. On macOS, an App launched from the Dock or Finder usually does not read `~/.zshrc`. + +## Before you start + +You need: + +- The Codex App installed +- A [Token Station](https://models.bytefuture.ai/intro.html) account and API key +- Access or available credit for the target model + +The examples use `openai/gpt-5.6-sol`. Copy the complete current model ID from Token Station. + +> Never put a real API key in `config.toml`, a screenshot, a chat message, or a repository. Codex will read it from an environment variable. + +## Register the Token Station provider + +In the Codex App, open **Settings → Configuration → Open config.toml**, then add: + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +Merge these fields with any existing configuration instead of replacing settings you still need. + +| Field | Purpose | +| --- | --- | +| `model` | Complete default model ID | +| `model_provider` | Provider block Codex should use | +| `name` | Display name for the provider | +| `base_url` | Token Station API root | +| `env_key` | Environment variable that stores the API key | +| `wire_api` | Selects the Responses API | + +The two `token_station` identifiers must match: + +```toml +model_provider = "token_station" +[model_providers.token_station] +``` + +Keep `base_url` at `/v1`; do not append `/responses`. Keep the provider prefix in the model ID as well. + +## Windows: configure the API key + +Open **Advanced system settings → Environment Variables**. Under User variables, create: + +| Item | Value | +| --- | --- | +| Variable name | `TOKEN_STATION_API_KEY` | +| Variable value | Your real Token Station API key | + +The variable name must exactly match `env_key` in `config.toml`. + +Save the variable, fully quit the Codex App, and reopen it. Closing the window may not end the process, and a running App does not automatically receive a new variable. + +## macOS: configure the API key + +An App launched from the Dock, Finder, or Launchpad usually does not inherit an `export` from the current terminal. Add the key to the current graphical login session: + +```bash +launchctl setenv TOKEN_STATION_API_KEY '你的真实密钥' +``` + +Check that the variable exists without printing the key: + +```bash +if [ -n "$(launchctl getenv TOKEN_STATION_API_KEY)" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +Press `Command + Q` to quit the Codex App, then reopen it from the Dock, Finder, or Launchpad. + +A variable set with `launchctl setenv` usually lasts only for the current graphical login session. You may need to set it again after a logout or restart. To remove it: + +```bash +launchctl unsetenv TOKEN_STATION_API_KEY +``` + +## Linux: configure the API key + +Environment inheritance varies by distribution, desktop environment, and installation method. If you start Codex from a terminal, set the variable in that shell: + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +Check that it exists: + +```bash +if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +Start Codex from the same terminal. To load the key in new terminals, add the `export` command to `~/.bashrc` or `~/.zshrc`. + +If the App starts from GNOME, KDE, or another desktop menu and the system uses a systemd user session, you can try: + +```bash +systemctl --user set-environment TOKEN_STATION_API_KEY='你的真实密钥' +``` + +Fully quit and reopen the App. To clear the variable: + +```bash +systemctl --user unset-environment TOKEN_STATION_API_KEY +``` + +> A key in a shell configuration file is stored as plaintext. Keep that file out of Git and public sync folders. + +## Verify the complete route + +1. Fully quit and reopen the Codex App +2. Create a new conversation +3. Send: + + ```text + 请只回复:Token Station 测试成功 + ``` + +4. Confirm that the App returns a normal response +5. Open the [Token Station dashboard](https://models.bytefuture.ai/dashboard) +6. Match the request time, status, and model under `Recent Activity` + +The route should be: + +```text +Codex App + → config.toml 中的 token_station provider + → TOKEN_STATION_API_KEY + → https://bec.bytefuture.ai/v1/responses + → Token Station 调用记录 +``` + +The connection is verified only when the App responds and Token Station shows the matching record. + +## Troubleshooting + +### Codex cannot find the API key + +Confirm that the variable name exactly matches `env_key = "TOKEN_STATION_API_KEY"`, then restart the App after setting it. + +On macOS, an `export` in `~/.zshrc` may not reach an App launched from the Dock. Use `launchctl setenv` and restart the App. + +### 401 or 403 response + +The key may be invalid, contain extra whitespace, lack model access, or have no available credit. + +### 404 response + +Check: + +```toml +base_url = "https://bec.bytefuture.ai/v1" +wire_api = "responses" +``` + +Do not append another `/responses` segment. + +### Model not found + +Use the complete model ID supplied by Token Station and keep its provider prefix. + +### Codex responds, but Token Station has no record + +Check that `model_provider` matches the provider block name and that the App reloaded the edited `config.toml`. Test again and match the request by time. + +## References + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station dashboard](https://models.bytefuture.ai/dashboard) + diff --git a/src/content/writings/en/configure-codex-cli-with-token-station.md b/src/content/writings/en/configure-codex-cli-with-token-station.md new file mode 100644 index 0000000..7a6ed89 --- /dev/null +++ b/src/content/writings/en/configure-codex-cli-with-token-station.md @@ -0,0 +1,222 @@ +--- +slug: "configure-codex-cli-with-token-station" +lang: "en" +title: "Connect Codex CLI to Token Station on Windows, macOS, and Linux" +summary: "Configure Token Station as a custom provider for Codex CLI, load the API key safely on Windows, macOS, or Linux, and verify a Responses API request." +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Codex CLI supports custom model providers in `config.toml`. After adding Token Station, you can keep using `codex` and `codex exec` while sending requests through your Token Station API key. + +This guide is for the command-line version of Codex. The Codex App can inherit environment variables differently, especially on macOS and Linux desktops, so do not mix the two setup procedures. + +## Before you start + +Confirm that: + +- Codex CLI is installed and `codex --version` returns version information +- You have a working Token Station API key +- Your account has access or available credit for the target model + +> Never expose a real API key in documentation, screenshots, chats, or repositories. + +## Configure the Token Station provider + +Codex CLI reads its user configuration from: + +- Windows: `%USERPROFILE%\.codex\config.toml` +- macOS and Linux: `~/.codex/config.toml` + +Add: + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +Merge these fields with any existing configuration instead of overwriting settings you still need. + +| Field | Purpose | +| --- | --- | +| `model` | Complete default model ID | +| `model_provider` | Provider block Codex should use | +| `name` | Provider display name | +| `base_url` | Token Station API root | +| `env_key` | Environment variable that stores the API key | +| `wire_api` | Selects the Responses API | + +Check these details: + +- `model_provider = "token_station"` matches `[model_providers.token_station]` +- `base_url` ends at `/v1`, without `/responses` +- `wire_api` is `"responses"` +- The model ID keeps its provider prefix + +The examples use `openai/gpt-5.6-sol`. Use the complete current ID shown by Token Station. + +## Configure Windows + +### Load the key temporarily + +Run in PowerShell: + +```powershell +$env:TOKEN_STATION_API_KEY = "你的真实密钥" +``` + +The variable applies only to the current PowerShell process and its child processes, which is useful for an initial test. + +### Save a user environment variable + +```powershell +[Environment]::SetEnvironmentVariable( + "TOKEN_STATION_API_KEY", + "你的真实密钥", + "User" +) +``` + +Close the terminal and open a new PowerShell window. Existing processes do not receive newly saved variables. + +Check that the variable exists without printing the key: + +```powershell +if ([string]::IsNullOrEmpty($env:TOKEN_STATION_API_KEY)) { + "TOKEN_STATION_API_KEY 未设置" +} else { + "TOKEN_STATION_API_KEY 已设置" +} +``` + +To remove it later: + +```powershell +[Environment]::SetEnvironmentVariable( + "TOKEN_STATION_API_KEY", + $null, + "User" +) +``` + +## Configure macOS and Linux + +Set the variable in the terminal that will run Codex CLI: + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +Check that it exists: + +```bash +if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +To load it in new terminals, add the `export` command to the configuration file for your shell: + +| Shell | Common configuration file | +| --- | --- | +| Zsh | `~/.zshrc` | +| Bash | `~/.bashrc` | +| Fish | `~/.config/fish/config.fish`, with different syntax | + +Open a new terminal after editing, or run `source ~/.zshrc` or `source ~/.bashrc`. + +> A key in a shell configuration file is stored as plaintext. Keep that file out of Git and public sync folders. + +## Verify the configuration + +Start an interactive session: + +```bash +codex +``` + +Then send: + +```text +请只回复:Token Station 测试成功 +``` + +You can also run a non-interactive request: + +```bash +codex exec '请只回复:Token Station 测试成功' +``` + +In PowerShell, use double quotes: + +```powershell +codex exec "请只回复:Token Station 测试成功" +``` + +After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard). Match the request time, status, and model under `Recent Activity`. + +The setup is complete only when: + +- `codex` or `codex exec` returns a normal result +- Token Station shows the matching request +- The recorded model matches the configuration + +## Troubleshooting + +### `codex` command not found + +Confirm that Codex CLI is installed and its installation directory is in `PATH`. Open a new terminal after installation or a `PATH` change, then run `codex --version`. + +### Codex cannot find the API key + +Confirm that: + +- The variable is named `TOKEN_STATION_API_KEY` +- `config.toml` uses `env_key = "TOKEN_STATION_API_KEY"` +- Codex starts from the same terminal that contains the variable +- A new terminal was opened after saving a persistent variable + +### 401 or 403 response + +The key may be invalid, contain extra whitespace, lack model access, or have no available credit. + +### 404 response + +Check: + +```toml +base_url = "https://bec.bytefuture.ai/v1" +wire_api = "responses" +``` + +Do not append `/responses` to the base URL. + +### Model not found or request failed + +Use the complete model ID currently supplied by Token Station and keep its provider prefix. + +### Old configuration is still active + +Confirm that you edited the current user's `config.toml`, that the file extension is correct, and that you restarted the Codex CLI process. + +## Security notes + +- Do not put a real key in `config.toml` +- Do not commit shell configuration files that contain keys +- Prefer temporary environment variables on shared computers +- Revoke and replace a key immediately if it may have leaked + +## References + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station dashboard](https://models.bytefuture.ai/dashboard) diff --git a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md new file mode 100644 index 0000000..cbd7c7b --- /dev/null +++ b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -0,0 +1,166 @@ +--- +slug: "configure-claude-code-app-with-cc-switch-and-token-station" +lang: "ja" +title: "CC SwitchでClaude Code AppにToken Stationを設定する" +summary: "CC SwitchでToken Station Providerを作成して有効化し、Claude Code Appに設定を再読み込みさせ、実際のリクエストと利用履歴で経路を確認します。" +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Claude Code Appを公式サービス、Token Station、ほかのモデルサービスの間で切り替えるたびに設定を編集するのは手間がかかります。CC Switchは接続情報を個別のProviderとして保存し、選択した設定を適用できます。 + +ここではCC SwitchからClaude Code AppにToken Stationを設定し、実際のリクエストで経路を確認します。 + +> このガイドはCC SwitchとClaude Code App向けです。Claude Code CLIは起動方法と設定元が異なるため、CLI用の手順を使ってください。 + +## 事前準備 + +次のものを用意してください。 + +- CC SwitchとClaude Code App +- 利用可能なToken Station API key +- 対象モデルの利用権限または残高 + +[Token Stationダッシュボード](https://models.bytefuture.ai/dashboard)でAPI keyと完全なモデルIDを確認します。実際のkeyをスクリーンショット、チャット、公開文書に載せないでください。 + +## 設定の流れ + +1. CC SwitchでClaude Code Providerを作成する +2. Token StationのURL、API key、モデルIDを入力する +3. Providerを保存して有効にする +4. Claude Code Appを完全に終了して開き直す +5. リクエストを送り、Token Stationで記録を確認する + +## CC SwitchにToken Stationを追加する + +CC Switchのバージョンによってボタン名は異なりますが、必要な値は同じです。 + +### 1. Providerを作成する + +CC Switchを開き、**Claude Code**を選択してProvider管理に移動します。追加、新規Provider、またはプラスボタンをクリックします。 + +わかりやすい名前を付けます。 + +```text +Token Station +``` + +種類を選ぶ場合はClaude、Anthropic、またはカスタムAnthropic互換サービスを使います。 + +### 2. 接続情報を入力する + +| フィールド | 値 | +| --- | --- | +| Base URL | `https://models.bytefuture.ai` | +| API Key / Auth Token | Token Station API key | +| Model | Token Stationに表示される完全なモデルID | + +環境変数を入力する画面では次を使います。 + +```text +ANTHROPIC_BASE_URL=https://models.bytefuture.ai +ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> +ANTHROPIC_MODEL=<完整模型 ID> +``` + +一部のCC Switchテンプレートは`ANTHROPIC_API_KEY`を使います。現在のテンプレートに従い、根拠のない複数の認証変数を同時に設定しないでください。 + +Base URLに`/v1/messages`を追加しないでください。クライアントがAnthropic Messages APIのパスを組み立てるため、重複すると404になる場合があります。 + +モデルIDにはプロバイダー接頭辞を含めます。 + +```text +openai/gpt-5.6-sol +``` + +Claude Code Appの表示名で置き換えないでください。 + +### 3. 保存して有効化する + +保存前に確認します。 + +- Base URLに余分なパスや空白がない +- API keyの前後に空白や改行がない +- モデルIDにプロバイダー接頭辞がある +- プレースホルダーの記号や説明文を値としてコピーしていない + +保存後、一覧の**Token Station**でEnable、Apply、またはSwitchをクリックし、現在のProviderになったことを確認します。 + +## Claude Code Appを再起動する + +すでに動いているAppは、あとから選択したProviderを通常は読み込みません。 + +### Windows + +1. Claude Code Appのウィンドウを閉じる +2. システムトレイにプロセスが残っていないか確認する +3. 残っていれば終了する +4. CC Switchで設定を適用してAppを開き直す + +### macOS + +1. Claude Code Appで`Command + Q`を押す +2. プロセスが終了したことを確認する +3. CC Switchで設定を適用してAppを開き直す + +ウィンドウを閉じるだけではプロセスが終了しない場合があります。 + +## 経路を確認する + +Claude Code Appで新しい会話を作成し、次を送ります。 + +```text +请只回复:Token Station 测试成功 +``` + +応答後、[Token Stationダッシュボード](https://models.bytefuture.ai/dashboard)の`Recent Activity`で確認します。 + +- 新しいリクエストがある +- 時刻と状態が一致する +- 記録されたモデルがCC Switchの設定と一致する + +Appの応答とToken Stationの記録がそろえば、経路が有効です。CC Switchの「現在のProvider」表示だけでは十分ではありません。 + +## 元の設定に戻す + +公式Providerを上書きせずに残しておきます。戻す場合は元のProviderを選び、ApplyまたはSwitchをクリックし、Claude Code Appを完全に終了して開き直します。 + +## トラブルシューティング + +### Appが古いProviderを使う + +ウィンドウだけでなくプロセスが終了したことを確認します。Token Station Providerをもう一度適用してAppを起動します。 + +### API keyがないと表示される + +テンプレートが`ANTHROPIC_AUTH_TOKEN`と`ANTHROPIC_API_KEY`のどちらを要求しているか確認します。修正後にProviderを再適用し、Appを再起動します。 + +### 401または403 + +keyが無効、期限切れ、余分な空白を含む、または対象モデルの権限や残高がない可能性があります。 + +### 404 + +Base URLを`https://models.bytefuture.ai`にし、手動で追加した`/messages`などの重複パスを削除します。 + +### モデルがない、または権限がない + +Token Stationから完全なIDをコピーします。Appの表示名から推測しないでください。 + +### Appは応答するがToken Stationに記録がない + +元のサービスを使っている可能性があります。現在のProvider、再起動、Token Stationのアカウントと時間フィルターを確認します。 + +## セキュリティ + +- 実際のAPI keyをチュートリアルの画像に載せない +- CC Switchの設定や認証情報をGitにコミットしない +- 漏えいの可能性があればkeyを直ちに無効化して再発行する +- CC SwitchやClaude Code Appの更新前に設定をバックアップする + +## 参考資料 + +- [Token Stationダッシュボード](https://models.bytefuture.ai/dashboard) +- [CC Switchプロジェクト](https://github.com/farion1231/cc-switch) diff --git a/src/content/writings/ja/configure-claude-code-cli-with-token-station.md b/src/content/writings/ja/configure-claude-code-cli-with-token-station.md new file mode 100644 index 0000000..eae09ff --- /dev/null +++ b/src/content/writings/ja/configure-claude-code-cli-with-token-station.md @@ -0,0 +1,211 @@ +--- +slug: "configure-claude-code-cli-with-token-station" +lang: "ja" +title: "Claude Code CLIをToken Stationに接続する:Windows、macOS、Linux対応" +summary: "Windows、macOS、LinuxでClaude Code CLIをToken Stationに接続し、実際のリクエストとToken Stationの履歴でエンドツーエンドの動作を確認します。" +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Claude Code CLIは、Anthropic Messages APIを使ってサードパーティーのモデルゲートウェイに接続できます。リクエスト先、API key、モデルIDをToken Stationに向ければ、使い慣れた`claude`コマンドからToken Stationのモデルを呼び出せます。 + +このガイドではWindows、macOS、Linuxでの設定方法を説明します。Base URLに`/v1`を追加しないこと、モデルIDの`openai/`や`anthropic/`などのプロバイダー接頭辞を残すことが重要です。 + +## 事前準備 + +次のものを用意してください。 + +- Claude Code CLI。`claude --version`でバージョンを確認できること +- [Token Station](https://models.bytefuture.ai/intro.html)のアカウントとAPI key +- 対象モデルの利用権限または利用可能な残高 + +例では`openai/gpt-5.6-sol`を使います。モデルIDは更新される場合があるため、[Token Stationのモデル一覧](https://models.bytefuture.ai/models)に表示される完全なIDを使ってください。 + +> 実際のAPI keyをリポジトリ、公開文書、スクリーンショット、チャットに記載しないでください。 + +## 設定する変数 + +| 環境変数 | 用途 | 例 | +| --- | --- | --- | +| `ANTHROPIC_BASE_URL` | Claude CodeのリクエストをToken Stationへ送る | `https://models.bytefuture.ai` | +| `ANTHROPIC_AUTH_TOKEN` | Token Station API key | 実際のkey | +| `ANTHROPIC_MODEL` | 完全なデフォルトモデルID | `openai/gpt-5.6-sol` | + +Claude CodeはBase URLの後ろにAnthropic Messages APIのパスを追加します。次の値を使います。 + +```text +https://models.bytefuture.ai +``` + +`https://models.bytefuture.ai/v1`にはしないでください。パスが重複し、404になる場合があります。 + +モデルIDも完全な形を保ちます。 + +```text +openai/gpt-5.6-sol +``` + +`gpt-5.6-sol`のように省略しないでください。 + +## Windowsでの設定 + +### 一時設定 + +PowerShellで実行します。 + +```powershell +$env:ANTHROPIC_BASE_URL = "https://models.bytefuture.ai" +$env:ANTHROPIC_AUTH_TOKEN = "你的真实密钥" +$env:ANTHROPIC_MODEL = "openai/gpt-5.6-sol" + +claude +``` + +変数は現在のPowerShellとその子プロセスだけで有効です。最初のテストに適しています。 + +### ユーザー環境変数として保存 + +新しいターミナルでも設定を使う場合は実行します。 + +```powershell +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_BASE_URL", + "https://models.bytefuture.ai", + "User" +) + +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_AUTH_TOKEN", + "你的真实密钥", + "User" +) + +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_MODEL", + "openai/gpt-5.6-sol", + "User" +) +``` + +現在のPowerShellを閉じ、新しいウィンドウで`claude`を起動します。すでに動いているプロセスには新しい変数が渡りません。 + +削除する場合は次を実行します。 + +```powershell +[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", $null, "User") +[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", $null, "User") +[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", $null, "User") +``` + +## macOSとLinuxでの設定 + +Claude Codeを起動するターミナルで実行します。 + +```bash +export ANTHROPIC_BASE_URL='https://models.bytefuture.ai' +export ANTHROPIC_AUTH_TOKEN='你的真实密钥' +export ANTHROPIC_MODEL='openai/gpt-5.6-sol' + +claude +``` + +変数は現在のShellと子プロセスだけで有効です。新しいターミナルでも読み込む場合は、3行の`export`をShellの設定ファイルに追加します。 + +| Shell | 一般的な設定ファイル | +| --- | --- | +| Zsh | `~/.zshrc` | +| Bash | `~/.bashrc` | +| Fish | `~/.config/fish/config.fish`。構文は異なります | + +編集後にターミナルを開き直すか、現在のShellで再読み込みします。 + +```bash +source ~/.zshrc +``` + +Bashの場合: + +```bash +source ~/.bashrc +``` + +> Shell設定ファイルに保存したAPI keyはディスク上に平文で残ります。Gitや公開同期フォルダーに含めないでください。 + +## 接続を確認する + +Claude Codeが起動するだけでは、Token Stationを使っていることは確認できません。変数を設定したターミナルから実際のリクエストを送ります。 + +```bash +claude -p '请只回复:Token Station 测试成功' +``` + +PowerShellでは次を使います。 + +```powershell +claude -p "请只回复:Token Station 测试成功" +``` + +応答を受け取ったら、[Token Stationダッシュボード](https://models.bytefuture.ai/dashboard)を開き、`Recent Activity`で時刻、状態、モデルを確認します。 + +次の3点がそろえば接続は完了です。 + +- Claude Codeが正常に応答する +- Token Stationに対応する記録がある +- 記録されたモデルが設定と一致する + +## オプション:モデル階層を割り当てる + +Claude Codeの一部の処理はOpus、Sonnet、Haikuの階層を使います。それぞれをToken Stationの別モデルに割り当てられます。 + +```bash +export ANTHROPIC_DEFAULT_OPUS_MODEL='openai/gpt-5.6-sol' +export ANTHROPIC_DEFAULT_SONNET_MODEL='openai/gpt-5.6-terra' +export ANTHROPIC_DEFAULT_HAIKU_MODEL='openai/gpt-5.6-luna' +``` + +PowerShellでは次の変数を使います。 + +```powershell +$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "openai/gpt-5.6-sol" +$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "openai/gpt-5.6-terra" +$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "openai/gpt-5.6-luna" +``` + +1つのモデルに固定する場合は`ANTHROPIC_MODEL`だけで構いません。利用可能なモデルはToken Stationの一覧で確認してください。 + +## トラブルシューティング + +### Anthropicアカウントへのログインを求められる + +API keyが読み込まれていることを確認し、変数を設定した同じターミナルからClaude Codeを起動します。Windowsでユーザー変数を保存した場合は新しいPowerShellを開いてください。 + +### 401または403 + +API keyが無効、余分な空白を含む、モデル権限がない、残高がない可能性があります。keyをコピーし直し、Token Stationでアカウント状態を確認します。 + +### 404 + +Base URLは次の値にします。 + +```text +https://models.bytefuture.ai +``` + +`/v1`や`/v1/messages`を追加しないでください。 + +### モデルが見つからない + +Token Stationに表示される完全なモデルIDを使い、プロバイダー接頭辞を残します。 + +### 応答はあるがToken Stationに記録がない + +現在のプロセスがToken Stationを使っていない可能性があります。`ANTHROPIC_BASE_URL`を確認し、同じターミナルからもう一度`claude -p`を実行します。 + +## 参考資料 + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Stationモデル一覧](https://models.bytefuture.ai/models) +- [Token Stationダッシュボード](https://models.bytefuture.ai/dashboard) + diff --git a/src/content/writings/ja/configure-codex-app-with-token-station.md b/src/content/writings/ja/configure-codex-app-with-token-station.md new file mode 100644 index 0000000..2c96967 --- /dev/null +++ b/src/content/writings/ja/configure-codex-app-with-token-station.md @@ -0,0 +1,191 @@ +--- +slug: "configure-codex-app-with-token-station" +lang: "ja" +title: "Codex AppをToken Stationに接続する:Windows、macOS、Linux対応" +summary: "Codex AppにToken StationをカスタムモデルProviderとして登録し、各OSでAPI keyを読み込ませ、Responses APIの経路を確認します。" +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Codex Appは`config.toml`でカスタムモデルProviderを登録できます。ProviderをToken StationのResponses APIに向けると、Token Station API keyで利用可能なモデルを呼び出せます。 + +このガイドではWindows、macOS、Linuxでの設定を説明します。デスクトップAppとターミナルプログラムでは環境変数の取得元が異なる場合があります。macOSでDockやFinderから起動したAppは通常`~/.zshrc`を読みません。 + +## 事前準備 + +- Codex App +- [Token Station](https://models.bytefuture.ai/intro.html)のアカウントとAPI key +- 対象モデルの利用権限または残高 + +例では`openai/gpt-5.6-sol`を使います。Token Stationに表示される完全なモデルIDを確認してください。 + +> 実際のAPI keyを`config.toml`、画像、チャット、リポジトリに記載しないでください。Codexには環境変数から読み込ませます。 + +## Token Station Providerを登録する + +Codex Appで**設定 → 構成 → config.tomlを開く**に進み、次を追加します。 + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +既存の設定がある場合は、必要な項目を上書きせずに統合します。 + +| フィールド | 用途 | +| --- | --- | +| `model` | 完全なデフォルトモデルID | +| `model_provider` | Codexが使うProviderブロック | +| `name` | Providerの表示名 | +| `base_url` | Token Station APIのルート | +| `env_key` | API keyを保存する環境変数名 | +| `wire_api` | Responses APIを選択する値 | + +2つの`token_station`は一致させます。 + +```toml +model_provider = "token_station" +[model_providers.token_station] +``` + +`base_url`は`/v1`までとし、`/responses`を追加しません。モデルIDのプロバイダー接頭辞も残します。 + +## Windows:API keyを設定する + +**システムの詳細設定 → 環境変数**を開き、ユーザー環境変数を作成します。 + +| 項目 | 値 | +| --- | --- | +| 変数名 | `TOKEN_STATION_API_KEY` | +| 変数値 | 実際のToken Station API key | + +変数名は`config.toml`の`env_key`と完全に一致させます。保存後、Codex Appを完全に終了して開き直します。 + +## macOS:API keyを設定する + +Dock、Finder、Launchpadから起動したAppは、現在のターミナルの`export`を通常は引き継ぎません。グラフィカルログインセッションに変数を追加します。 + +```bash +launchctl setenv TOKEN_STATION_API_KEY '你的真实密钥' +``` + +keyを表示せずに存在を確認します。 + +```bash +if [ -n "$(launchctl getenv TOKEN_STATION_API_KEY)" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +`Command + Q`でCodex Appを終了し、Dock、Finder、Launchpadから開き直します。 + +`launchctl setenv`の変数は通常、現在のログインセッションだけで有効です。ログアウトや再起動後は再設定が必要な場合があります。削除するには: + +```bash +launchctl unsetenv TOKEN_STATION_API_KEY +``` + +## Linux:API keyを設定する + +環境変数の継承方法はディストリビューション、デスクトップ環境、インストール方法によって異なります。ターミナルから起動する場合は、同じShellで設定します。 + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +存在を確認します。 + +```bash +if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +同じターミナルからCodexを起動します。新しいターミナルでも読み込む場合は、`export`を`~/.bashrc`または`~/.zshrc`に追加します。 + +GNOMEやKDEのメニューから起動し、systemdユーザーセッションを使う場合は次を試せます。 + +```bash +systemctl --user set-environment TOKEN_STATION_API_KEY='你的真实密钥' +``` + +Appを完全に終了して開き直します。削除するには: + +```bash +systemctl --user unset-environment TOKEN_STATION_API_KEY +``` + +> Shell設定ファイルに保存したkeyは平文で残ります。Gitや公開同期フォルダーに含めないでください。 + +## 経路を確認する + +1. Codex Appを完全に終了して開き直す +2. 新しい会話を作成する +3. 次を送る + + ```text + 请只回复:Token Station 测试成功 + ``` + +4. 正常な応答を確認する +5. [Token Stationダッシュボード](https://models.bytefuture.ai/dashboard)を開く +6. `Recent Activity`で時刻、状態、モデルを照合する + +経路は次のようになります。 + +```text +Codex App + → config.toml 中的 token_station provider + → TOKEN_STATION_API_KEY + → https://bec.bytefuture.ai/v1/responses + → Token Station 调用记录 +``` + +Appの応答とToken Stationの対応する記録がそろえば接続完了です。 + +## トラブルシューティング + +### API keyが見つからない + +変数名が`env_key = "TOKEN_STATION_API_KEY"`と完全に一致することを確認し、設定後にAppを再起動します。macOSでDockから起動する場合は`launchctl setenv`を使います。 + +### 401または403 + +keyが無効、余分な空白を含む、モデル権限がない、残高がない可能性があります。 + +### 404 + +次を確認します。 + +```toml +base_url = "https://bec.bytefuture.ai/v1" +wire_api = "responses" +``` + +`/responses`を重ねて追加しないでください。 + +### モデルが見つからない + +Token Stationが提供する完全なモデルIDを使い、プロバイダー接頭辞を残します。 + +### 応答はあるがToken Stationに記録がない + +`model_provider`とProviderブロック名が一致すること、Appが編集後の`config.toml`を読み直したことを確認します。 + +## 参考資料 + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Stationダッシュボード](https://models.bytefuture.ai/dashboard) + diff --git a/src/content/writings/ja/configure-codex-cli-with-token-station.md b/src/content/writings/ja/configure-codex-cli-with-token-station.md new file mode 100644 index 0000000..c214e5e --- /dev/null +++ b/src/content/writings/ja/configure-codex-cli-with-token-station.md @@ -0,0 +1,215 @@ +--- +slug: "configure-codex-cli-with-token-station" +lang: "ja" +title: "Codex CLIをToken Stationに接続する:Windows、macOS、Linux対応" +summary: "Codex CLIにToken StationをカスタムProviderとして設定し、各OSでAPI keyを安全に読み込ませ、Responses APIのリクエストを確認します。" +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Codex CLIは`config.toml`でカスタムモデルProviderを設定できます。Token Stationを追加すると、`codex`と`codex exec`をそのまま使いながら、Token Station API keyでリクエストを送れます。 + +このガイドはコマンドライン版Codex向けです。Codex Appは特にmacOSとLinuxのデスクトップで環境変数の継承方法が異なるため、設定手順を混在させないでください。 + +## 事前準備 + +- `codex --version`で確認できるCodex CLI +- 利用可能なToken Station API key +- 対象モデルの利用権限または残高 + +> 実際のAPI keyを文書、画像、チャット、リポジトリに公開しないでください。 + +## Token Station Providerを設定する + +Codex CLIは次のユーザー設定ファイルを読みます。 + +- Windows:`%USERPROFILE%\.codex\config.toml` +- macOSとLinux:`~/.codex/config.toml` + +次を追加します。 + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +既存の設定がある場合は、必要な項目を消さずに統合します。 + +| フィールド | 用途 | +| --- | --- | +| `model` | 完全なデフォルトモデルID | +| `model_provider` | Codexが使うProviderブロック | +| `name` | Providerの表示名 | +| `base_url` | Token Station APIのルート | +| `env_key` | API keyを保存する環境変数名 | +| `wire_api` | Responses APIを選択する値 | + +次を確認します。 + +- `model_provider = "token_station"`が`[model_providers.token_station]`と一致する +- `base_url`は`/v1`までで、`/responses`を追加しない +- `wire_api`は`"responses"` +- モデルIDにプロバイダー接頭辞がある + +例は`openai/gpt-5.6-sol`です。Token Stationに表示される現在の完全なIDを使ってください。 + +## Windowsでの設定 + +### 一時的にkeyを読み込む + +PowerShellで実行します。 + +```powershell +$env:TOKEN_STATION_API_KEY = "你的真实密钥" +``` + +変数は現在のPowerShellとその子プロセスだけで有効です。 + +### ユーザー環境変数として保存 + +```powershell +[Environment]::SetEnvironmentVariable( + "TOKEN_STATION_API_KEY", + "你的真实密钥", + "User" +) +``` + +保存後にターミナルを閉じ、新しいPowerShellを開きます。 + +keyを表示せずに変数を確認します。 + +```powershell +if ([string]::IsNullOrEmpty($env:TOKEN_STATION_API_KEY)) { + "TOKEN_STATION_API_KEY 未设置" +} else { + "TOKEN_STATION_API_KEY 已设置" +} +``` + +削除する場合: + +```powershell +[Environment]::SetEnvironmentVariable( + "TOKEN_STATION_API_KEY", + $null, + "User" +) +``` + +## macOSとLinuxでの設定 + +Codex CLIを実行するターミナルで設定します。 + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +存在を確認します。 + +```bash +if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +新しいターミナルでも読み込む場合は、Shellの設定ファイルに`export`を追加します。 + +| Shell | 一般的な設定ファイル | +| --- | --- | +| Zsh | `~/.zshrc` | +| Bash | `~/.bashrc` | +| Fish | `~/.config/fish/config.fish`。構文は異なります | + +編集後に新しいターミナルを開くか、`source ~/.zshrc`または`source ~/.bashrc`を実行します。 + +> Shell設定ファイルのkeyは平文で保存されます。Gitや公開同期フォルダーに含めないでください。 + +## 設定を確認する + +対話モードを起動します。 + +```bash +codex +``` + +起動後に送信します。 + +```text +请只回复:Token Station 测试成功 +``` + +非対話リクエストも実行できます。 + +```bash +codex exec '请只回复:Token Station 测试成功' +``` + +PowerShellでは二重引用符を使います。 + +```powershell +codex exec "请只回复:Token Station 测试成功" +``` + +応答後、[Token Stationダッシュボード](https://models.bytefuture.ai/dashboard)の`Recent Activity`で時刻、状態、モデルを照合します。 + +次の3点がそろえば設定完了です。 + +- `codex`または`codex exec`が正常に応答する +- Token Stationに対応するリクエストがある +- 記録されたモデルが設定と一致する + +## トラブルシューティング + +### `codex`コマンドが見つからない + +Codex CLIがインストールされ、インストール先が`PATH`に含まれることを確認します。新しいターミナルで`codex --version`を実行します。 + +### API keyが見つからない + +変数名が`TOKEN_STATION_API_KEY`であり、`config.toml`の`env_key`と一致すること、同じターミナルからCodexを起動していることを確認します。 + +### 401または403 + +keyが無効、余分な空白を含む、モデル権限がない、残高がない可能性があります。 + +### 404 + +次を確認します。 + +```toml +base_url = "https://bec.bytefuture.ai/v1" +wire_api = "responses" +``` + +Base URLに`/responses`を追加しないでください。 + +### モデルが見つからない、またはリクエストに失敗する + +Token Stationが現在提供する完全なモデルIDを使い、プロバイダー接頭辞を残します。 + +### 古い設定が使われる + +現在のユーザーの`config.toml`を編集したこと、拡張子が正しいこと、Codex CLIプロセスを再起動したことを確認します。 + +## セキュリティ + +- 実際のkeyを`config.toml`に書かない +- keyを含むShell設定ファイルをGitにコミットしない +- 共有PCでは一時環境変数を優先する +- 漏えいの可能性があればkeyを直ちに無効化して再発行する + +## 参考資料 + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Stationダッシュボード](https://models.bytefuture.ai/dashboard) diff --git a/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md new file mode 100644 index 0000000..a34d339 --- /dev/null +++ b/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -0,0 +1,164 @@ +--- +slug: "configure-claude-code-app-with-cc-switch-and-token-station" +lang: "ko" +title: "CC Switch로 Claude Code App에 Token Station 설정하기" +summary: "CC Switch에서 Token Station Provider를 만들고 활성화한 뒤 Claude Code App이 새 설정을 읽도록 재시작하고 실제 요청과 활동 기록으로 경로를 검증합니다." +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Claude Code App을 공식 서비스, Token Station, 다른 모델 서비스 사이에서 전환할 때마다 설정을 직접 바꾸는 것은 번거롭습니다. CC Switch는 연결 정보를 개별 Provider로 저장하고 선택한 설정을 적용합니다. + +이 글에서는 CC Switch를 통해 Claude Code App에 Token Station을 설정하고 실제 요청으로 전체 경로를 검증합니다. + +> 이 글은 CC Switch와 Claude Code App용입니다. Claude Code CLI는 실행 방식과 설정 위치가 다르므로 CLI 전용 절차를 사용하세요. + +## 준비 사항 + +- CC Switch와 Claude Code App +- 사용 가능한 Token Station API key +- 대상 모델의 사용 권한 또는 잔액 + +[Token Station 대시보드](https://models.bytefuture.ai/dashboard)에서 API key와 전체 모델 ID를 확인하세요. 실제 key를 스크린샷, 채팅 또는 공개 문서에 표시하지 마세요. + +## 설정 순서 + +1. CC Switch에서 Claude Code Provider 만들기 +2. Token Station URL, API key, 모델 ID 입력하기 +3. Provider 저장 및 활성화하기 +4. Claude Code App 완전히 종료 후 다시 열기 +5. 요청을 보내고 Token Station 기록 확인하기 + +## CC Switch에 Token Station 추가 + +CC Switch 버전에 따라 버튼 이름은 다를 수 있지만 필요한 값은 같습니다. + +### 1. Provider 만들기 + +CC Switch에서 **Claude Code**를 선택하고 Provider 관리로 이동합니다. 추가, 새 Provider 또는 더하기 버튼을 누릅니다. + +이름은 다음처럼 설정할 수 있습니다. + +```text +Token Station +``` + +유형을 선택해야 한다면 Claude, Anthropic 또는 사용자 지정 Anthropic 호환 서비스를 선택하세요. + +### 2. 연결 정보 입력 + +| 필드 | 값 | +| --- | --- | +| Base URL | `https://models.bytefuture.ai` | +| API Key / Auth Token | Token Station API key | +| Model | Token Station에 표시되는 전체 모델 ID | + +환경 변수를 입력하는 화면에서는 다음을 사용합니다. + +```text +ANTHROPIC_BASE_URL=https://models.bytefuture.ai +ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> +ANTHROPIC_MODEL=<完整模型 ID> +``` + +일부 CC Switch 템플릿은 `ANTHROPIC_API_KEY`를 사용합니다. 현재 템플릿을 따르고 출처가 불분명한 여러 인증 변수를 동시에 설정하지 마세요. + +Base URL에 `/v1/messages`를 추가하지 마세요. 클라이언트가 Anthropic Messages API 경로를 구성하므로 중복 경로는 404를 일으킬 수 있습니다. + +모델 ID에는 제공자 접두사를 포함해야 합니다. + +```text +openai/gpt-5.6-sol +``` + +Claude Code App의 표시 이름으로 대체하지 마세요. + +### 3. 저장하고 활성화하기 + +저장 전에 확인하세요. + +- Base URL에 불필요한 경로나 공백이 없음 +- API key 앞뒤에 공백이나 줄바꿈이 없음 +- 모델 ID에 제공자 접두사가 있음 +- 자리표시자 기호와 설명을 값으로 복사하지 않음 + +저장 후 목록의 **Token Station**에서 Enable, Apply 또는 Switch를 누르고 현재 Provider로 표시되는지 확인합니다. + +## Claude Code App 재시작 + +이미 실행 중인 App은 나중에 선택한 Provider를 자동으로 읽지 않는 경우가 많습니다. + +### Windows + +1. Claude Code App 창 닫기 +2. 시스템 트레이에 프로세스가 남았는지 확인하기 +3. 남아 있으면 종료하기 +4. CC Switch에서 설정을 적용한 뒤 App 다시 열기 + +### macOS + +1. Claude Code App에서 `Command + Q` 누르기 +2. 프로세스가 끝났는지 확인하기 +3. CC Switch에서 설정을 적용한 뒤 App 다시 열기 + +창만 닫는 것으로 프로세스가 끝나지 않을 수 있습니다. + +## 전체 경로 검증 + +Claude Code App에서 새 대화를 만들고 다음을 보냅니다. + +```text +请只回复:Token Station 测试成功 +``` + +응답 후 [Token Station 대시보드](https://models.bytefuture.ai/dashboard)의 `Recent Activity`에서 확인하세요. + +- 새 요청이 표시됨 +- 시간과 상태가 일치함 +- 기록된 모델이 CC Switch 설정과 일치함 + +App 응답과 Token Station 기록이 모두 있어야 경로가 활성화된 것입니다. CC Switch의 현재 Provider 표시만으로는 충분하지 않습니다. + +## 이전 설정으로 돌아가기 + +공식 Provider를 덮어쓰지 말고 보관하세요. 복원할 때 원래 Provider를 선택하고 Apply 또는 Switch를 누른 뒤 Claude Code App을 완전히 종료하고 다시 엽니다. + +## 문제 해결 + +### App이 이전 Provider를 사용함 + +창뿐 아니라 프로세스가 끝났는지 확인하세요. Token Station Provider를 다시 적용한 뒤 App을 실행합니다. + +### API key가 없다고 표시됨 + +템플릿이 `ANTHROPIC_AUTH_TOKEN`과 `ANTHROPIC_API_KEY` 중 무엇을 요구하는지 확인하세요. 수정 후 Provider를 다시 적용하고 App을 재시작합니다. + +### 401 또는 403 + +key가 잘못되었거나 만료되었거나 공백이 포함되었거나 대상 모델의 권한 또는 잔액이 없을 수 있습니다. + +### 404 + +Base URL을 `https://models.bytefuture.ai`로 설정하고 직접 추가한 `/messages` 같은 중복 경로를 제거하세요. + +### 모델을 찾을 수 없거나 권한이 없음 + +Token Station에서 전체 ID를 복사하세요. App의 표시 이름으로 추측하지 마세요. + +### App은 응답하지만 Token Station 기록이 없음 + +원래 서비스를 계속 사용 중일 수 있습니다. 현재 Provider, App 재시작 여부, Token Station 계정과 시간 필터를 확인하세요. + +## 보안 + +- 실제 API key를 튜토리얼 이미지에 표시하지 않기 +- CC Switch 설정이나 인증 정보를 Git에 커밋하지 않기 +- 유출 가능성이 있으면 key를 즉시 폐기하고 다시 발급하기 +- CC Switch나 Claude Code App 업데이트 전 설정 백업하기 + +## 참고 자료 + +- [Token Station 대시보드](https://models.bytefuture.ai/dashboard) +- [CC Switch 프로젝트](https://github.com/farion1231/cc-switch) diff --git a/src/content/writings/ko/configure-claude-code-cli-with-token-station.md b/src/content/writings/ko/configure-claude-code-cli-with-token-station.md new file mode 100644 index 0000000..55eeb01 --- /dev/null +++ b/src/content/writings/ko/configure-claude-code-cli-with-token-station.md @@ -0,0 +1,209 @@ +--- +slug: "configure-claude-code-cli-with-token-station" +lang: "ko" +title: "Claude Code CLI를 Token Station에 연결하기: Windows, macOS, Linux" +summary: "Windows, macOS, Linux에서 Claude Code CLI를 Token Station에 연결하고 실제 요청과 Token Station 활동 기록으로 전체 경로를 검증합니다." +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Claude Code CLI는 Anthropic Messages API를 통해 서드파티 모델 게이트웨이에 연결할 수 있습니다. 요청 주소, API key, 모델 ID를 Token Station으로 지정하면 익숙한 `claude` 명령으로 Token Station에서 제공하는 모델을 사용할 수 있습니다. + +이 글은 Windows, macOS, Linux 설정을 다룹니다. Base URL 뒤에 `/v1`을 추가하지 말고, 모델 ID의 `openai/` 또는 `anthropic/` 같은 제공자 접두사를 유지해야 합니다. + +## 준비 사항 + +- `claude --version`으로 확인할 수 있는 Claude Code CLI +- [Token Station](https://models.bytefuture.ai/intro.html) 계정과 API key +- 대상 모델의 사용 권한 또는 사용 가능한 잔액 + +예시는 `openai/gpt-5.6-sol`을 사용합니다. 모델 ID는 바뀔 수 있으므로 [Token Station 모델 목록](https://models.bytefuture.ai/models)에 표시되는 전체 ID를 사용하세요. + +> 실제 API key를 저장소, 공개 문서, 스크린샷 또는 채팅에 넣지 마세요. + +## 설정할 변수 + +| 환경 변수 | 용도 | 예시 | +| --- | --- | --- | +| `ANTHROPIC_BASE_URL` | Claude Code 요청을 Token Station으로 전송 | `https://models.bytefuture.ai` | +| `ANTHROPIC_AUTH_TOKEN` | Token Station API key | 실제 key | +| `ANTHROPIC_MODEL` | 전체 기본 모델 ID | `openai/gpt-5.6-sol` | + +Claude Code는 Base URL 뒤에 Anthropic Messages API 경로를 붙입니다. 다음 주소를 사용하세요. + +```text +https://models.bytefuture.ai +``` + +`https://models.bytefuture.ai/v1`로 설정하면 경로가 중복되어 404가 발생할 수 있습니다. + +모델 ID도 전체 형식을 유지합니다. + +```text +openai/gpt-5.6-sol +``` + +`gpt-5.6-sol`로 줄이지 마세요. + +## Windows 설정 + +### 임시 설정 + +PowerShell에서 실행합니다. + +```powershell +$env:ANTHROPIC_BASE_URL = "https://models.bytefuture.ai" +$env:ANTHROPIC_AUTH_TOKEN = "你的真实密钥" +$env:ANTHROPIC_MODEL = "openai/gpt-5.6-sol" + +claude +``` + +현재 PowerShell과 하위 프로세스에서만 유효하므로 첫 테스트에 적합합니다. + +### 사용자 환경 변수로 저장 + +새 터미널에서도 설정을 읽게 하려면 실행합니다. + +```powershell +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_BASE_URL", + "https://models.bytefuture.ai", + "User" +) + +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_AUTH_TOKEN", + "你的真实密钥", + "User" +) + +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_MODEL", + "openai/gpt-5.6-sol", + "User" +) +``` + +현재 PowerShell을 닫고 새 창에서 `claude`를 실행하세요. 이미 실행 중인 프로세스는 새 변수를 받지 않습니다. + +변수를 삭제하려면: + +```powershell +[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", $null, "User") +[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", $null, "User") +[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", $null, "User") +``` + +## macOS와 Linux 설정 + +Claude Code를 실행할 터미널에서 설정합니다. + +```bash +export ANTHROPIC_BASE_URL='https://models.bytefuture.ai' +export ANTHROPIC_AUTH_TOKEN='你的真实密钥' +export ANTHROPIC_MODEL='openai/gpt-5.6-sol' + +claude +``` + +현재 Shell과 하위 프로세스에서만 유효합니다. 새 터미널에서도 불러오려면 세 줄의 `export`를 Shell 설정 파일에 추가하세요. + +| Shell | 일반적인 설정 파일 | +| --- | --- | +| Zsh | `~/.zshrc` | +| Bash | `~/.bashrc` | +| Fish | `~/.config/fish/config.fish`, 문법이 다름 | + +편집 후 새 터미널을 열거나 현재 Shell에서 다시 불러옵니다. + +```bash +source ~/.zshrc +``` + +Bash에서는: + +```bash +source ~/.bashrc +``` + +> Shell 설정 파일의 API key는 디스크에 평문으로 저장됩니다. Git이나 공개 동기화 폴더에 포함하지 마세요. + +## 연결 검증 + +Claude Code가 실행된다는 사실만으로 Token Station 사용 여부를 확인할 수는 없습니다. 변수가 설정된 같은 터미널에서 실제 요청을 보내세요. + +```bash +claude -p '请只回复:Token Station 测试成功' +``` + +PowerShell에서는: + +```powershell +claude -p "请只回复:Token Station 测试成功" +``` + +응답을 받은 뒤 [Token Station 대시보드](https://models.bytefuture.ai/dashboard)의 `Recent Activity`에서 요청 시간, 상태, 모델을 확인합니다. + +다음 조건을 모두 충족해야 연결이 완료된 것입니다. + +- Claude Code가 정상 응답함 +- Token Station에 해당 요청이 기록됨 +- 기록된 모델이 설정과 일치함 + +## 선택 사항: 모델 등급 매핑 + +Claude Code의 일부 작업은 Opus, Sonnet, Haiku 등급을 사용합니다. 각 등급을 서로 다른 Token Station 모델에 연결할 수 있습니다. + +```bash +export ANTHROPIC_DEFAULT_OPUS_MODEL='openai/gpt-5.6-sol' +export ANTHROPIC_DEFAULT_SONNET_MODEL='openai/gpt-5.6-terra' +export ANTHROPIC_DEFAULT_HAIKU_MODEL='openai/gpt-5.6-luna' +``` + +PowerShell에서는: + +```powershell +$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "openai/gpt-5.6-sol" +$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "openai/gpt-5.6-terra" +$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "openai/gpt-5.6-luna" +``` + +한 모델만 고정하려면 `ANTHROPIC_MODEL`만 설정해도 됩니다. 현재 사용 가능한 모델은 Token Station 목록에서 확인하세요. + +## 문제 해결 + +### Anthropic 계정 로그인을 계속 요구함 + +API key가 로드되었는지 확인하고 변수를 설정한 같은 터미널에서 Claude Code를 실행하세요. Windows 사용자 변수를 저장했다면 새 PowerShell을 여세요. + +### 401 또는 403 + +API key가 잘못되었거나 공백이 포함되었거나 모델 권한 또는 잔액이 없을 수 있습니다. key를 다시 복사하고 Token Station에서 계정 상태를 확인하세요. + +### 404 + +Base URL은 다음 값이어야 합니다. + +```text +https://models.bytefuture.ai +``` + +`/v1` 또는 `/v1/messages`를 추가하지 마세요. + +### 모델을 찾을 수 없음 + +Token Station에 표시되는 전체 모델 ID와 제공자 접두사를 사용하세요. + +### 응답은 있지만 Token Station 기록이 없음 + +현재 프로세스가 Token Station을 사용하지 않을 수 있습니다. `ANTHROPIC_BASE_URL`을 확인하고 같은 터미널에서 `claude -p`를 다시 실행하세요. + +## 참고 자료 + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station 모델 목록](https://models.bytefuture.ai/models) +- [Token Station 대시보드](https://models.bytefuture.ai/dashboard) + diff --git a/src/content/writings/ko/configure-codex-app-with-token-station.md b/src/content/writings/ko/configure-codex-app-with-token-station.md new file mode 100644 index 0000000..1c1d285 --- /dev/null +++ b/src/content/writings/ko/configure-codex-app-with-token-station.md @@ -0,0 +1,191 @@ +--- +slug: "configure-codex-app-with-token-station" +lang: "ko" +title: "Codex App을 Token Station에 연결하기: Windows, macOS, Linux" +summary: "Codex App에 Token Station을 사용자 지정 모델 Provider로 등록하고 각 운영체제에서 API key를 로드한 뒤 Responses API 전체 경로를 검증합니다." +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Codex App은 `config.toml`에 사용자 지정 모델 Provider를 등록할 수 있습니다. Provider를 Token Station Responses API로 지정하면 Token Station API key로 제공되는 모델을 사용할 수 있습니다. + +이 글은 Windows, macOS, Linux 설정을 다룹니다. 데스크톱 App과 터미널 프로그램은 서로 다른 경로에서 환경 변수를 받을 수 있습니다. macOS에서 Dock이나 Finder로 실행한 App은 일반적으로 `~/.zshrc`를 읽지 않습니다. + +## 준비 사항 + +- Codex App +- [Token Station](https://models.bytefuture.ai/intro.html) 계정과 API key +- 대상 모델의 사용 권한 또는 잔액 + +예시는 `openai/gpt-5.6-sol`을 사용합니다. Token Station에 표시되는 현재 전체 모델 ID를 확인하세요. + +> 실제 API key를 `config.toml`, 스크린샷, 채팅 또는 저장소에 넣지 마세요. Codex가 환경 변수에서 읽도록 설정합니다. + +## Token Station Provider 등록 + +Codex App에서 **설정 → 구성 → config.toml 열기**로 이동해 다음을 추가합니다. + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +기존 설정이 있다면 필요한 항목을 지우지 말고 병합하세요. + +| 필드 | 용도 | +| --- | --- | +| `model` | 전체 기본 모델 ID | +| `model_provider` | Codex가 사용할 Provider 블록 | +| `name` | Provider 표시 이름 | +| `base_url` | Token Station API 루트 | +| `env_key` | API key를 저장하는 환경 변수 이름 | +| `wire_api` | Responses API 선택 | + +두 `token_station` 값이 일치해야 합니다. + +```toml +model_provider = "token_station" +[model_providers.token_station] +``` + +`base_url`은 `/v1`까지만 입력하고 `/responses`를 추가하지 마세요. 모델 ID의 제공자 접두사도 유지합니다. + +## Windows: API key 설정 + +**고급 시스템 설정 → 환경 변수**를 열고 사용자 변수를 만듭니다. + +| 항목 | 값 | +| --- | --- | +| 변수 이름 | `TOKEN_STATION_API_KEY` | +| 변수 값 | 실제 Token Station API key | + +변수 이름은 `config.toml`의 `env_key`와 정확히 일치해야 합니다. 저장한 뒤 Codex App을 완전히 종료하고 다시 여세요. + +## macOS: API key 설정 + +Dock, Finder, Launchpad에서 실행한 App은 현재 터미널의 `export`를 보통 상속하지 않습니다. 그래픽 로그인 세션에 변수를 추가합니다. + +```bash +launchctl setenv TOKEN_STATION_API_KEY '你的真实密钥' +``` + +key를 출력하지 않고 존재 여부를 확인합니다. + +```bash +if [ -n "$(launchctl getenv TOKEN_STATION_API_KEY)" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +`Command + Q`로 Codex App을 종료한 뒤 Dock, Finder 또는 Launchpad에서 다시 여세요. + +`launchctl setenv` 변수는 보통 현재 로그인 세션에서만 유효합니다. 로그아웃이나 재부팅 후 다시 설정해야 할 수 있습니다. 삭제하려면: + +```bash +launchctl unsetenv TOKEN_STATION_API_KEY +``` + +## Linux: API key 설정 + +환경 변수 상속 방식은 배포판, 데스크톱 환경, 설치 방법에 따라 다릅니다. 터미널에서 Codex를 실행한다면 같은 Shell에서 설정하세요. + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +존재 여부를 확인합니다. + +```bash +if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +같은 터미널에서 Codex를 실행하세요. 새 터미널에서도 로드하려면 `export`를 `~/.bashrc` 또는 `~/.zshrc`에 추가합니다. + +GNOME이나 KDE 메뉴에서 실행하고 systemd 사용자 세션을 사용한다면 다음을 시도할 수 있습니다. + +```bash +systemctl --user set-environment TOKEN_STATION_API_KEY='你的真实密钥' +``` + +App을 완전히 종료하고 다시 엽니다. 삭제하려면: + +```bash +systemctl --user unset-environment TOKEN_STATION_API_KEY +``` + +> Shell 설정 파일의 key는 평문으로 저장됩니다. Git이나 공개 동기화 폴더에 포함하지 마세요. + +## 전체 경로 검증 + +1. Codex App을 완전히 종료하고 다시 열기 +2. 새 대화 만들기 +3. 다음 메시지 보내기 + + ```text + 请只回复:Token Station 测试成功 + ``` + +4. 정상 응답 확인하기 +5. [Token Station 대시보드](https://models.bytefuture.ai/dashboard) 열기 +6. `Recent Activity`에서 시간, 상태, 모델 비교하기 + +요청 경로는 다음과 같습니다. + +```text +Codex App + → config.toml 中的 token_station provider + → TOKEN_STATION_API_KEY + → https://bec.bytefuture.ai/v1/responses + → Token Station 调用记录 +``` + +App 응답과 Token Station의 해당 기록이 모두 있어야 연결이 완료됩니다. + +## 문제 해결 + +### API key를 찾을 수 없음 + +변수 이름이 `env_key = "TOKEN_STATION_API_KEY"`와 정확히 일치하는지 확인하고 설정 후 App을 다시 시작하세요. macOS에서 Dock으로 실행한다면 `launchctl setenv`를 사용합니다. + +### 401 또는 403 + +key가 잘못되었거나 공백이 포함되었거나 모델 권한 또는 잔액이 없을 수 있습니다. + +### 404 + +다음을 확인합니다. + +```toml +base_url = "https://bec.bytefuture.ai/v1" +wire_api = "responses" +``` + +`/responses`를 중복해서 추가하지 마세요. + +### 모델을 찾을 수 없음 + +Token Station이 제공하는 전체 모델 ID와 제공자 접두사를 사용하세요. + +### 응답은 있지만 Token Station 기록이 없음 + +`model_provider`와 Provider 블록 이름이 일치하는지, App이 수정된 `config.toml`을 다시 읽었는지 확인하세요. + +## 참고 자료 + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station 대시보드](https://models.bytefuture.ai/dashboard) + diff --git a/src/content/writings/ko/configure-codex-cli-with-token-station.md b/src/content/writings/ko/configure-codex-cli-with-token-station.md new file mode 100644 index 0000000..3542d44 --- /dev/null +++ b/src/content/writings/ko/configure-codex-cli-with-token-station.md @@ -0,0 +1,215 @@ +--- +slug: "configure-codex-cli-with-token-station" +lang: "ko" +title: "Codex CLI를 Token Station에 연결하기: Windows, macOS, Linux" +summary: "Codex CLI에 Token Station 사용자 지정 Provider를 설정하고 각 운영체제에서 API key를 안전하게 로드한 뒤 Responses API 요청을 검증합니다." +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Codex CLI는 `config.toml`에서 사용자 지정 모델 Provider를 지원합니다. Token Station을 추가하면 `codex`와 `codex exec`를 그대로 사용하면서 Token Station API key로 요청을 보낼 수 있습니다. + +이 글은 명령줄 버전 Codex용입니다. Codex App은 특히 macOS와 Linux 데스크톱에서 환경 변수 상속 방식이 다르므로 두 절차를 섞지 마세요. + +## 준비 사항 + +- `codex --version`으로 확인할 수 있는 Codex CLI +- 사용 가능한 Token Station API key +- 대상 모델의 사용 권한 또는 잔액 + +> 실제 API key를 문서, 이미지, 채팅 또는 저장소에 공개하지 마세요. + +## Token Station Provider 설정 + +Codex CLI는 다음 사용자 설정 파일을 읽습니다. + +- Windows: `%USERPROFILE%\.codex\config.toml` +- macOS와 Linux: `~/.codex/config.toml` + +다음을 추가합니다. + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +기존 설정이 있다면 필요한 항목을 지우지 말고 병합하세요. + +| 필드 | 용도 | +| --- | --- | +| `model` | 전체 기본 모델 ID | +| `model_provider` | Codex가 사용할 Provider 블록 | +| `name` | Provider 표시 이름 | +| `base_url` | Token Station API 루트 | +| `env_key` | API key를 저장하는 환경 변수 이름 | +| `wire_api` | Responses API 선택 | + +다음을 확인하세요. + +- `model_provider = "token_station"`이 `[model_providers.token_station]`과 일치함 +- `base_url`은 `/v1`까지만 입력하고 `/responses`를 추가하지 않음 +- `wire_api`는 `"responses"` +- 모델 ID에 제공자 접두사가 있음 + +예시는 `openai/gpt-5.6-sol`을 사용합니다. Token Station에 표시되는 현재 전체 ID를 사용하세요. + +## Windows 설정 + +### key 임시 로드 + +PowerShell에서 실행합니다. + +```powershell +$env:TOKEN_STATION_API_KEY = "你的真实密钥" +``` + +현재 PowerShell과 하위 프로세스에서만 유효합니다. + +### 사용자 환경 변수로 저장 + +```powershell +[Environment]::SetEnvironmentVariable( + "TOKEN_STATION_API_KEY", + "你的真实密钥", + "User" +) +``` + +저장 후 터미널을 닫고 새 PowerShell을 여세요. + +key를 출력하지 않고 변수를 확인합니다. + +```powershell +if ([string]::IsNullOrEmpty($env:TOKEN_STATION_API_KEY)) { + "TOKEN_STATION_API_KEY 未设置" +} else { + "TOKEN_STATION_API_KEY 已设置" +} +``` + +삭제하려면: + +```powershell +[Environment]::SetEnvironmentVariable( + "TOKEN_STATION_API_KEY", + $null, + "User" +) +``` + +## macOS와 Linux 설정 + +Codex CLI를 실행할 터미널에서 설정합니다. + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +존재 여부를 확인합니다. + +```bash +if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +새 터미널에서도 로드하려면 Shell 설정 파일에 `export`를 추가하세요. + +| Shell | 일반적인 설정 파일 | +| --- | --- | +| Zsh | `~/.zshrc` | +| Bash | `~/.bashrc` | +| Fish | `~/.config/fish/config.fish`, 문법이 다름 | + +편집 후 새 터미널을 열거나 `source ~/.zshrc` 또는 `source ~/.bashrc`를 실행합니다. + +> Shell 설정 파일의 key는 평문으로 저장됩니다. Git이나 공개 동기화 폴더에 포함하지 마세요. + +## 설정 검증 + +대화형 세션을 시작합니다. + +```bash +codex +``` + +실행 후 다음을 보냅니다. + +```text +请只回复:Token Station 测试成功 +``` + +비대화형 요청도 실행할 수 있습니다. + +```bash +codex exec '请只回复:Token Station 测试成功' +``` + +PowerShell에서는 큰따옴표를 사용합니다. + +```powershell +codex exec "请只回复:Token Station 测试成功" +``` + +응답 후 [Token Station 대시보드](https://models.bytefuture.ai/dashboard)의 `Recent Activity`에서 시간, 상태, 모델을 비교하세요. + +다음 조건을 모두 충족해야 설정이 완료됩니다. + +- `codex` 또는 `codex exec`가 정상 응답함 +- Token Station에 해당 요청이 있음 +- 기록된 모델이 설정과 일치함 + +## 문제 해결 + +### `codex` 명령을 찾을 수 없음 + +Codex CLI가 설치되고 설치 경로가 `PATH`에 포함되었는지 확인하세요. 새 터미널에서 `codex --version`을 실행합니다. + +### API key를 찾을 수 없음 + +변수 이름이 `TOKEN_STATION_API_KEY`인지, `config.toml`의 `env_key`와 일치하는지, 같은 터미널에서 Codex를 실행하는지 확인하세요. + +### 401 또는 403 + +key가 잘못되었거나 공백이 포함되었거나 모델 권한 또는 잔액이 없을 수 있습니다. + +### 404 + +다음을 확인합니다. + +```toml +base_url = "https://bec.bytefuture.ai/v1" +wire_api = "responses" +``` + +Base URL에 `/responses`를 추가하지 마세요. + +### 모델을 찾을 수 없거나 요청 실패 + +Token Station이 현재 제공하는 전체 모델 ID와 제공자 접두사를 사용하세요. + +### 이전 설정이 계속 사용됨 + +현재 사용자의 `config.toml`을 편집했는지, 확장자가 올바른지, Codex CLI 프로세스를 다시 시작했는지 확인하세요. + +## 보안 + +- 실제 key를 `config.toml`에 쓰지 않기 +- key가 포함된 Shell 설정 파일을 Git에 커밋하지 않기 +- 공유 컴퓨터에서는 임시 환경 변수 사용하기 +- 유출 가능성이 있으면 key를 즉시 폐기하고 다시 발급하기 + +## 참고 자료 + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station 대시보드](https://models.bytefuture.ai/dashboard) diff --git a/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md new file mode 100644 index 0000000..e7f9c1f --- /dev/null +++ b/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -0,0 +1,173 @@ +--- +slug: "configure-claude-code-app-with-cc-switch-and-token-station" +lang: "zh" +title: "用 CC Switch 为 Claude Code App 配置 Token Station" +summary: "介绍如何在 CC Switch 中创建并启用 Token Station Provider,让 Claude Code App 读取新配置,并通过真实请求和控制台记录完成验证。" +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +当你需要在官方服务、Token Station 和其他模型服务之间切换时,反复修改 Claude Code App 的配置并不方便。CC Switch 可以将每组连接参数保存为独立 Provider,切换时直接应用对应配置。 + +本文介绍如何通过 CC Switch 为 Claude Code App 配置 Token Station,并用一次真实请求完成端到端验证。 + +> 本文面向 CC Switch 与 Claude Code App。命令行版 Claude Code CLI 的启动方式和变量来源不同,请使用专门的 CLI 配置方法。 + +## 开始之前 + +请准备: + +- 已安装 CC Switch 和 Claude Code App; +- 一个可用的 Token Station API Key; +- 目标模型的调用权限或可用额度。 + +打开 [Token Station 控制台](https://models.bytefuture.ai/dashboard),确认 API Key 和目标模型的完整 ID。不要在截图、聊天记录或公开文档中展示真实密钥。 + +## 配置流程 + +整个过程分为五步: + +1. 在 CC Switch 中新建 Claude Code Provider; +2. 填写 Token Station 地址、API Key 和模型 ID; +3. 保存并启用该 Provider; +4. 完全退出并重新打开 Claude Code App; +5. 发起请求,并在 Token Station 控制台核对记录。 + +## 在 CC Switch 中添加 Token Station + +不同版本的 CC Switch 可能使用不同的按钮名称,但核心字段相同。 + +### 1. 新建 Provider + +打开 CC Switch,选择 **Claude Code**,进入 Provider 管理页面。点击“添加”“新增 Provider”或加号按钮,创建一条配置。 + +配置名称可以填写: + +```text +Token Station +``` + +如果需要选择类型,使用 Claude、Anthropic 或自定义 Anthropic 兼容服务。 + +### 2. 填写连接参数 + +| 字段 | 填写内容 | +| --- | --- | +| Base URL | `https://models.bytefuture.ai` | +| API Key / Auth Token | 你的 Token Station API Key | +| Model | Token Station 显示的完整模型 ID | + +如果界面要求填写环境变量,使用: + +```text +ANTHROPIC_BASE_URL=https://models.bytefuture.ai +ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> +ANTHROPIC_MODEL=<完整模型 ID> +``` + +部分 CC Switch 模板可能使用 `ANTHROPIC_API_KEY`。这时应按当前模板填写,不要同时设置多个来源不明的密钥字段。 + +Base URL 不要手动添加 `/v1/messages`。客户端会根据 Anthropic Messages API 自动拼接请求路径,重复添加可能导致 404。 + +模型 ID 必须与 Token Station 显示的值完全一致,包括提供方前缀。例如: + +```text +openai/gpt-5.6-sol +``` + +不要使用 Claude Code App 中的展示名称代替完整 ID。 + +### 3. 保存并启用 + +保存前检查: + +- Base URL 没有多余路径或空格; +- API Key 前后没有换行或空格; +- 模型 ID 包含完整提供方前缀; +- 示例中的尖括号和说明文字没有被复制进去。 + +保存后,在 Provider 列表中找到 **Token Station**,点击“启用”“应用”或“切换”。确认 CC Switch 显示它是当前配置。 + +## 重启 Claude Code App + +已经运行的 App 通常不会自动读取后来切换的配置,因此需要完全退出后再启动。 + +### Windows + +1. 关闭 Claude Code App 窗口; +2. 检查系统托盘,确认应用没有在后台运行; +3. 如仍在运行,选择“退出”; +4. 从 CC Switch 应用配置后重新打开 App。 + +### macOS + +1. 在 Claude Code App 中按 `Command + Q`; +2. 确认程序已经退出; +3. 从 CC Switch 应用配置后重新打开 App。 + +只关闭窗口不一定会结束进程。切换 Provider 后不重启,是最常见的配置未生效原因。 + +## 端到端验证 + +在 Claude Code App 中新建会话,发送: + +```text +请只回复:Token Station 测试成功 +``` + +收到回复后,打开 [Token Station 控制台](https://models.bytefuture.ai/dashboard),在 `Recent Activity` 或调用记录页面检查: + +- 是否出现了刚才的请求; +- 请求时间和状态是否正确; +- 实际模型是否与 CC Switch 中的配置一致。 + +只有 App 正常返回结果,并且控制台出现对应记录,才能证明请求确实经过 Token Station。CC Switch 界面显示“当前配置”本身并不是完整验证。 + +## 切回原配置 + +建议保留原来的官方 Provider,不要直接覆盖唯一配置。需要恢复时: + +1. 在 CC Switch 中选择原 Provider; +2. 点击“应用”或“切换”; +3. 完全退出 Claude Code App; +4. 重新打开 App 并发送测试消息。 + +## 常见问题 + +### 已切换 Provider,但 App 仍使用旧配置 + +确认 App 已完全退出,而不是只关闭窗口。重新应用 Token Station Provider,再启动 App。 + +### 提示缺少 API Key + +检查 CC Switch 模板要求的是 `ANTHROPIC_AUTH_TOKEN` 还是 `ANTHROPIC_API_KEY`,并确认密钥字段没有留空。修改后重新应用 Provider 并重启 App。 + +### 返回 401 或 403 + +通常是 API Key 错误、已经失效、含有多余空格,或账户没有目标模型的权限和额度。 + +### 返回 404 + +检查 Base URL 是否为 `https://models.bytefuture.ai`,并确认没有手动添加 `/messages` 或其他重复路径。 + +### 返回模型不存在或无权限 + +复制 Token Station 模型列表中的完整 ID,不要根据 App 的展示名称推测模型 ID。 + +### App 有回复,但 Token Station 没有记录 + +App 可能仍在使用原服务。检查当前 Provider、App 是否在切换后重启,以及控制台账号和筛选时间是否正确。 + +## 安全建议 + +- 不要在教程截图中展示真实 API Key; +- 不要把 CC Switch 配置文件或密钥提交到 Git; +- 密钥疑似泄露时,立即在 Token Station 中撤销并重新生成; +- 升级 CC Switch 或 Claude Code App 前,备份当前可用配置。 + +## 参考资料 + +- [Token Station 控制台](https://models.bytefuture.ai/dashboard) +- [CC Switch 项目](https://github.com/farion1231/cc-switch) diff --git a/src/content/writings/zh/configure-claude-code-cli-with-token-station.md b/src/content/writings/zh/configure-claude-code-cli-with-token-station.md new file mode 100644 index 0000000..d5b58fa --- /dev/null +++ b/src/content/writings/zh/configure-claude-code-cli-with-token-station.md @@ -0,0 +1,210 @@ +--- +slug: "configure-claude-code-cli-with-token-station" +lang: "zh" +title: "Claude Code CLI 接入 Token Station:跨平台配置与验证" +summary: "介绍如何在 Windows、macOS 和 Linux 中配置 Claude Code CLI,通过 Token Station 调用模型,并使用真实请求和控制台记录完成端到端验证。" +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Claude Code CLI 可以通过 Anthropic Messages API 连接第三方模型网关。将请求地址、API Key 和模型 ID 指向 Token Station 后,就能继续使用熟悉的 `claude` 命令,同时调用 Token Station 提供的模型。 + +本文介绍 Windows、macOS 和 Linux 的配置方法。需要特别注意两点:Base URL 不要手动添加 `/v1`,模型 ID 必须保留 `openai/`、`anthropic/` 等提供方前缀。 + +## 开始之前 + +请准备: + +- 已安装 Claude Code CLI,运行 `claude --version` 可以看到版本信息; +- 一个可用的 [Token Station](https://models.bytefuture.ai/intro.html) 账户和 API Key; +- 目标模型的调用权限或可用额度。 + +本文以 `openai/gpt-5.6-sol` 为例。模型 ID 可能随平台更新,请以 [Token Station 模型列表](https://models.bytefuture.ai/models) 显示的完整 ID 为准。 + +> 不要把真实 API Key 写入代码仓库、公开文档、截图或聊天消息。 + +## 需要配置的变量 + +| 环境变量 | 作用 | 示例值 | +| --- | --- | --- | +| `ANTHROPIC_BASE_URL` | 将 Claude Code 请求指向 Token Station | `https://models.bytefuture.ai` | +| `ANTHROPIC_AUTH_TOKEN` | Token Station API Key | 你的真实密钥 | +| `ANTHROPIC_MODEL` | 默认模型的完整 ID | `openai/gpt-5.6-sol` | + +Claude Code 会在 Base URL 后使用 Anthropic Messages API 路径,因此地址应写为: + +```text +https://models.bytefuture.ai +``` + +不要写成 `https://models.bytefuture.ai/v1`,否则可能出现重复路径并返回 404。 + +模型 ID 同样要保持完整: + +```text +openai/gpt-5.6-sol +``` + +不要简写为 `gpt-5.6-sol`。 + +## Windows 配置 + +### 临时配置 + +在 PowerShell 中执行: + +```powershell +$env:ANTHROPIC_BASE_URL = "https://models.bytefuture.ai" +$env:ANTHROPIC_AUTH_TOKEN = "你的真实密钥" +$env:ANTHROPIC_MODEL = "openai/gpt-5.6-sol" + +claude +``` + +这些变量只对当前 PowerShell 及其子进程有效,适合首次测试。 + +### 保存为用户环境变量 + +需要让新终端自动读取配置时,执行: + +```powershell +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_BASE_URL", + "https://models.bytefuture.ai", + "User" +) + +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_AUTH_TOKEN", + "你的真实密钥", + "User" +) + +[Environment]::SetEnvironmentVariable( + "ANTHROPIC_MODEL", + "openai/gpt-5.6-sol", + "User" +) +``` + +保存后关闭当前 PowerShell,再打开新窗口运行 `claude`。已有进程不会自动获得新变量。 + +如需清除配置: + +```powershell +[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", $null, "User") +[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", $null, "User") +[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", $null, "User") +``` + +## macOS 和 Linux 配置 + +在启动 Claude Code 的终端中执行: + +```bash +export ANTHROPIC_BASE_URL='https://models.bytefuture.ai' +export ANTHROPIC_AUTH_TOKEN='你的真实密钥' +export ANTHROPIC_MODEL='openai/gpt-5.6-sol' + +claude +``` + +变量只在当前 Shell 及其子进程中有效。需要持久化时,可将三行 `export` 加入对应的 Shell 配置文件: + +| Shell | 常见配置文件 | +| --- | --- | +| Zsh | `~/.zshrc` | +| Bash | `~/.bashrc` | +| Fish | `~/.config/fish/config.fish`,语法与 Bash/Zsh 不同 | + +修改后重新打开终端,或按实际 Shell 执行: + +```bash +source ~/.zshrc +``` + +或: + +```bash +source ~/.bashrc +``` + +> 将 API Key 写入 Shell 配置文件会以明文保存在磁盘上。请确认该文件不会进入 Git 或公共同步目录。安全要求较高时,优先使用系统密钥环、密码管理器或临时环境变量。 + +## 验证配置 + +不要只根据 Claude Code 能否启动来判断配置是否成功。请从已经设置变量的终端发起一次真实请求: + +```bash +claude -p '请只回复:Token Station 测试成功' +``` + +PowerShell 可以执行: + +```powershell +claude -p "请只回复:Token Station 测试成功" +``` + +收到回复后,打开 [Token Station 控制台](https://models.bytefuture.ai/dashboard),在 `Recent Activity` 中核对请求时间、状态和模型。 + +只有同时满足以下条件,才表示链路已经跑通: + +- Claude Code 正常返回结果; +- Token Station 控制台出现对应记录; +- 记录中的模型与配置一致。 + +## 可选:为不同档位指定模型 + +Claude Code 的部分任务会使用 Opus、Sonnet 或 Haiku 档位。可以分别映射到 Token Station 中的模型: + +```bash +export ANTHROPIC_DEFAULT_OPUS_MODEL='openai/gpt-5.6-sol' +export ANTHROPIC_DEFAULT_SONNET_MODEL='openai/gpt-5.6-terra' +export ANTHROPIC_DEFAULT_HAIKU_MODEL='openai/gpt-5.6-luna' +``` + +Windows PowerShell 对应写法: + +```powershell +$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "openai/gpt-5.6-sol" +$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "openai/gpt-5.6-terra" +$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "openai/gpt-5.6-luna" +``` + +如果只想固定使用一个模型,保留 `ANTHROPIC_MODEL` 即可。具体可用模型仍以 Token Station 当前列表为准。 + +## 常见问题 + +### Claude Code 仍要求登录 Anthropic 账户 + +确认 API Key 已加载,并从设置变量的同一个终端启动 Claude Code。Windows 用户如果刚写入用户环境变量,需要打开新的 PowerShell 窗口。 + +### 返回 401 或 403 + +通常是 API Key 无效、密钥前后有空格、账户无权限或额度不足。重新复制密钥,并在 Token Station 控制台检查账户状态。 + +### 返回 404 + +检查 Base URL 是否为: + +```text +https://models.bytefuture.ai +``` + +不要在末尾添加 `/v1` 或 `/v1/messages`。 + +### 提示模型不存在 + +确认 `ANTHROPIC_MODEL` 使用 Token Station 显示的完整模型 ID,并保留提供方前缀。 + +### Claude Code 有回复,但控制台没有记录 + +这通常说明当前进程没有使用 Token Station。检查 `ANTHROPIC_BASE_URL`,重新设置变量后,在同一终端运行一次 `claude -p` 再核对记录。 + +## 参考资料 + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station 模型列表](https://models.bytefuture.ai/models) +- [Token Station 控制台](https://models.bytefuture.ai/dashboard) diff --git a/src/content/writings/zh/configure-codex-app-with-token-station.md b/src/content/writings/zh/configure-codex-app-with-token-station.md new file mode 100644 index 0000000..d5a264d --- /dev/null +++ b/src/content/writings/zh/configure-codex-app-with-token-station.md @@ -0,0 +1,196 @@ +--- +slug: "configure-codex-app-with-token-station" +lang: "zh" +title: "Codex App 接入 Token Station:跨平台配置与验证" +summary: "介绍如何在 Codex App 中注册 Token Station 模型提供方,分别为 Windows、macOS 和 Linux 配置 API Key,并完成端到端验证。" +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Codex App 可以通过 `config.toml` 注册自定义模型提供方。将 provider 指向 Token Station 的 Responses API 后,Codex 就能使用 Token Station 提供的模型,并通过你的 Token Station API Key 计费。 + +本文介绍 Windows、macOS 和 Linux 的配置方式。桌面 App 与终端程序的环境变量来源可能不同,其中 macOS 从 Dock 或 Finder 启动的 App 通常不会读取 `~/.zshrc`。 + +## 开始之前 + +请准备: + +- 已安装 Codex App; +- 一个可用的 [Token Station](https://models.bytefuture.ai/intro.html) 账户和 API Key; +- 目标模型的调用权限或可用额度。 + +本文以 `openai/gpt-5.6-sol` 为例。请以 Token Station 当前显示的完整模型 ID 为准。 + +> 不要把真实 API Key 写入 `config.toml`、截图、聊天消息或代码仓库。本文让 Codex 从环境变量读取密钥。 + +## 注册 Token Station Provider + +在 Codex App 中进入 **设置 → 配置 → 打开 config.toml**,加入: + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +如果文件中已有其他配置,请合并这些字段,不要覆盖仍需保留的设置。 + +| 字段 | 作用 | +| --- | --- | +| `model` | Codex 默认请求的完整模型 ID | +| `model_provider` | 当前使用的 provider 配置块 | +| `name` | Provider 的显示名称 | +| `base_url` | Token Station 的 API 根地址 | +| `env_key` | Codex 读取 API Key 的环境变量名 | +| `wire_api` | 指定使用 Responses API | + +两处 `token_station` 必须一致: + +```toml +model_provider = "token_station" +[model_providers.token_station] +``` + +`base_url` 只写到 `/v1`,不要手动添加 `/responses`。模型名称也要保留 `openai/` 等提供方前缀。 + +## Windows:配置 API Key + +打开 **高级系统设置 → 环境变量**,在“用户变量”区域新建: + +| 项目 | 值 | +| --- | --- | +| 变量名 | `TOKEN_STATION_API_KEY` | +| 变量值 | 你的真实 Token Station API Key | + +变量名必须与 `config.toml` 中的 `env_key` 完全一致。 + +保存后完全退出 Codex App,再重新打开。只关闭窗口不一定会结束进程,已经运行的 App 也不会自动获得新变量。 + +## macOS:配置 API Key + +从 Dock、Finder 或 Launchpad 启动的 App 通常不会继承当前终端中的 `export`。可以将变量加入当前图形登录会话: + +```bash +launchctl setenv TOKEN_STATION_API_KEY '你的真实密钥' +``` + +检查变量是否存在,但不直接打印密钥: + +```bash +if [ -n "$(launchctl getenv TOKEN_STATION_API_KEY)" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +设置后按 `Command + Q` 完全退出 Codex App,再从 Dock、Finder 或 Launchpad 重新打开。 + +`launchctl setenv` 设置的变量通常只对当前图形登录会话有效。注销或重启后可能需要重新执行。需要清除时使用: + +```bash +launchctl unsetenv TOKEN_STATION_API_KEY +``` + +## Linux:配置 API Key + +Linux 桌面环境的变量继承方式因发行版和安装方式而异。如果从终端启动 Codex,可以先在当前 Shell 中设置: + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +检查变量是否存在: + +```bash +if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +然后从同一终端启动 Codex。需要让新终端自动加载时,可将 `export` 加入 `~/.bashrc` 或 `~/.zshrc`。 + +如果从 GNOME、KDE 等桌面菜单启动 App,并且系统使用 systemd 用户会话,可以尝试: + +```bash +systemctl --user set-environment TOKEN_STATION_API_KEY='你的真实密钥' +``` + +设置后完全退出并重新打开 App。需要清除时执行: + +```bash +systemctl --user unset-environment TOKEN_STATION_API_KEY +``` + +> 将 API Key 写入 Shell 配置文件会以明文保存在磁盘上。请确保文件不会进入 Git 或公共同步目录。 + +## 端到端验证 + +1. 完全退出并重新打开 Codex App; +2. 新建对话; +3. 发送: + + ```text + 请只回复:Token Station 测试成功 + ``` + +4. 确认 Codex App 收到正常回复; +5. 打开 [Token Station 控制台](https://models.bytefuture.ai/dashboard); +6. 在 `Recent Activity` 中核对请求时间、状态和模型。 + +链路应为: + +```text +Codex App + → config.toml 中的 token_station provider + → TOKEN_STATION_API_KEY + → https://bec.bytefuture.ai/v1/responses + → Token Station 调用记录 +``` + +只有 App 正常返回结果,并且控制台出现对应记录,才能确认接入成功。 + +## 常见问题 + +### Codex 提示找不到 API Key + +确认环境变量名与 `env_key = "TOKEN_STATION_API_KEY"` 完全一致,并在设置变量后重启 App。 + +macOS 如果只在 `~/.zshrc` 中写了 `export`,从 Dock 启动的 App 可能无法读取。请使用 `launchctl setenv`,再重启 App。 + +### 返回 401 或 403 + +通常是 API Key 无效、密钥前后有空格、账户无权限或额度不足。 + +### 返回 404 + +检查: + +```toml +base_url = "https://bec.bytefuture.ai/v1" +wire_api = "responses" +``` + +不要在 Base URL 后重复添加 `/responses`。 + +### 提示模型不存在 + +确认 `model` 使用 Token Station 提供的完整模型 ID,并保留提供方前缀。 + +### Codex 有回复,但控制台没有记录 + +检查 `model_provider` 与 provider 配置块名称是否一致,并确认 App 已重新加载修改后的 `config.toml`。按请求时间重新核对控制台记录。 + +## 参考资料 + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station 控制台](https://models.bytefuture.ai/dashboard) diff --git a/src/content/writings/zh/configure-codex-cli-with-token-station.md b/src/content/writings/zh/configure-codex-cli-with-token-station.md new file mode 100644 index 0000000..6586e66 --- /dev/null +++ b/src/content/writings/zh/configure-codex-cli-with-token-station.md @@ -0,0 +1,222 @@ +--- +slug: "configure-codex-cli-with-token-station" +lang: "zh" +title: "Codex CLI 接入 Token Station:跨平台配置与验证" +summary: "介绍如何为 Codex CLI 配置 Token Station 自定义模型提供方,在 Windows、macOS 和 Linux 中安全加载 API Key,并验证 Responses API 请求。" +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Codex CLI 支持通过 `config.toml` 注册自定义模型提供方。配置 Token Station 后,可以继续使用 `codex` 和 `codex exec`,并通过 Token Station API Key 调用指定模型。 + +本文面向命令行版 Codex。Codex App 的环境变量继承方式不同,尤其是在 macOS 和 Linux 桌面环境中,请不要直接混用两套步骤。 + +## 开始之前 + +请确认: + +- 已安装 Codex CLI,运行 `codex --version` 可以看到版本信息; +- 已获取可用的 Token Station API Key; +- 账户拥有目标模型的调用权限或可用额度。 + +> 不要在文档、截图、聊天记录或代码仓库中公开真实密钥。 + +## 配置 Token Station Provider + +Codex CLI 默认读取用户目录下的配置文件: + +- Windows:`%USERPROFILE%\.codex\config.toml` +- macOS 和 Linux:`~/.codex/config.toml` + +将以下内容加入 `config.toml`: + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +如果文件中已有配置,请合并这些字段,不要直接覆盖其他仍需保留的设置。 + +| 字段 | 作用 | +| --- | --- | +| `model` | 默认请求的完整模型 ID | +| `model_provider` | 当前使用的 provider 配置块 | +| `name` | Provider 的显示名称 | +| `base_url` | Token Station 的 API 根地址 | +| `env_key` | Codex 读取 API Key 的环境变量名 | +| `wire_api` | 指定使用 Responses API | + +配置时注意: + +- `model_provider = "token_station"` 必须与 `[model_providers.token_station]` 对应; +- `base_url` 只写到 `/v1`,不要添加 `/responses`; +- `wire_api` 使用 `"responses"`; +- 模型 ID 保留 `openai/` 等提供方前缀。 + +本文以 `openai/gpt-5.6-sol` 为例。实际使用时,以 Token Station 当前模型列表为准。 + +## Windows 配置 + +### 临时加载 API Key + +在 PowerShell 中执行: + +```powershell +$env:TOKEN_STATION_API_KEY = "你的真实密钥" +``` + +变量只对当前 PowerShell 及其子进程有效,适合首次验证。 + +### 保存为用户环境变量 + +```powershell +[Environment]::SetEnvironmentVariable( + "TOKEN_STATION_API_KEY", + "你的真实密钥", + "User" +) +``` + +保存后关闭当前终端,再打开新的 PowerShell。已有进程不会自动获得新变量。 + +检查变量是否存在,但不直接打印密钥: + +```powershell +if ([string]::IsNullOrEmpty($env:TOKEN_STATION_API_KEY)) { + "TOKEN_STATION_API_KEY 未设置" +} else { + "TOKEN_STATION_API_KEY 已设置" +} +``` + +如需清除用户变量: + +```powershell +[Environment]::SetEnvironmentVariable( + "TOKEN_STATION_API_KEY", + $null, + "User" +) +``` + +## macOS 和 Linux 配置 + +在启动 Codex CLI 的终端中执行: + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +检查变量是否存在: + +```bash +if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then + echo "TOKEN_STATION_API_KEY 已设置" +else + echo "TOKEN_STATION_API_KEY 未设置" +fi +``` + +需要让新终端自动加载时,将 `export` 加入当前 Shell 的配置文件: + +| Shell | 常见配置文件 | +| --- | --- | +| Zsh | `~/.zshrc` | +| Bash | `~/.bashrc` | +| Fish | `~/.config/fish/config.fish`,语法不同 | + +修改后重新打开终端,或执行 `source ~/.zshrc`、`source ~/.bashrc`。 + +> Shell 配置文件中的 API Key 会以明文保存在磁盘上。请确保文件不会被提交到 Git 或同步到公共位置。 + +## 验证配置 + +可以先启动交互模式: + +```bash +codex +``` + +进入 Codex CLI 后发送: + +```text +请只回复:Token Station 测试成功 +``` + +也可以直接运行一次非交互任务: + +```bash +codex exec '请只回复:Token Station 测试成功' +``` + +PowerShell 可使用双引号: + +```powershell +codex exec "请只回复:Token Station 测试成功" +``` + +收到回复后,打开 [Token Station 控制台](https://models.bytefuture.ai/dashboard),在 `Recent Activity` 中核对请求时间、状态和模型。 + +只有同时满足以下条件,才表示接入成功: + +- `codex` 或 `codex exec` 正常返回结果; +- Token Station 控制台出现对应记录; +- 记录中的模型与配置一致。 + +## 常见问题 + +### 找不到 `codex` 命令 + +确认 Codex CLI 已安装,并且安装目录已经加入 `PATH`。安装或修改 `PATH` 后重新打开终端,再运行 `codex --version`。 + +### Codex 提示找不到 API Key + +确认: + +- 环境变量名是 `TOKEN_STATION_API_KEY`; +- `config.toml` 中使用 `env_key = "TOKEN_STATION_API_KEY"`; +- Codex 从设置变量的同一终端启动; +- 持久化变量后已经打开新终端。 + +### 返回 401 或 403 + +通常是 API Key 无效、密钥前后有空格、账户无权限或额度不足。 + +### 返回 404 + +检查: + +```toml +base_url = "https://bec.bytefuture.ai/v1" +wire_api = "responses" +``` + +不要在 Base URL 后手动添加 `/responses`。 + +### 模型不存在或调用失败 + +确认 `model` 与 Token Station 当前提供的完整模型 ID 一致,并保留提供方前缀。 + +### 修改配置后仍使用旧设置 + +确认修改的是当前用户的 `config.toml`,文件扩展名正确,并退出旧的 Codex CLI 进程后重新运行。 + +## 安全建议 + +- 不要把真实密钥写入 `config.toml`; +- 不要把包含密钥的 Shell 配置文件提交到 Git; +- 共享计算机优先使用临时环境变量; +- 密钥疑似泄露时,立即在 Token Station 中撤销并重新生成。 + +## 参考资料 + +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station 控制台](https://models.bytefuture.ai/dashboard) From f8d5c896d9b5857e331b5d7220a46758c78940fd Mon Sep 17 00:00:00 2001 From: Takagi Date: Mon, 17 Aug 2026 17:46:01 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=96=87=E7=AB=A0?= =?UTF-8?q?=EF=BC=88=E5=9B=9B=E8=AF=AD=EF=BC=89=EF=BC=8C=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E4=B8=BA=E3=80=8C=E7=94=A8=20Codex=20?= =?UTF-8?q?=E7=BC=96=E6=8E=92=E5=A4=9A=E6=A8=A1=E5=9E=8B=20Subagent?= =?UTF-8?q?=EF=BC=9A=E9=85=8D=E7=BD=AE=E3=80=81=E8=B7=AF=E7=94=B1=E4=B8=8E?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E3=80=8D=EF=BC=8Cslug=20=E4=B8=BA=20codex-mu?= =?UTF-8?q?lti-model-subagents=E3=80=82sitemap=E6=96=B0=E5=A2=9E=204=20?= =?UTF-8?q?=E4=B8=AA=20URL;=20New=20article=20(in=20four=20languages),=20w?= =?UTF-8?q?ith=20the=20official=20title=20=E2=80=9CUsing=20Codex=20to=20De?= =?UTF-8?q?sign=20Multi-Model=20Subagents:=20Configuration,=20Routing,=20a?= =?UTF-8?q?nd=20Acceptance=20Testing=E2=80=9D=20and=20the=20slug=20?= =?UTF-8?q?=E2=80=9Ccodex-multi-model-subagents.=E2=80=9D=20Four=20URLs=20?= =?UTF-8?q?have=20been=20added=20to=20the=20sitemap;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astro.config.mjs | 15 + sitemap.xml | 20 + .../en/codex-multi-model-subagents.md | 299 +++++++++++++ .../ja/codex-multi-model-subagents.md | 275 ++++++++++++ .../ko/codex-multi-model-subagents.md | 275 ++++++++++++ .../zh/codex-multi-model-subagents.md | 415 ++++++++++++++++++ 6 files changed, 1299 insertions(+) create mode 100644 src/content/writings/en/codex-multi-model-subagents.md create mode 100644 src/content/writings/ja/codex-multi-model-subagents.md create mode 100644 src/content/writings/ko/codex-multi-model-subagents.md create mode 100644 src/content/writings/zh/codex-multi-model-subagents.md diff --git a/astro.config.mjs b/astro.config.mjs index ff143d2..f28a13f 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,8 +1,23 @@ import { defineConfig } from 'astro/config'; +const legacyDirectoryIndexes = { + name: 'legacy-directory-indexes', + hooks: { + 'astro:server:setup': ({ server }) => { + server.middlewares.use((req, _res, next) => { + const pathname = new URL(req.url ?? '/', 'http://localhost').pathname; + if (pathname === '/') req.url = `/index.html${(req.url ?? '').slice(pathname.length)}`; + if (pathname === '/blog/') req.url = `/blog/index.html${(req.url ?? '').slice(pathname.length)}`; + next(); + }); + }, + }, +}; + export default defineConfig({ site: 'https://bytefuture.ai', output: 'static', + integrations: [legacyDirectoryIndexes], build: { // Emit /blog/.html as actual files, not /blog/.html/index.html. // This preserves every already-published ByteFuture Writings URL. diff --git a/sitemap.xml b/sitemap.xml index 742bf7b..33ec0f3 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -405,4 +405,24 @@ 2026-08-17 0.6 + + https://bytefuture.ai/blog/codex-multi-model-subagents.html + 2026-08-17 + 0.7 + + + https://bytefuture.ai/blog/codex-multi-model-subagents-zh.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/codex-multi-model-subagents-ja.html + 2026-08-17 + 0.6 + + + https://bytefuture.ai/blog/codex-multi-model-subagents-ko.html + 2026-08-17 + 0.6 + diff --git a/src/content/writings/en/codex-multi-model-subagents.md b/src/content/writings/en/codex-multi-model-subagents.md new file mode 100644 index 0000000..e472c35 --- /dev/null +++ b/src/content/writings/en/codex-multi-model-subagents.md @@ -0,0 +1,299 @@ +--- +slug: "codex-multi-model-subagents" +lang: "en" +title: "Orchestrate Multi-Model Subagents in Codex" +summary: "A detailed guide to routing Codex subagents by complexity, risk, and verifiability, with provider setup, role configuration, permission boundaries, a complete example, and a staged rollout plan." +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +Codex does not need to run every part of a large engineering task through one model. A capable main agent can interpret the goal, delegate bounded work to specialized subagents, and retain final responsibility for testing and acceptance. + +The useful pattern is a controlled loop: + +```text +目标 + → 主 Agent 拆解与路由 + → Subagent 在限定范围内执行 + → 测试与独立审查 + → 主 Agent 汇总和验收 +``` + +This avoids spending a flagship model on mechanical changes, makes parallel work possible, and separates implementation from review. The main agent decides whether to delegate, what context and permissions each task receives, and which checks must pass. + +## Main agent, subagents, and tools + +The main agent handles planning, dependencies, risk, routing, conflict resolution, tests, and final delivery. Its model should be reliable at judgment and correction, even if it does not write most of the code. + +Subagents work best on narrow, verifiable tasks: inspect `src/auth` without editing, add tests for one module, migrate a specified directory, extract APIs from official documentation, or compare two implementations. + +Tools provide access to files, code search, tests, browsers, MCP services, and Git. Model choice cannot compensate for excessive permissions or an unclear write scope. + +## Profiles are not agent roles + +A named Codex profile layers configuration onto a session. It does not by itself become a role that the main agent can select automatically. Multi-agent routing also needs a role description and delegation boundary. + +Codex may define roles through `[agents.]` entries and separate configuration files. These fields can change between versions. Check the installed version: + +```bash +codex --version +``` + +Use strict configuration validation so unsupported fields fail visibly: + +```bash +codex --strict-config +``` + +If the installed version rejects a field, follow its current OpenAI Docs and CLI help instead of disabling validation. + +## Configure a model provider + +Token Station can expose several models through one Responses API provider and API key. Add this base configuration to `~/.codex/config.toml`: + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +Provide the key through the environment: + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +PowerShell: + +```powershell +$env:TOKEN_STATION_API_KEY = "你的真实密钥" +``` + +Keep the provider ID, environment variable name, `/v1` base URL, and `wire_api = "responses"` consistent. Use complete Token Station model IDs, including prefixes such as `openai/`, `glm/`, or `google/`. + +## Define bounded agent roles + +The following structure illustrates a lead agent with four roles. Feature flags and agent fields may vary by Codex version, so validate it with `--strict-config` and current OpenAI Docs. + +```toml +[features] +multi_agent = true + +[agents] +max_threads = 4 +max_depth = 1 + +[agents.researcher] +description = "只读调查代码与文档,返回证据、文件位置和结论" +config_file = "agents/researcher.toml" + +[agents.implementer] +description = "在明确文件范围内实现功能,并运行指定测试" +config_file = "agents/implementer.toml" + +[agents.test_writer] +description = "补充测试和失败场景,不改变产品行为" +config_file = "agents/test-writer.toml" + +[agents.security_reviewer] +description = "只读审查高风险改动,给出可复现场景" +config_file = "agents/security-reviewer.toml" +``` + +Descriptions should state the role, boundaries, and expected output. “Help with coding” is too vague to route reliably. + +### Read-only researcher + +```toml +model = "openai/gpt-5.6-luna" +model_provider = "token_station" +model_reasoning_effort = "low" +sandbox_mode = "read-only" + +developer_instructions = """ +只调查指定范围。引用文件路径、行号或文档来源。 +不要修改文件,不要扩大任务范围。 +明确区分事实、推断和待验证事项。 +""" +``` + +### Implementer + +```toml +model = "openai/gpt-5.6-terra" +model_provider = "token_station" +model_reasoning_effort = "medium" +sandbox_mode = "workspace-write" + +developer_instructions = """ +只修改任务中明确列出的目录和文件。 +先阅读相邻代码和项目指令,再实现最小完整改动。 +运行指定测试,并报告修改文件、测试结果和遗留风险。 +""" +``` + +### Independent reviewer + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" +model_reasoning_effort = "high" +sandbox_mode = "read-only" + +developer_instructions = """ +独立审查实现,不沿用实现者的结论。 +只报告可操作、可复现的问题,并给出准确文件位置。 +重点检查权限、数据边界、错误处理和测试缺口。 +""" +``` + +Other models can replace these examples when their complete Token Station IDs are available. Test Responses API behavior, multi-turn tool calls, and context limits before enabling automatic routing. + +## Route by complexity, risk, and verifiability + +| Task | Useful model traits | Reason | +| --- | --- | --- | +| Requirements and architecture | Strong reasoning, high reliability | Early errors affect all later work | +| Renames and formatting | Fast and inexpensive | Mechanical and easy to verify | +| Multi-file implementation | Strong coding and context | Must track dependencies | +| Research | Fast, stable extraction | Coverage and evidence matter | +| Test generation | Reliable instruction following | Tests provide direct verification | +| Security review | Careful reasoning | False negatives and positives are costly | +| Final review | Different model from implementer | Reduces correlated mistakes | + +Keep cross-module decisions and high-risk authentication, permissions, migrations, payments, and deletion with a strong model and independent review. Fast models fit work that tests, type checks, or formatters can verify cheaply. Tasks that depend heavily on implicit conversation context may be safer with the main agent. + +## Write explicit routing rules + +Add concise rules to the project `AGENTS.md`: + +```markdown +当任务复杂、可并行或需要独立复核时,先判断是否需要 Subagent。 + +任务路由规则: +- 简单、机械、低风险工作交给 researcher 或快速角色; +- 批量代码实现交给 implementer; +- 外部资料调查交给 researcher,并要求给出来源; +- 测试补充交给 test_writer; +- 架构、安全、权限和最终验收由主 Agent 负责; +- 每个子任务必须包含明确范围、输出和验收标准; +- 不让两个可写 Agent 同时修改同一文件; +- Subagent 结果必须通过测试或独立检查; +- 小任务由主 Agent 直接完成,不为使用 Subagent 而拆分。 +``` + +## Validate every third-party model + +OpenAI-compatible APIs do not necessarily support every Codex behavior. Test each model in stages: plain text, accurate file reading, read-only search, a small temporary edit, correction after a test failure, permission and timeout errors, and the resulting Token Station activity record. + +One successful text response does not establish reliable agentic coding or tool use. + +## Complete example: file uploads + +Suppose the project needs image validation, size limits, object storage, and unit tests. The main agent can build this task graph: + +```text +主 Agent +├── Researcher:调查框架上传接口和对象存储 SDK +├── Implementer:实现上传服务和 API +├── Test Writer:编写格式、大小和异常场景测试 +└── Security Reviewer:检查路径穿越、MIME 欺骗和资源滥用 +``` + +Research task: + +```text +阅读项目使用的 Web 框架和对象存储 SDK 文档。 + +只返回: +1. 推荐的上传处理方式; +2. 流式处理与内存限制; +3. 官方建议的错误处理方式; +4. 相关接口名称和来源。 + +不要修改代码。 +``` + +Implementation task: + +```text +在 src/upload 范围内实现上传服务。 + +要求: +- 最大文件大小 10 MB; +- 只允许 JPEG、PNG 和 WebP; +- 不信任客户端提供的 Content-Type; +- 使用现有对象存储客户端; +- 不修改数据库结构; +- 完成后列出修改文件、测试结果和待验证事项。 +``` + +Test task: + +```text +为上传功能补充测试。 + +必须覆盖: +- 合法 JPEG; +- 超过大小限制; +- 扩展名和实际内容不一致; +- 空文件; +- 存储服务失败; +- 并发上传时文件名冲突。 +``` + +Security review: + +```text +只审查上传实现,不修改文件。 + +重点检查: +- 路径穿越; +- MIME 欺骗; +- 图片解析漏洞; +- 未限制的内存占用; +- 可预测文件名; +- 错误信息泄露。 + +所有结论必须给出文件位置和可复现场景。 +``` + +The main agent then inspects the diff, runs the full test suite, resolves conflicts, and makes the final security decision. + +## Common failure modes + +Do not create subagents for one-line work. Do not allow two writable agents to edit the same file. Treat “completed” as a claim until the main agent checks the diff and runs tests. + +Keep API keys in environment variables or a credential manager. Sending work to a third-party provider may transmit prompts and source context. Private projects should review retention, training use, storage location, compliance requirements, and directories that must not leave the environment. + +Cheaper tokens do not guarantee a lower total cost: + +```text +有效成本 = +调用成本 ++ 重试成本 ++ 主 Agent 复核成本 ++ 错误修改的修复成本 +``` + +Measure success rate, latency, retries, and human rework for each task class. + +## Roll out in stages + +Start with a read-only researcher. Add a fast worker for formatting, test scaffolds, and bounded replacements. Grant workspace write access only after tool use is stable. Add an independent reviewer, then introduce automatic routing based on observed task results. + +The mature design does not always choose the strongest or cheapest model. It selects an adequate model for each job while keeping critical decisions, permission control, and final quality with the main agent. + +## References + +- [OpenAI Docs: Codex Multi-agent](https://developers.openai.com/codex/multi-agent/) +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station model list](https://models.bytefuture.ai/models) +- [Token Station dashboard](https://models.bytefuture.ai/dashboard) diff --git a/src/content/writings/ja/codex-multi-model-subagents.md b/src/content/writings/ja/codex-multi-model-subagents.md new file mode 100644 index 0000000..4aed63d --- /dev/null +++ b/src/content/writings/ja/codex-multi-model-subagents.md @@ -0,0 +1,275 @@ +--- +slug: "codex-multi-model-subagents" +lang: "ja" +title: "Codexで複数モデルのSubagentを編成する" +summary: "Codexの主Agentが複雑さ、リスク、検証可能性に応じてSubagentを振り分ける方法を、Provider、役割、権限、実例、段階的な導入手順とともに解説します。" +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +大きな開発作業を1つのモデルだけで処理する必要はありません。強い主Agentが目的を理解し、境界の明確な作業を異なるモデルのSubagentへ委任し、最後のテストと受け入れを担当できます。 + +重要なのはAgentの数ではなく、制御できる流れです。 + +```text +目标 + → 主 Agent 拆解与路由 + → Subagent 在限定范围内执行 + → 测试与独立审查 + → 主 Agent 汇总和验收 +``` + +主Agentは計画、依存関係、リスク、ルーティング、競合解決、テスト、最終成果を担当します。Subagentには、特定モジュールのテスト、限定ディレクトリの移行、読み取り専用の調査など、入力と検証条件が明確な仕事を渡します。 + +## ProfileとAgentの役割を区別する + +Codexの名前付きprofileはセッションに設定を重ねる仕組みであり、主Agentが自動選択する役割そのものではありません。複数Agentのルーティングには、役割の説明と委任境界が必要です。 + +まずバージョンを確認します。 + +```bash +codex --version +``` + +未対応フィールドを見逃さないよう、厳格な設定検証を使います。 + +```bash +codex --strict-config +``` + +現在のバージョンが拒否するフィールドは、そのバージョンのOpenAI DocsとCLIヘルプに合わせてください。 + +## モデルProviderを設定する + +Token Stationでは1つのResponses API ProviderとAPI keyから複数モデルを利用できます。`~/.codex/config.toml`に追加します。 + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +環境変数でkeyを渡します。 + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +PowerShell: + +```powershell +$env:TOKEN_STATION_API_KEY = "你的真实密钥" +``` + +Provider ID、環境変数名、`/v1`までのBase URL、`wire_api = "responses"`を一致させます。モデルIDには`openai/`などの接頭辞を残します。 + +## Agentの役割を定義する + +次は4つの役割を登録する構成例です。feature flagやAgentフィールドはCodexのバージョンで変わる可能性があるため、`--strict-config`で検証してください。 + +```toml +[features] +multi_agent = true + +[agents] +max_threads = 4 +max_depth = 1 + +[agents.researcher] +description = "只读调查代码与文档,返回证据、文件位置和结论" +config_file = "agents/researcher.toml" + +[agents.implementer] +description = "在明确文件范围内实现功能,并运行指定测试" +config_file = "agents/implementer.toml" + +[agents.test_writer] +description = "补充测试和失败场景,不改变产品行为" +config_file = "agents/test-writer.toml" + +[agents.security_reviewer] +description = "只读审查高风险改动,给出可复现场景" +config_file = "agents/security-reviewer.toml" +``` + +`description`には役割、禁止事項、期待する出力を具体的に書きます。 + +### 読み取り専用Researcher + +```toml +model = "openai/gpt-5.6-luna" +model_provider = "token_station" +model_reasoning_effort = "low" +sandbox_mode = "read-only" + +developer_instructions = """ +只调查指定范围。引用文件路径、行号或文档来源。 +不要修改文件,不要扩大任务范围。 +明确区分事实、推断和待验证事项。 +""" +``` + +### Implementer + +```toml +model = "openai/gpt-5.6-terra" +model_provider = "token_station" +model_reasoning_effort = "medium" +sandbox_mode = "workspace-write" + +developer_instructions = """ +只修改任务中明确列出的目录和文件。 +先阅读相邻代码和项目指令,再实现最小完整改动。 +运行指定测试,并报告修改文件、测试结果和遗留风险。 +""" +``` + +### 独立Reviewer + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" +model_reasoning_effort = "high" +sandbox_mode = "read-only" + +developer_instructions = """ +独立审查实现,不沿用实现者的结论。 +只报告可操作、可复现的问题,并给出准确文件位置。 +重点检查权限、数据边界、错误处理和测试缺口。 +""" +``` + +別のモデルを使う場合はToken Stationの完全なIDを指定し、Responses API、複数回のツール呼び出し、コンテキスト制限を先に確認します。 + +## モデル選択の基準 + +要件分析、設計、認証、権限、移行、決済、削除は強いモデルと独立レビューに残します。リネーム、整形、テスト生成など、テストや型チェックで安く検証できる仕事は高速モデルに向いています。 + +判断軸は複雑さ、リスク、検証可能性、暗黙のコンテキスト依存です。会話履歴に強く依存する仕事は、委任による情報損失を避けるため主Agentが直接処理する方が安全です。 + +## ルーティング規則を書く + +プロジェクトの`AGENTS.md`に短く実行可能な規則を追加します。 + +```markdown +当任务复杂、可并行或需要独立复核时,先判断是否需要 Subagent。 + +任务路由规则: +- 简单、机械、低风险工作交给 researcher 或快速角色; +- 批量代码实现交给 implementer; +- 外部资料调查交给 researcher,并要求给出来源; +- 测试补充交给 test_writer; +- 架构、安全、权限和最终验收由主 Agent 负责; +- 每个子任务必须包含明确范围、输出和验收标准; +- 不让两个可写 Agent 同时修改同一文件; +- Subagent 结果必须通过测试或独立检查; +- 小任务由主 Agent 直接完成,不为使用 Subagent 而拆分。 +``` + +## 第三者モデルを段階的に検証する + +OpenAI互換APIでもCodexのすべての動作を保証するわけではありません。純粋な文章、正確なファイル参照、読み取り専用検索、小さな一時編集、テスト失敗後の修正、権限やタイムアウトの報告、Token Stationの履歴という順番で確認します。 + +## 完全な例:ファイルアップロード + +画像形式、サイズ制限、オブジェクトストレージ、単体テストを追加する場合、主Agentは次のタスクグラフを作れます。 + +```text +主 Agent +├── Researcher:调查框架上传接口和对象存储 SDK +├── Implementer:实现上传服务和 API +├── Test Writer:编写格式、大小和异常场景测试 +└── Security Reviewer:检查路径穿越、MIME 欺骗和资源滥用 +``` + +Researcher: + +```text +阅读项目使用的 Web 框架和对象存储 SDK 文档。 + +只返回: +1. 推荐的上传处理方式; +2. 流式处理与内存限制; +3. 官方建议的错误处理方式; +4. 相关接口名称和来源。 + +不要修改代码。 +``` + +Implementer: + +```text +在 src/upload 范围内实现上传服务。 + +要求: +- 最大文件大小 10 MB; +- 只允许 JPEG、PNG 和 WebP; +- 不信任客户端提供的 Content-Type; +- 使用现有对象存储客户端; +- 不修改数据库结构; +- 完成后列出修改文件、测试结果和待验证事项。 +``` + +Test Writer: + +```text +为上传功能补充测试。 + +必须覆盖: +- 合法 JPEG; +- 超过大小限制; +- 扩展名和实际内容不一致; +- 空文件; +- 存储服务失败; +- 并发上传时文件名冲突。 +``` + +Security Reviewer: + +```text +只审查上传实现,不修改文件。 + +重点检查: +- 路径穿越; +- MIME 欺骗; +- 图片解析漏洞; +- 未限制的内存占用; +- 可预测文件名; +- 错误信息泄露。 + +所有结论必须给出文件位置和可复现场景。 +``` + +最後に主Agentがdiff、全テスト、競合、セキュリティ判断を確認します。 + +## 失敗しやすい点 + +1行の変更にSubagentを作らないでください。複数の書き込みAgentに同じファイルを触らせず、「完了」という報告はdiffとテストで確認します。 + +API keyは環境変数や認証情報管理に保存します。第三者Providerへ送るプロンプトとコードについて、保持、学習利用、保存地域、コンプライアンス、外部送信禁止ディレクトリを確認してください。 + +安いモデルでも、再試行と手戻りで総コストが上がる場合があります。 + +```text +有效成本 = +调用成本 ++ 重试成本 ++ 主 Agent 复核成本 ++ 错误修改的修复成本 +``` + +最初は読み取り専用Researcherから始め、次に高速な作業Agent、書き込みAgent、独立Reviewerの順で追加します。実績データを集めてから自動ルーティングを有効にしてください。 + +## 参考資料 + +- [OpenAI Docs:Codex Multi-agent](https://developers.openai.com/codex/multi-agent/) +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Stationモデル一覧](https://models.bytefuture.ai/models) +- [Token Stationダッシュボード](https://models.bytefuture.ai/dashboard) diff --git a/src/content/writings/ko/codex-multi-model-subagents.md b/src/content/writings/ko/codex-multi-model-subagents.md new file mode 100644 index 0000000..f84bf9a --- /dev/null +++ b/src/content/writings/ko/codex-multi-model-subagents.md @@ -0,0 +1,275 @@ +--- +slug: "codex-multi-model-subagents" +lang: "ko" +title: "Codex에서 다중 모델 Subagent 구성하기" +summary: "Codex 주 Agent가 복잡도, 위험, 검증 가능성에 따라 Subagent를 배정하는 방법을 Provider 설정, 역할과 권한, 전체 사례, 단계별 도입 절차와 함께 설명합니다." +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +큰 개발 작업을 한 모델이 모두 처리할 필요는 없습니다. 신뢰도 높은 주 Agent가 목표를 이해하고 범위가 명확한 작업을 서로 다른 모델의 Subagent에 위임한 뒤 테스트와 최종 검수를 담당할 수 있습니다. + +핵심은 Agent 수가 아니라 통제 가능한 흐름입니다. + +```text +目标 + → 主 Agent 拆解与路由 + → Subagent 在限定范围内执行 + → 测试与独立审查 + → 主 Agent 汇总和验收 +``` + +주 Agent는 계획, 의존성, 위험, 라우팅, 충돌 해결, 테스트, 최종 결과를 책임집니다. Subagent에는 특정 모듈 테스트, 제한된 디렉터리 마이그레이션, 읽기 전용 조사처럼 입력과 검증 조건이 분명한 작업을 배정합니다. + +## Profile과 Agent 역할 구분 + +Codex의 이름 있는 profile은 세션에 설정을 겹쳐 적용하는 기능입니다. 주 Agent가 자동 선택하는 역할 자체는 아닙니다. 다중 Agent 라우팅에는 역할 설명과 위임 경계가 추가로 필요합니다. + +버전을 확인합니다. + +```bash +codex --version +``` + +지원하지 않는 필드를 놓치지 않도록 엄격한 설정 검증을 사용합니다. + +```bash +codex --strict-config +``` + +설치된 버전이 필드를 거부하면 해당 버전의 OpenAI Docs와 CLI 도움말을 따르세요. + +## 모델 Provider 설정 + +Token Station에서는 하나의 Responses API Provider와 API key로 여러 모델을 사용할 수 있습니다. `~/.codex/config.toml`에 추가합니다. + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +환경 변수로 key를 제공합니다. + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +PowerShell: + +```powershell +$env:TOKEN_STATION_API_KEY = "你的真实密钥" +``` + +Provider ID, 환경 변수 이름, `/v1`까지의 Base URL, `wire_api = "responses"`를 일치시키세요. 모델 ID에는 `openai/` 같은 제공자 접두사를 유지합니다. + +## Agent 역할 정의 + +다음은 네 역할을 등록하는 구성 예시입니다. feature flag와 Agent 필드는 Codex 버전에 따라 바뀔 수 있으므로 `--strict-config`로 검증하세요. + +```toml +[features] +multi_agent = true + +[agents] +max_threads = 4 +max_depth = 1 + +[agents.researcher] +description = "只读调查代码与文档,返回证据、文件位置和结论" +config_file = "agents/researcher.toml" + +[agents.implementer] +description = "在明确文件范围内实现功能,并运行指定测试" +config_file = "agents/implementer.toml" + +[agents.test_writer] +description = "补充测试和失败场景,不改变产品行为" +config_file = "agents/test-writer.toml" + +[agents.security_reviewer] +description = "只读审查高风险改动,给出可复现场景" +config_file = "agents/security-reviewer.toml" +``` + +`description`에는 역할, 금지 사항, 기대 출력을 구체적으로 적어야 합니다. + +### 읽기 전용 Researcher + +```toml +model = "openai/gpt-5.6-luna" +model_provider = "token_station" +model_reasoning_effort = "low" +sandbox_mode = "read-only" + +developer_instructions = """ +只调查指定范围。引用文件路径、行号或文档来源。 +不要修改文件,不要扩大任务范围。 +明确区分事实、推断和待验证事项。 +""" +``` + +### Implementer + +```toml +model = "openai/gpt-5.6-terra" +model_provider = "token_station" +model_reasoning_effort = "medium" +sandbox_mode = "workspace-write" + +developer_instructions = """ +只修改任务中明确列出的目录和文件。 +先阅读相邻代码和项目指令,再实现最小完整改动。 +运行指定测试,并报告修改文件、测试结果和遗留风险。 +""" +``` + +### 독립 Reviewer + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" +model_reasoning_effort = "high" +sandbox_mode = "read-only" + +developer_instructions = """ +独立审查实现,不沿用实现者的结论。 +只报告可操作、可复现的问题,并给出准确文件位置。 +重点检查权限、数据边界、错误处理和测试缺口。 +""" +``` + +다른 모델을 사용하려면 Token Station의 전체 ID를 지정하고 Responses API, 여러 차례의 도구 호출, 컨텍스트 제한을 먼저 검증하세요. + +## 모델 선택 기준 + +요구 사항 분석, 설계, 인증, 권한, 마이그레이션, 결제, 삭제는 강한 모델과 독립 검토에 맡깁니다. 이름 변경, 포맷 정리, 테스트 생성처럼 테스트나 타입 검사로 저렴하게 검증할 수 있는 작업은 빠른 모델에 적합합니다. + +판단 기준은 복잡도, 위험, 검증 가능성, 암묵적 컨텍스트 의존성입니다. 이전 대화에 크게 의존하는 작업은 위임 과정에서 정보가 손실될 수 있으므로 주 Agent가 직접 처리하는 편이 안전합니다. + +## 명확한 라우팅 규칙 작성 + +프로젝트의 `AGENTS.md`에 짧고 실행 가능한 규칙을 추가합니다. + +```markdown +当任务复杂、可并行或需要独立复核时,先判断是否需要 Subagent。 + +任务路由规则: +- 简单、机械、低风险工作交给 researcher 或快速角色; +- 批量代码实现交给 implementer; +- 外部资料调查交给 researcher,并要求给出来源; +- 测试补充交给 test_writer; +- 架构、安全、权限和最终验收由主 Agent 负责; +- 每个子任务必须包含明确范围、输出和验收标准; +- 不让两个可写 Agent 同时修改同一文件; +- Subagent 结果必须通过测试或独立检查; +- 小任务由主 Agent 直接完成,不为使用 Subagent 而拆分。 +``` + +## 서드파티 모델 단계별 검증 + +OpenAI 호환 API라고 해서 Codex의 모든 동작을 지원하는 것은 아닙니다. 순수 텍스트, 정확한 파일 인용, 읽기 전용 검색, 작은 임시 수정, 테스트 실패 후 수정, 권한과 타임아웃 보고, Token Station 활동 기록 순서로 확인하세요. + +## 전체 사례: 파일 업로드 + +이미지 형식, 크기 제한, 오브젝트 스토리지, 단위 테스트를 추가한다면 주 Agent는 다음 작업 그래프를 만들 수 있습니다. + +```text +主 Agent +├── Researcher:调查框架上传接口和对象存储 SDK +├── Implementer:实现上传服务和 API +├── Test Writer:编写格式、大小和异常场景测试 +└── Security Reviewer:检查路径穿越、MIME 欺骗和资源滥用 +``` + +Researcher: + +```text +阅读项目使用的 Web 框架和对象存储 SDK 文档。 + +只返回: +1. 推荐的上传处理方式; +2. 流式处理与内存限制; +3. 官方建议的错误处理方式; +4. 相关接口名称和来源。 + +不要修改代码。 +``` + +Implementer: + +```text +在 src/upload 范围内实现上传服务。 + +要求: +- 最大文件大小 10 MB; +- 只允许 JPEG、PNG 和 WebP; +- 不信任客户端提供的 Content-Type; +- 使用现有对象存储客户端; +- 不修改数据库结构; +- 完成后列出修改文件、测试结果和待验证事项。 +``` + +Test Writer: + +```text +为上传功能补充测试。 + +必须覆盖: +- 合法 JPEG; +- 超过大小限制; +- 扩展名和实际内容不一致; +- 空文件; +- 存储服务失败; +- 并发上传时文件名冲突。 +``` + +Security Reviewer: + +```text +只审查上传实现,不修改文件。 + +重点检查: +- 路径穿越; +- MIME 欺骗; +- 图片解析漏洞; +- 未限制的内存占用; +- 可预测文件名; +- 错误信息泄露。 + +所有结论必须给出文件位置和可复现场景。 +``` + +마지막으로 주 Agent가 diff, 전체 테스트, 충돌, 보안 결정을 확인합니다. + +## 자주 발생하는 문제 + +한 줄 수정에 Subagent를 만들지 마세요. 여러 쓰기 Agent가 같은 파일을 수정하게 하지 말고, “완료”라는 보고는 diff와 테스트로 검증하세요. + +API key는 환경 변수나 자격 증명 관리자에 저장합니다. 서드파티 Provider로 전송되는 프롬프트와 코드에 대해 보존, 학습 사용, 저장 지역, 규정 준수, 외부 전송 금지 디렉터리를 확인해야 합니다. + +저렴한 모델도 재시도와 재작업 때문에 총비용이 커질 수 있습니다. + +```text +有效成本 = +调用成本 ++ 重试成本 ++ 主 Agent 复核成本 ++ 错误修改的修复成本 +``` + +읽기 전용 Researcher부터 시작하고, 빠른 작업 Agent, 쓰기 Agent, 독립 Reviewer 순으로 추가하세요. 실제 성공률, 지연, 재시도, 사람의 재작업 시간을 기록한 뒤 자동 라우팅을 활성화합니다. + +## 참고 자료 + +- [OpenAI Docs: Codex Multi-agent](https://developers.openai.com/codex/multi-agent/) +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station 모델 목록](https://models.bytefuture.ai/models) +- [Token Station 대시보드](https://models.bytefuture.ai/dashboard) diff --git a/src/content/writings/zh/codex-multi-model-subagents.md b/src/content/writings/zh/codex-multi-model-subagents.md new file mode 100644 index 0000000..679e09d --- /dev/null +++ b/src/content/writings/zh/codex-multi-model-subagents.md @@ -0,0 +1,415 @@ +--- +slug: "codex-multi-model-subagents" +lang: "zh" +title: "用 Codex 编排多模型 Subagent:配置、路由与验收" +summary: "详细介绍如何让 Codex 主 Agent 按任务复杂度、风险和可验证性调度不同模型的 Subagent,包括 Provider、角色配置、权限边界、路由规则、完整案例和分阶段落地方法。" +category: "tutorial" +date: "2026-08-17" +cta: "https://models.bytefuture.ai/intro.html" +draft: false +--- + +很多人仍把 Codex 当作一个代码聊天框:提出问题,然后等待一个模型完成全部工作。面对较大的工程任务,更实用的方式是让能力较强的模型担任主 Agent,再把边界清晰的工作交给不同 Subagent。 + +例如,主 Agent 负责理解需求、拆解任务和最终验收;快速模型处理机械修改;编码模型完成批量实现;检索模型整理外部资料;另一个强模型独立审查高风险改动。 + +多模型工作流的重点不是同时运行更多模型,而是建立一条可控的链路: + +```text +目标 + → 主 Agent 拆解与路由 + → Subagent 在限定范围内执行 + → 测试与独立审查 + → 主 Agent 汇总和验收 +``` + +## 这种架构解决什么问题 + +模型在推理能力、速度、价格、上下文长度和工具调用稳定性上各有差异。把所有任务交给同一个旗舰模型虽然简单,但会产生几个问题: + +1. 简单任务占用昂贵的推理资源; +2. 大量机械修改拉高成本; +3. 单一模型的能力短板会影响全部环节; +4. 同一模型既实现又审查,容易忽略自己的错误; +5. 可以并行的工作被迫串行执行。 + +多模型 Subagent 架构把“选哪个模型”变成主 Agent 的调度决策。用户描述最终目标,主 Agent判断是否拆分、哪些任务可以并行、每项工作需要什么上下文和权限,以及结果必须通过哪些检查。 + +## 三层结构:主 Agent、Subagent 和工具 + +### 主 Agent:负责决策和最终质量 + +主 Agent 不一定编写最多代码,但应该使用整体能力较强、可靠性较高的模型。它负责: + +- 理解用户目标和仓库约束; +- 识别依赖关系和高风险环节; +- 将复杂目标拆成可验证的子任务; +- 为每个子任务选择角色和模型; +- 限制文件范围、工具和权限; +- 汇总结果并解决冲突; +- 运行测试并完成最终验收。 + +主 Agent 的价值主要来自规划、判断和纠错,而不是输出速度。 + +### Subagent:完成边界明确的任务 + +适合委派的任务通常有明确输入、范围和验收标准,例如: + +- 检查 `src/auth` 的会话校验逻辑,只报告可复现问题; +- 为一个模块补充单元测试; +- 将指定目录中的接口迁移到新调用方式; +- 阅读官方文档并提取相关 API; +- 比较两种实现方案,不修改文件; +- 在限定文件内完成批量类型标注。 + +“看看整个项目有什么问题”不是好的子任务。范围模糊时,Subagent 会自行猜测优先级,输出也很难验收。 + +### 工具层:与真实环境交互 + +模型负责推理,工具负责读取文件、搜索代码、运行测试、控制浏览器、访问 MCP 服务和执行 Git 命令。即使模型选择正确,如果 Subagent 获得过宽的工具权限或文件范围,工作流仍然不可靠。 + +## 先区分 Profile 和 Agent 角色 + +Codex 的命名 profile 用来为一次会话叠加配置,例如选择模型、Provider 或 sandbox。它本身不等于一个会被主 Agent 自动选择的角色。 + +真正的多 Agent 配置还需要角色描述和委派边界。当前版本的 Codex 可能通过 `[agents.]` 与独立配置文件定义角色;相关功能和字段仍可能随版本变化。配置后应使用本机版本验证,不要把示意代码当成永久不变的 schema。 + +先检查版本: + +```bash +codex --version +``` + +启动时可用 `--strict-config` 让 Codex 对无法识别的配置字段直接报错: + +```bash +codex --strict-config +``` + +如果某个字段在当前版本不受支持,应以该版本的 OpenAI Docs 和 CLI 帮助为准,而不是关闭严格检查继续运行。 + +## 第一步:配置模型 Provider + +通过 Token Station 使用多个模型时,所有模型可以共享一个 Responses API Provider 和一枚 API key。`~/.codex/config.toml` 的基础配置如下: + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" + +[model_providers.token_station] +name = "Token Station" +base_url = "https://bec.bytefuture.ai/v1" +env_key = "TOKEN_STATION_API_KEY" +wire_api = "responses" +``` + +密钥通过环境变量提供: + +```bash +export TOKEN_STATION_API_KEY='你的真实密钥' +``` + +PowerShell 写法: + +```powershell +$env:TOKEN_STATION_API_KEY = "你的真实密钥" +``` + +这里有四个必须保持一致的细节: + +- `model_provider` 与 `[model_providers.token_station]` 的 ID 一致; +- `env_key` 与实际环境变量名一致; +- `base_url` 保持在 `/v1`,不要重复添加 `/responses`; +- `wire_api` 使用 `"responses"`。 + +模型 ID 必须使用 Token Station 当前提供的完整值,例如 `openai/gpt-5.6-sol`。不要省略 `openai/`、`glm/`、`google/` 等提供方前缀。 + +## 第二步:定义不同职责的 Agent + +下面是一套详细的角色结构。具体的 feature flag、并发字段和 `config_file` 解析方式可能随 Codex 版本变化,因此请配合 `--strict-config` 和当前 OpenAI Docs 使用。 + +```toml +[features] +multi_agent = true + +[agents] +max_threads = 4 +max_depth = 1 + +[agents.researcher] +description = "只读调查代码与文档,返回证据、文件位置和结论" +config_file = "agents/researcher.toml" + +[agents.implementer] +description = "在明确文件范围内实现功能,并运行指定测试" +config_file = "agents/implementer.toml" + +[agents.test_writer] +description = "补充测试和失败场景,不改变产品行为" +config_file = "agents/test-writer.toml" + +[agents.security_reviewer] +description = "只读审查高风险改动,给出可复现场景" +config_file = "agents/security-reviewer.toml" +``` + +`description` 是路由的重要依据。它应该写明角色擅长什么、允许做什么以及输出形式,而不是只写“帮助编码”。 + +### 只读研究 Agent + +```toml +model = "openai/gpt-5.6-luna" +model_provider = "token_station" +model_reasoning_effort = "low" +sandbox_mode = "read-only" + +developer_instructions = """ +只调查指定范围。引用文件路径、行号或文档来源。 +不要修改文件,不要扩大任务范围。 +明确区分事实、推断和待验证事项。 +""" +``` + +### 代码实现 Agent + +```toml +model = "openai/gpt-5.6-terra" +model_provider = "token_station" +model_reasoning_effort = "medium" +sandbox_mode = "workspace-write" + +developer_instructions = """ +只修改任务中明确列出的目录和文件。 +先阅读相邻代码和项目指令,再实现最小完整改动。 +运行指定测试,并报告修改文件、测试结果和遗留风险。 +""" +``` + +### 独立审查 Agent + +```toml +model = "openai/gpt-5.6-sol" +model_provider = "token_station" +model_reasoning_effort = "high" +sandbox_mode = "read-only" + +developer_instructions = """ +独立审查实现,不沿用实现者的结论。 +只报告可操作、可复现的问题,并给出准确文件位置。 +重点检查权限、数据边界、错误处理和测试缺口。 +""" +``` + +如果要使用 GLM、Gemini 或其他模型,只需将角色文件中的 `model` 换成 Token Station 模型列表里的完整 ID。先验证目标模型是否稳定支持 Responses API、多轮工具调用和当前任务需要的上下文长度。 + +## 如何为任务选择模型 + +| 任务类型 | 适合的模型特点 | 原因 | +| --- | --- | --- | +| 需求分析、架构设计 | 强推理、高可靠性 | 错误决策会影响后续全部工作 | +| 文件重命名、格式整理 | 快速、低成本 | 工作机械且容易验证 | +| 批量代码实现 | 编码能力强、上下文充足 | 需要处理多个文件和依赖 | +| 搜索与资料归纳 | 速度快、信息提取稳定 | 重点是覆盖面和证据 | +| 测试生成 | 指令遵循稳定、代码能力好 | 输出可以通过测试验证 | +| 安全审查 | 强推理、谨慎 | 漏报和误报成本都较高 | +| 最终代码审查 | 与实现者不同的模型 | 降低同源偏差 | + +模型路由可以从四个维度判断。 + +### 复杂度 + +跨模块推理、需求取舍和冲突处理留给强模型。机械工作交给快速模型。 + +### 风险 + +认证、权限、数据库迁移、支付和数据删除属于高风险工作。它们需要更可靠的模型、收紧权限,并增加独立审查。 + +### 可验证性 + +越容易通过测试、类型检查或格式化工具验证的任务,越适合交给便宜、快速的模型。 + +### 上下文依赖 + +如果任务高度依赖此前讨论和大量隐含背景,委派可能造成上下文损失。主 Agent 直接完成往往更稳妥。 + +## 给主 Agent 写清楚路由规则 + +仅定义多个角色并不会自动产生良好分工。可以在项目的 `AGENTS.md` 中加入: + +```markdown +当任务复杂、可并行或需要独立复核时,先判断是否需要 Subagent。 + +任务路由规则: +- 简单、机械、低风险工作交给 researcher 或快速角色; +- 批量代码实现交给 implementer; +- 外部资料调查交给 researcher,并要求给出来源; +- 测试补充交给 test_writer; +- 架构、安全、权限和最终验收由主 Agent 负责; +- 每个子任务必须包含明确范围、输出和验收标准; +- 不让两个可写 Agent 同时修改同一文件; +- Subagent 结果必须通过测试或独立检查; +- 小任务由主 Agent 直接完成,不为使用 Subagent 而拆分。 +``` + +路由规则要短、明确、可以执行。过长的角色说明会挤占上下文,也容易产生互相冲突的优先级。 + +## 接入第三方模型后的验证顺序 + +“兼容 OpenAI API”不代表完整支持 Codex 所需的全部行为。第三方模型可能无法稳定处理工具参数、多轮工具结果、长上下文或控制指令。 + +每个新模型先按以下顺序测试: + +1. 回答一个纯文本问题; +2. 读取一个文件并准确引用位置; +3. 执行一次只读代码搜索; +4. 在临时文件中完成小改动; +5. 根据一次测试失败继续修正; +6. 正确报告超时、权限拒绝和工具错误; +7. 在 Token Station 控制台核对实际模型和请求状态。 + +只有这些操作稳定后,才把模型加入自动路由。不要用一次成功的文本回复推断它能可靠完成 agentic 编码任务。 + +## 完整案例:实现文件上传功能 + +假设需求是: + +> 为现有项目增加文件上传功能,支持图片格式检查、大小限制、对象存储和单元测试。 + +主 Agent 可以建立任务图: + +```text +主 Agent +├── Researcher:调查框架上传接口和对象存储 SDK +├── Implementer:实现上传服务和 API +├── Test Writer:编写格式、大小和异常场景测试 +└── Security Reviewer:检查路径穿越、MIME 欺骗和资源滥用 +``` + +### Researcher 的任务 + +```text +阅读项目使用的 Web 框架和对象存储 SDK 文档。 + +只返回: +1. 推荐的上传处理方式; +2. 流式处理与内存限制; +3. 官方建议的错误处理方式; +4. 相关接口名称和来源。 + +不要修改代码。 +``` + +### Implementer 的任务 + +```text +在 src/upload 范围内实现上传服务。 + +要求: +- 最大文件大小 10 MB; +- 只允许 JPEG、PNG 和 WebP; +- 不信任客户端提供的 Content-Type; +- 使用现有对象存储客户端; +- 不修改数据库结构; +- 完成后列出修改文件、测试结果和待验证事项。 +``` + +### Test Writer 的任务 + +```text +为上传功能补充测试。 + +必须覆盖: +- 合法 JPEG; +- 超过大小限制; +- 扩展名和实际内容不一致; +- 空文件; +- 存储服务失败; +- 并发上传时文件名冲突。 +``` + +### Security Reviewer 的任务 + +```text +只审查上传实现,不修改文件。 + +重点检查: +- 路径穿越; +- MIME 欺骗; +- 图片解析漏洞; +- 未限制的内存占用; +- 可预测文件名; +- 错误信息泄露。 + +所有结论必须给出文件位置和可复现场景。 +``` + +最后由主 Agent 检查实际 diff、运行完整测试、解决子任务冲突,并对安全问题作最终判断。多 Agent 的价值来自计划、执行、审查和验收形成闭环,而不是几个模型各自给出答案。 + +## 常见问题和风险 + +### 不要无条件创建 Subagent + +创建 Subagent 会产生上下文传递和沟通成本。适合拆分的任务通常可以并行、工作量较大、需要不同专业能力、需要独立复核,或有非常清晰的边界。 + +### 不要让多个可写 Agent 修改同一文件 + +按目录或模块划分写入范围。一个 Agent 实现、另一个只读审查;存在依赖的任务顺序执行;最终由主 Agent 统一整合。 + +### 主 Agent 不能盲目信任结果 + +Subagent 说“已完成”只代表它认为完成了。主 Agent 仍需检查 diff、运行测试、查看错误输出、确认没有越界修改,并验证结果是否满足原始需求。 + +### 保护 API key 和私有代码 + +API key 应通过环境变量、密钥管理系统或操作系统凭据存储提供。把任务交给第三方 Provider 时,提示词和代码上下文可能被发送到该服务。私有项目应先确认数据保留、训练使用、存储地区、企业合规要求和禁止外发的目录。 + +只向 Subagent 提供完成任务所需的最小上下文。 + +### 低价模型不一定降低总成本 + +如果便宜模型频繁失败、重试并由强模型返工,总成本可能更高。 + +```text +有效成本 = +调用成本 ++ 重试成本 ++ 主 Agent 复核成本 ++ 错误修改的修复成本 +``` + +应该记录每类任务的成功率、耗时、重试和返工情况,再调整路由,而不是只比较每百万 Token 的价格。 + +## 分阶段搭建 + +### 第一阶段:主 Agent 加只读研究 Agent + +先验证仓库搜索、文档调查和结构化汇报。只读权限降低了试错风险。 + +### 第二阶段:增加快速执行 Agent + +分配格式整理、测试样板、文档补全和明确范围内的批量替换,并要求工具验证。 + +### 第三阶段:增加代码实现 Agent + +确认工具调用和文件修改稳定后,再授予工作区写权限。写入范围应按目录或文件明确限制。 + +### 第四阶段:增加独立审查 Agent + +让不同模型分别承担实现和审查,比较它们发现问题的能力。 + +### 第五阶段:建立自动路由指标 + +记录成功率、延迟、Token 消耗、重试率和人工返工时间,逐步调整模型与任务的对应关系。 + +## 总结 + +成熟的多模型 Subagent 系统不会为每个任务都创建更多 Agent,也不会永远选择最强或最便宜的模型。它会根据复杂度、风险、可验证性和上下文依赖选择足够合适的执行者,并把关键决策、权限控制和最终质量留在主 Agent 手中。 + +先配置一个可靠的 Provider,再定义少量边界清晰的角色。用 `--strict-config` 检查当前 Codex 版本能否识别字段,从只读任务开始验证,最后再开放自动路由和写入权限。 + +## 参考资料 + +- [OpenAI Docs:Codex Multi-agent](https://developers.openai.com/codex/multi-agent/) +- [Token Station](https://models.bytefuture.ai/intro.html) +- [Token Station 模型列表](https://models.bytefuture.ai/models) +- [Token Station 控制台](https://models.bytefuture.ai/dashboard) From 7f652c72419ae636913f7a886b62fd3706ebe863 Mon Sep 17 00:00:00 2001 From: Takagi Date: Mon, 17 Aug 2026 18:09:08 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9configure-claude-code-app?= =?UTF-8?q?-with-cc-switch-and-token-station.md=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=20=E5=BC=80=E5=90=AF=E2=80=9C=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=98=A0=E5=B0=84=E2=80=9D=20=E4=B8=8E?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=B7=AF=E7=94=B1=E7=9A=84=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog/cc-switch-needs-model-mapping.png | Bin 0 -> 20350 bytes ...de-app-with-cc-switch-and-token-station.md | 185 +++++++++------- ...de-app-with-cc-switch-and-token-station.md | 204 +++++++++++------- ...de-app-with-cc-switch-and-token-station.md | 198 ++++++++++------- ...de-app-with-cc-switch-and-token-station.md | 193 ++++++++++------- 5 files changed, 475 insertions(+), 305 deletions(-) create mode 100644 blog/cc-switch-needs-model-mapping.png diff --git a/blog/cc-switch-needs-model-mapping.png b/blog/cc-switch-needs-model-mapping.png new file mode 100644 index 0000000000000000000000000000000000000000..1b1a76f646ffb6ceb2402b871d31ee55261fd96f GIT binary patch literal 20350 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 N(tv5Jlq*?={u8qQQOE!Q literal 0 HcmV?d00001 diff --git a/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md index a889ba5..c40c521 100644 --- a/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -1,65 +1,73 @@ --- slug: "configure-claude-code-app-with-cc-switch-and-token-station" lang: "en" -title: "Configure Token Station for the Claude Code App with CC Switch" -summary: "Create and enable a Token Station provider in CC Switch, reload the configuration in the Claude Code App, and verify the route with a real request and the Token Station activity log." +title: "Configure the Claude Code App with CC Switch and Token Station" +summary: "Configure a Token Station provider for the Claude Code App, enable model mapping and CC Switch local routing, then verify the complete route with a real request." category: "tutorial" date: "2026-08-17" cta: "https://models.bytefuture.ai/intro.html" draft: false --- -Switching the Claude Code App between its official service, Token Station, and other model services can require repeated configuration edits. CC Switch stores each connection as a separate provider and applies the selected provider for you. +CC Switch can store several Claude Code providers and switch between them without repeatedly editing configuration files. This guide connects the Claude Code App to Token Station, maps Claude's Sonnet, Opus, and Haiku roles to models available in Token Station, and routes requests through the local CC Switch service. -This guide configures Token Station for the Claude Code App through CC Switch, then verifies the route with a real request. - -> This guide is for CC Switch and the Claude Code App. Claude Code CLI starts differently and may read configuration from different locations, so use the dedicated CLI setup for the command-line tool. +> This guide is for the **Claude Code App** panel in CC Switch. Claude Desktop and the Claude Code CLI use different configuration paths. Do not apply their instructions to this setup. ## Before you start -You need: +Prepare: -- CC Switch and the Claude Code App installed -- A working Token Station API key -- Access or available credit for the target model +- CC Switch and the Claude Code App +- A valid Token Station API key +- Access or available credit for the models you plan to use -Open the [Token Station dashboard](https://models.bytefuture.ai/dashboard) and confirm your API key and the complete target model ID. Never expose the key in screenshots, chats, or public documents. +Open the [Token Station dashboard](https://models.bytefuture.ai/dashboard) and copy the complete model IDs. Keep the API key out of screenshots, chat messages, and version control. ## Configuration flow -The setup has five steps: +The complete setup is: 1. Create a Claude Code provider in CC Switch -2. Enter the Token Station URL, API key, and model ID -3. Save and enable the provider -4. Fully quit and reopen the Claude Code App -5. Send a request and confirm it in Token Station +2. Enter the Token Station endpoint and API key +3. Turn on **Needs model mapping** +4. Map Sonnet, Opus, and Haiku to Token Station model IDs +5. Enable the CC Switch routing service and Claude routing +6. Enable the provider and fully restart the Claude Code App +7. Send a request and verify it in Token Station -## Add Token Station to CC Switch +Skipping model mapping or local routing can leave the App on its previous service even when CC Switch shows Token Station as the current provider. -Button labels may vary between CC Switch versions, but the required values stay the same. +## Add the Token Station provider -### 1. Create a provider +Button labels can differ slightly between CC Switch releases, but the required settings are the same. -Open CC Switch, select **Claude Code**, and enter provider management. Click Add, New Provider, or the plus button. +### 1. Create a provider -Use a clear name: +Open CC Switch, select **Claude Code**, enter provider management, and click Add, New Provider, or the plus button. Give the provider a recognizable name: ```text Token Station ``` -If CC Switch asks for a provider type, choose Claude, Anthropic, or a custom Anthropic-compatible service. +If a provider type or API format is required, select Claude, Anthropic, or **Anthropic Messages (native)**. -### 2. Enter the connection values +### 2. Enter the connection settings | Field | Value | | --- | --- | -| Base URL | `https://models.bytefuture.ai` | +| Request URL / Base URL | `https://models.bytefuture.ai` | | API Key / Auth Token | Your Token Station API key | -| Model | Complete model ID shown by Token Station | +| API format | Anthropic Messages (native) | +| Needs model mapping | On | -If the interface expects environment variables, use: +
+ Token Station provider settings in CC Switch with an API key, request URL, Anthropic Messages format, and model mapping enabled +
Use the Token Station root URL and the native Anthropic Messages format.
+
+ +Do not append `/v1/messages` to the base URL. The client builds the request path, and duplicating it can cause a 404 response. + +If your CC Switch version displays environment variables, use: ```text ANTHROPIC_BASE_URL=https://models.bytefuture.ai @@ -67,105 +75,136 @@ ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> ANTHROPIC_MODEL=<完整模型 ID> ``` -Some CC Switch templates use `ANTHROPIC_API_KEY`. Follow the current template instead of setting several undocumented credential fields at once. +Some templates use `ANTHROPIC_API_KEY` instead of `ANTHROPIC_AUTH_TOKEN`. Follow the fields shown by your current template. Do not fill several undocumented credential fields at the same time. + +### 3. Turn on Needs model mapping -Do not append `/v1/messages` to the base URL. The client builds the Anthropic Messages API path, and a repeated path can return 404. +The **Needs model mapping** switch must be On. The Claude Code App requests models by Claude roles such as Sonnet, Opus, and Haiku. CC Switch must translate those roles into the full model IDs understood by Token Station. -The model ID must match Token Station exactly, including the provider prefix. For example: +
+ CC Switch provider form with the Needs model mapping option enabled +
Enable “Needs model mapping” before saving the Token Station provider.
+
+ +If this option is disabled, selecting a Claude role can send an unmapped model name and produce a model-not-found error, or the App may continue using an unintended route. + +## Configure model mapping + +Open the model mapping area for the Token Station provider and assign each Claude role to a complete Token Station model ID. A practical starting point is: + +| Claude role | Token Station model | +| --- | --- | +| Sonnet | `openai/gpt-5.6-terra` | +| Opus | `openai/gpt-5.6-sol` | +| Haiku | `openai/gpt-5.6-luna` | + +These IDs are examples. Model availability changes, so confirm the current IDs and your account access in Token Station before saving. Preserve the provider prefix, such as `openai/`: ```text openai/gpt-5.6-sol ``` -Do not replace it with the display name shown in the Claude Code App. +Sonnet is normally used for the default general-purpose role, Opus for more demanding work, and Haiku for faster or lighter tasks. You can map them differently according to cost, latency, and model availability. The important point is that every requested role resolves to a valid Token Station model. -### 3. Save and enable the provider +## Enable CC Switch local routing -Before saving, check that: +Model mapping is applied by the CC Switch service running on your computer. Enabling the provider alone is not enough. -- The base URL has no extra path or whitespace -- The API key has no leading or trailing whitespace -- The model ID includes its provider prefix -- Placeholder brackets and instructions were not copied as values +1. Open **CC Switch Settings → Routing** +2. Turn on **Show local routing switch on the home page** +3. Start or keep the routing master switch running +4. Enable **Claude** under routing +5. Return to the Claude Code panel and turn its local routing toggle On -Save the provider, find **Token Station** in the list, and click Enable, Apply, or Switch. Confirm that CC Switch marks it as the current provider. +
+ CC Switch routing settings with local routing running and Claude routing enabled +
Keep the routing service running, expose the home-page switch, and enable Claude routing.
+
-## Restart the Claude Code App +CC Switch must remain open while this route is in use. Quitting it stops the local gateway and the Claude Code App can no longer reach Token Station through this configuration. -An App process that is already running usually does not load a provider selected later. Fully quit it before reopening. +The active request path is: -### Windows +```text +Claude Code App + → CC Switch local routing + → model mapping + → Token Station + → selected model +``` -1. Close the Claude Code App window -2. Check the system tray for a background process -3. Select Quit if it is still running -4. Apply the provider in CC Switch and reopen the App +## Save, enable, and restart -### macOS +Before saving, confirm that the URL has no extra path, the API key has no surrounding whitespace, **Needs model mapping** is On, and every model ID includes its provider prefix. -1. Press `Command + Q` in the Claude Code App -2. Confirm that the process has quit -3. Apply the provider in CC Switch and reopen the App +Save the provider, select **Token Station**, and click Enable, Apply, or Switch. Then completely quit the Claude Code App and reopen it. Closing only the window may leave the process running with its old configuration. -Closing a window is not always the same as ending the process. Failure to restart after switching providers is the most common reason an update appears not to work. +On Windows, check the system tray and choose Quit if necessary. On macOS, use `Command + Q`. Keep CC Switch and its routing service running when you reopen the App. ## Verify the complete route -Create a conversation in the Claude Code App and send: +Start a new conversation in the Claude Code App and send: ```text 请只回复:Token Station 测试成功 ``` -After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard). Under `Recent Activity`, confirm: +After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard) and check `Recent Activity` or the request log. Confirm that: -- The new request appears -- Its time and status match -- The recorded model matches the CC Switch provider +- The new request appears at the expected time +- The request completed successfully +- The recorded model matches the role mapping in CC Switch -A response in the App plus a matching Token Station record proves that the route is active. A Current Provider label in CC Switch alone does not. +A response in the App and a matching Token Station record together prove that the complete route is active. The Current Provider label in CC Switch is not sufficient evidence by itself. -## Switch back +## Switch back to the original provider -Keep the original official provider instead of overwriting your only configuration. To restore it: - -1. Select the original provider in CC Switch -2. Click Apply or Switch -3. Fully quit the Claude Code App -4. Reopen it and send a test message +Keep the official provider instead of overwriting it. To restore it, select the original provider, click Apply or Switch, turn off the Token Station route if it is no longer needed, fully quit the Claude Code App, and reopen it. ## Troubleshooting ### The App still uses the old provider -Make sure the App process has ended, not just its window. Apply the Token Station provider again, then start the App. +Fully quit the App, apply the Token Station provider again, confirm local routing and Claude routing are On, then reopen the App. + +### Model mapping is disabled -### API key is missing +Edit the provider, enable **Needs model mapping**, and verify that Sonnet, Opus, and Haiku point to valid Token Station model IDs. Save and reapply the provider. -Check whether the current CC Switch template expects `ANTHROPIC_AUTH_TOKEN` or `ANTHROPIC_API_KEY`. After correcting the field, apply the provider again and restart the App. +### Local routing is off -### 401 or 403 response +Open **Settings → Routing**, start the routing service, enable Claude routing, and turn on the local routing switch in the Claude Code panel. -The key may be wrong, expired, padded with whitespace, or missing access and available credit for the target model. +### CC Switch is not running -### 404 response +The local gateway exists only while CC Switch is running. Reopen CC Switch, start routing, and retry the request. -Use `https://models.bytefuture.ai` as the base URL and remove manually added `/messages` or other repeated paths. +### API key is missing, or the response is 401 or 403 + +Check whether the template expects `ANTHROPIC_AUTH_TOKEN` or `ANTHROPIC_API_KEY`. Verify that the key is valid, contains no extra whitespace, and has access and credit for the selected model. + +### The response is 404 + +Use `https://models.bytefuture.ai` as the base URL and remove manually appended `/messages`, `/v1/messages`, or other repeated paths. ### Model not found or access denied -Copy the complete ID from Token Station. Do not infer it from the display name in the App. +Copy the complete model ID from Token Station and verify the corresponding Sonnet, Opus, or Haiku mapping. Do not infer an ID from the App's display name. ### The App responds, but Token Station has no record -The App may still use the original service. Check the current provider, confirm that the App restarted after the switch, and verify the Token Station account and time filter. +The request may still be using the original service. Check the active provider, model mapping, both routing switches, the App restart, the Token Station account, and the activity time filter. ## Security notes - Keep real API keys out of tutorial screenshots -- Do not commit CC Switch configuration or credentials to Git +- Do not commit CC Switch configuration files or credentials to Git - Revoke and replace a key immediately if it may have leaked -- Back up a working configuration before upgrading CC Switch or the Claude Code App +- Back up a working provider before upgrading CC Switch or the Claude Code App + +## Summary + +This setup depends on four parts working together: a Token Station provider, **Needs model mapping**, CC Switch local and Claude routing, and a complete restart of the Claude Code App. Verify the result in the Token Station activity log so you know which service and model handled the request. ## References diff --git a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md index cbd7c7b..908775d 100644 --- a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -1,63 +1,71 @@ --- slug: "configure-claude-code-app-with-cc-switch-and-token-station" lang: "ja" -title: "CC SwitchでClaude Code AppにToken Stationを設定する" -summary: "CC SwitchでToken Station Providerを作成して有効化し、Claude Code Appに設定を再読み込みさせ、実際のリクエストと利用履歴で経路を確認します。" +title: "CC Switch と Token Station で Claude Code App を設定する" +summary: "Claude Code App 用の Token Station Provider を作成し、モデルマッピング、CC Switch のローカルルーティング、Claude ルーティングを有効にして、実際のリクエストで経路全体を検証します。" category: "tutorial" date: "2026-08-17" cta: "https://models.bytefuture.ai/intro.html" draft: false --- -Claude Code Appを公式サービス、Token Station、ほかのモデルサービスの間で切り替えるたびに設定を編集するのは手間がかかります。CC Switchは接続情報を個別のProviderとして保存し、選択した設定を適用できます。 +CC Switch を使うと、複数の Claude Code Provider を保存し、設定ファイルを何度も手作業で変更せずにサービスを切り替えられます。本記事では Claude Code App を Token Station に接続し、Claude の Sonnet、Opus、Haiku ロールを Token Station で利用可能なモデルへ割り当て、CC Switch のローカルサービス経由でリクエストを転送します。 -ここではCC SwitchからClaude Code AppにToken Stationを設定し、実際のリクエストで経路を確認します。 +> 本記事は CC Switch の **Claude Code App** パネルを対象としています。Claude Desktop と Claude Code CLI は設定経路が異なるため、それらの手順をこの設定に流用しないでください。 -> このガイドはCC SwitchとClaude Code App向けです。Claude Code CLIは起動方法と設定元が異なるため、CLI用の手順を使ってください。 +## 準備するもの -## 事前準備 +- CC Switch と Claude Code App +- 有効な Token Station API Key +- 利用するモデルへのアクセス権または利用可能なクレジット -次のものを用意してください。 - -- CC SwitchとClaude Code App -- 利用可能なToken Station API key -- 対象モデルの利用権限または残高 - -[Token Stationダッシュボード](https://models.bytefuture.ai/dashboard)でAPI keyと完全なモデルIDを確認します。実際のkeyをスクリーンショット、チャット、公開文書に載せないでください。 +[Token Station ダッシュボード](https://models.bytefuture.ai/dashboard)を開き、完全なモデル ID を確認します。API Key をスクリーンショット、チャット、Git リポジトリに含めないでください。 ## 設定の流れ -1. CC SwitchでClaude Code Providerを作成する -2. Token StationのURL、API key、モデルIDを入力する -3. Providerを保存して有効にする -4. Claude Code Appを完全に終了して開き直す -5. リクエストを送り、Token Stationで記録を確認する +必要な手順は次のとおりです。 + +1. CC Switch で Claude Code Provider を作成する +2. Token Station の URL と API Key を入力する +3. **Needs model mapping** を有効にする +4. Sonnet、Opus、Haiku を Token Station のモデル ID に割り当てる +5. CC Switch のローカルルーティングと Claude ルーティングを有効にする +6. Provider を有効にし、Claude Code App を完全に再起動する +7. リクエストを送信し、Token Station で記録を確認する -## CC SwitchにToken Stationを追加する +モデルマッピングやローカルルーティングを省略すると、CC Switch に Token Station が現在の Provider と表示されていても、App が以前のサービスを使い続けることがあります。 -CC Switchのバージョンによってボタン名は異なりますが、必要な値は同じです。 +## Token Station Provider を追加する -### 1. Providerを作成する +CC Switch のバージョンによってボタン名は多少異なりますが、必要な設定値は同じです。 -CC Switchを開き、**Claude Code**を選択してProvider管理に移動します。追加、新規Provider、またはプラスボタンをクリックします。 +### 1. Provider を作成する -わかりやすい名前を付けます。 +CC Switch を開き、**Claude Code** を選択して Provider 管理画面に進みます。Add、New Provider、またはプラスボタンをクリックし、分かりやすい名前を付けます。 ```text Token Station ``` -種類を選ぶ場合はClaude、Anthropic、またはカスタムAnthropic互換サービスを使います。 +Provider の種類や API 形式を求められた場合は、Claude、Anthropic、または **Anthropic Messages(native)** を選択します。 ### 2. 接続情報を入力する -| フィールド | 値 | +| 項目 | 設定値 | | --- | --- | -| Base URL | `https://models.bytefuture.ai` | -| API Key / Auth Token | Token Station API key | -| Model | Token Stationに表示される完全なモデルID | +| Request URL / Base URL | `https://models.bytefuture.ai` | +| API Key / Auth Token | Token Station の API Key | +| API 形式 | Anthropic Messages(native) | +| Needs model mapping | 有効 | + +
+ API Key、リクエスト URL、Anthropic Messages 形式を設定し、モデルマッピングを有効にした CC Switch の Token Station Provider 設定 +
Token Station のルート URL と Anthropic Messages の native 形式を使用します。
+
+ +Base URL に `/v1/messages` を追加しないでください。クライアントがリクエストパスを生成するため、重複すると 404 になることがあります。 -環境変数を入力する画面では次を使います。 +環境変数が表示されるバージョンでは、次の値を使います。 ```text ANTHROPIC_BASE_URL=https://models.bytefuture.ai @@ -65,102 +73,138 @@ ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> ANTHROPIC_MODEL=<完整模型 ID> ``` -一部のCC Switchテンプレートは`ANTHROPIC_API_KEY`を使います。現在のテンプレートに従い、根拠のない複数の認証変数を同時に設定しないでください。 +一部のテンプレートは `ANTHROPIC_AUTH_TOKEN` ではなく `ANTHROPIC_API_KEY` を使います。現在のテンプレートに表示される項目に従い、不明な認証項目を同時に複数設定しないでください。 + +### 3. Needs model mapping を必ず有効にする + +**Needs model mapping** は必ず有効にします。Claude Code App は Sonnet、Opus、Haiku などの Claude ロールでモデルを要求します。CC Switch がこれらのロールを、Token Station が認識する完全なモデル ID に変換する必要があります。 + +
+ Needs model mapping オプションを有効にした CC Switch の Provider フォーム +
Token Station Provider を保存する前に「Needs model mapping」を有効にします。
+
+ +無効のままだと、マッピングされていない Claude ロール名が送信されてモデル未検出エラーになったり、App が意図しない経路を使い続けたりする可能性があります。 + +## モデルマッピングを設定する -Base URLに`/v1/messages`を追加しないでください。クライアントがAnthropic Messages APIのパスを組み立てるため、重複すると404になる場合があります。 +Token Station Provider のモデルマッピング画面を開き、各 Claude ロールに完全な Token Station モデル ID を割り当てます。最初は次の組み合わせを利用できます。 -モデルIDにはプロバイダー接頭辞を含めます。 +| Claude ロール | Token Station モデル | +| --- | --- | +| Sonnet | `openai/gpt-5.6-terra` | +| Opus | `openai/gpt-5.6-sol` | +| Haiku | `openai/gpt-5.6-luna` | + +これらは設定例です。利用できるモデルは変わるため、保存前に Token Station で現在のモデル ID とアカウント権限を確認してください。`openai/` のような Provider プレフィックスも含めます。 ```text openai/gpt-5.6-sol ``` -Claude Code Appの表示名で置き換えないでください。 +一般的には Sonnet を標準的な作業、Opus をより複雑な作業、Haiku を高速で軽量な作業に割り当てられます。価格、速度、可用性に応じて変更しても構いません。重要なのは、要求されるすべてのロールが有効な Token Station モデルへ解決されることです。 -### 3. 保存して有効化する +## CC Switch のローカルルーティングを有効にする -保存前に確認します。 +モデルマッピングは、ローカルで動作する CC Switch サービスによって適用されます。Provider を有効にするだけでは不十分です。 -- Base URLに余分なパスや空白がない -- API keyの前後に空白や改行がない -- モデルIDにプロバイダー接頭辞がある -- プレースホルダーの記号や説明文を値としてコピーしていない +1. **CC Switch Settings → Routing** を開く +2. **Show local routing switch on the home page** を有効にする +3. ルーティングのマスタースイッチを起動した状態にする +4. ルーティング対象の **Claude** を有効にする +5. Claude Code パネルへ戻り、ローカルルーティングのトグルを On にする -保存後、一覧の**Token Station**でEnable、Apply、またはSwitchをクリックし、現在のProviderになったことを確認します。 +
+ ローカルルーティングが稼働し、Claude ルーティングが有効になっている CC Switch のルーティング設定 +
ルーティングサービスを稼働させ、ホーム画面のスイッチと Claude ルーティングを有効にします。
+
-## Claude Code Appを再起動する +この経路を使う間は CC Switch を起動したままにしてください。CC Switch を終了するとローカルゲートウェイも停止し、この設定では Claude Code App から Token Station に接続できなくなります。 -すでに動いているAppは、あとから選択したProviderを通常は読み込みません。 +実際のリクエスト経路は次のとおりです。 -### Windows +```text +Claude Code App + → CC Switch local routing + → model mapping + → Token Station + → selected model +``` -1. Claude Code Appのウィンドウを閉じる -2. システムトレイにプロセスが残っていないか確認する -3. 残っていれば終了する -4. CC Switchで設定を適用してAppを開き直す +## 保存、有効化、再起動 -### macOS +保存前に、URL に余分なパスがないこと、API Key の前後に空白がないこと、**Needs model mapping** が有効なこと、各モデル ID に Provider プレフィックスが含まれることを確認します。 -1. Claude Code Appで`Command + Q`を押す -2. プロセスが終了したことを確認する -3. CC Switchで設定を適用してAppを開き直す +Provider を保存し、**Token Station** を選択して Enable、Apply、または Switch をクリックします。その後、Claude Code App を完全に終了してから再度開きます。ウィンドウを閉じただけでは、古い設定を保持したプロセスが残る場合があります。 -ウィンドウを閉じるだけではプロセスが終了しない場合があります。 +Windows ではシステムトレイを確認し、必要なら Quit を選びます。macOS では `Command + Q` を使います。App の再起動時も CC Switch とルーティングサービスを稼働させてください。 -## 経路を確認する +## 経路全体を検証する -Claude Code Appで新しい会話を作成し、次を送ります。 +Claude Code App で新しい会話を開始し、次を送信します。 ```text 请只回复:Token Station 测试成功 ``` -応答後、[Token Stationダッシュボード](https://models.bytefuture.ai/dashboard)の`Recent Activity`で確認します。 +応答後、[Token Station ダッシュボード](https://models.bytefuture.ai/dashboard)の `Recent Activity` またはリクエストログを開き、次を確認します。 -- 新しいリクエストがある -- 時刻と状態が一致する -- 記録されたモデルがCC Switchの設定と一致する +- 送信した時刻に新しいリクエストがある +- リクエストが正常に完了している +- 記録されたモデルが CC Switch のロールマッピングと一致する -Appの応答とToken Stationの記録がそろえば、経路が有効です。CC Switchの「現在のProvider」表示だけでは十分ではありません。 +App の応答と一致する Token Station の記録がそろって、初めて経路全体が有効だと確認できます。CC Switch の Current Provider 表示だけでは十分ではありません。 -## 元の設定に戻す +## 元の Provider に戻す -公式Providerを上書きせずに残しておきます。戻す場合は元のProviderを選び、ApplyまたはSwitchをクリックし、Claude Code Appを完全に終了して開き直します。 +公式 Provider は上書きせず残しておきます。戻す場合は元の Provider を選び、Apply または Switch をクリックします。Token Station の経路が不要なら関連するルーティングを無効にし、Claude Code App を完全に終了して再度開きます。 ## トラブルシューティング -### Appが古いProviderを使う +### App が古い Provider を使い続ける + +App を完全に終了し、Token Station Provider を再適用します。ローカルルーティングと Claude ルーティングがともに有効なことを確認してから App を開きます。 + +### モデルマッピングが無効になっている + +Provider を編集して **Needs model mapping** を有効にし、Sonnet、Opus、Haiku が有効な Token Station モデル ID を参照していることを確認します。保存後、Provider を再適用します。 + +### ローカルルーティングが無効になっている + +**Settings → Routing** でルーティングサービスを開始し、Claude ルーティングを有効にします。Claude Code パネルに戻り、ローカルルーティングのスイッチも有効にします。 + +### CC Switch が起動していない -ウィンドウだけでなくプロセスが終了したことを確認します。Token Station Providerをもう一度適用してAppを起動します。 +ローカルゲートウェイは CC Switch の稼働中だけ利用できます。CC Switch を開き、ルーティングを開始してから再試行します。 -### API keyがないと表示される +### API Key 不足、または 401 / 403 -テンプレートが`ANTHROPIC_AUTH_TOKEN`と`ANTHROPIC_API_KEY`のどちらを要求しているか確認します。修正後にProviderを再適用し、Appを再起動します。 +テンプレートが `ANTHROPIC_AUTH_TOKEN` と `ANTHROPIC_API_KEY` のどちらを要求しているか確認します。Key の有効性、余分な空白、対象モデルへの権限とクレジットも確認してください。 -### 401または403 +### 404 が返る -keyが無効、期限切れ、余分な空白を含む、または対象モデルの権限や残高がない可能性があります。 +Base URL を `https://models.bytefuture.ai` にし、手作業で追加した `/messages`、`/v1/messages`、その他の重複パスを削除します。 -### 404 +### モデルが見つからない、または権限がない -Base URLを`https://models.bytefuture.ai`にし、手動で追加した`/messages`などの重複パスを削除します。 +Token Station から完全なモデル ID をコピーし、対応する Sonnet、Opus、Haiku のマッピングを確認します。App の表示名から ID を推測しないでください。 -### モデルがない、または権限がない +### App は応答するが Token Station に記録がない -Token Stationから完全なIDをコピーします。Appの表示名から推測しないでください。 +元のサービスを使っている可能性があります。現在の Provider、モデルマッピング、2 つのルーティングスイッチ、App の再起動、Token Station のアカウントと時刻フィルターを順番に確認します。 -### Appは応答するがToken Stationに記録がない +## セキュリティ上の注意 -元のサービスを使っている可能性があります。現在のProvider、再起動、Token Stationのアカウントと時間フィルターを確認します。 +- 実際の API Key をチュートリアルの画像に含めない +- CC Switch の設定や認証情報を Git にコミットしない +- 漏えいの可能性があれば、すぐに Key を無効化して再発行する +- CC Switch や Claude Code App の更新前に、動作する Provider をバックアップする -## セキュリティ +## まとめ -- 実際のAPI keyをチュートリアルの画像に載せない -- CC Switchの設定や認証情報をGitにコミットしない -- 漏えいの可能性があればkeyを直ちに無効化して再発行する -- CC SwitchやClaude Code Appの更新前に設定をバックアップする +この設定には Token Station Provider、**Needs model mapping**、CC Switch のローカルルーティングと Claude ルーティング、Claude Code App の完全な再起動という 4 つの要素が必要です。最後に Token Station のアクティビティログを確認し、実際にどのサービスとモデルがリクエストを処理したかを確かめてください。 ## 参考資料 -- [Token Stationダッシュボード](https://models.bytefuture.ai/dashboard) -- [CC Switchプロジェクト](https://github.com/farion1231/cc-switch) +- [Token Station ダッシュボード](https://models.bytefuture.ai/dashboard) +- [CC Switch プロジェクト](https://github.com/farion1231/cc-switch) diff --git a/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md index a34d339..4ec9453 100644 --- a/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -1,61 +1,73 @@ --- slug: "configure-claude-code-app-with-cc-switch-and-token-station" lang: "ko" -title: "CC Switch로 Claude Code App에 Token Station 설정하기" -summary: "CC Switch에서 Token Station Provider를 만들고 활성화한 뒤 Claude Code App이 새 설정을 읽도록 재시작하고 실제 요청과 활동 기록으로 경로를 검증합니다." +title: "CC Switch와 Token Station으로 Claude Code App 설정하기" +summary: "Claude Code App용 Token Station Provider를 만들고 모델 매핑, CC Switch 로컬 라우팅, Claude 라우팅을 활성화한 뒤 실제 요청으로 전체 경로를 검증합니다." category: "tutorial" date: "2026-08-17" cta: "https://models.bytefuture.ai/intro.html" draft: false --- -Claude Code App을 공식 서비스, Token Station, 다른 모델 서비스 사이에서 전환할 때마다 설정을 직접 바꾸는 것은 번거롭습니다. CC Switch는 연결 정보를 개별 Provider로 저장하고 선택한 설정을 적용합니다. +CC Switch를 사용하면 여러 Claude Code Provider를 저장하고 설정 파일을 반복해서 직접 수정하지 않고도 서비스를 전환할 수 있습니다. 이 글에서는 Claude Code App을 Token Station에 연결하고 Claude의 Sonnet, Opus, Haiku 역할을 Token Station에서 사용할 수 있는 모델에 매핑한 다음, CC Switch의 로컬 서비스를 통해 요청을 전달합니다. -이 글에서는 CC Switch를 통해 Claude Code App에 Token Station을 설정하고 실제 요청으로 전체 경로를 검증합니다. +> 이 글은 CC Switch의 **Claude Code App** 패널을 대상으로 합니다. Claude Desktop과 Claude Code CLI는 설정 경로가 다르므로 해당 지침을 이 설정에 그대로 적용하지 마세요. -> 이 글은 CC Switch와 Claude Code App용입니다. Claude Code CLI는 실행 방식과 설정 위치가 다르므로 CLI 전용 절차를 사용하세요. +## 시작하기 전에 -## 준비 사항 +다음을 준비하세요. - CC Switch와 Claude Code App -- 사용 가능한 Token Station API key -- 대상 모델의 사용 권한 또는 잔액 +- 유효한 Token Station API Key +- 사용할 모델에 대한 접근 권한 또는 사용 가능한 크레딧 -[Token Station 대시보드](https://models.bytefuture.ai/dashboard)에서 API key와 전체 모델 ID를 확인하세요. 실제 key를 스크린샷, 채팅 또는 공개 문서에 표시하지 마세요. +[Token Station 대시보드](https://models.bytefuture.ai/dashboard)를 열고 전체 모델 ID를 확인합니다. API Key를 스크린샷, 채팅 메시지, Git 저장소에 노출하지 마세요. -## 설정 순서 +## 전체 설정 흐름 + +필요한 단계는 다음과 같습니다. 1. CC Switch에서 Claude Code Provider 만들기 -2. Token Station URL, API key, 모델 ID 입력하기 -3. Provider 저장 및 활성화하기 -4. Claude Code App 완전히 종료 후 다시 열기 -5. 요청을 보내고 Token Station 기록 확인하기 +2. Token Station URL과 API Key 입력하기 +3. **Needs model mapping** 켜기 +4. Sonnet, Opus, Haiku를 Token Station 모델 ID에 매핑하기 +5. CC Switch 로컬 라우팅과 Claude 라우팅 켜기 +6. Provider를 활성화하고 Claude Code App을 완전히 재시작하기 +7. 요청을 보내고 Token Station에서 기록 확인하기 -## CC Switch에 Token Station 추가 +모델 매핑이나 로컬 라우팅을 빠뜨리면 CC Switch에 Token Station이 현재 Provider로 표시되어도 App이 이전 서비스를 계속 사용할 수 있습니다. -CC Switch 버전에 따라 버튼 이름은 다를 수 있지만 필요한 값은 같습니다. +## Token Station Provider 추가하기 -### 1. Provider 만들기 +CC Switch 버전에 따라 버튼 이름이 조금 다를 수 있지만 필수 설정은 같습니다. -CC Switch에서 **Claude Code**를 선택하고 Provider 관리로 이동합니다. 추가, 새 Provider 또는 더하기 버튼을 누릅니다. +### 1. Provider 만들기 -이름은 다음처럼 설정할 수 있습니다. +CC Switch를 열고 **Claude Code**를 선택한 뒤 Provider 관리 화면으로 이동합니다. Add, New Provider 또는 더하기 버튼을 클릭하고 알아보기 쉬운 이름을 입력합니다. ```text Token Station ``` -유형을 선택해야 한다면 Claude, Anthropic 또는 사용자 지정 Anthropic 호환 서비스를 선택하세요. +Provider 유형이나 API 형식을 선택해야 한다면 Claude, Anthropic 또는 **Anthropic Messages (native)**를 선택합니다. -### 2. 연결 정보 입력 +### 2. 연결 설정 입력하기 -| 필드 | 값 | +| 항목 | 설정값 | | --- | --- | -| Base URL | `https://models.bytefuture.ai` | -| API Key / Auth Token | Token Station API key | -| Model | Token Station에 표시되는 전체 모델 ID | +| Request URL / Base URL | `https://models.bytefuture.ai` | +| API Key / Auth Token | Token Station API Key | +| API 형식 | Anthropic Messages (native) | +| Needs model mapping | 켬 | + +
+ API Key와 요청 URL, Anthropic Messages 형식을 입력하고 모델 매핑을 활성화한 CC Switch의 Token Station Provider 설정 +
Token Station 루트 URL과 Anthropic Messages native 형식을 사용합니다.
+
+ +Base URL 뒤에 `/v1/messages`를 추가하지 마세요. 클라이언트가 요청 경로를 생성하므로 중복 경로가 생기면 404가 반환될 수 있습니다. -환경 변수를 입력하는 화면에서는 다음을 사용합니다. +현재 CC Switch 버전이 환경 변수를 표시한다면 다음을 사용합니다. ```text ANTHROPIC_BASE_URL=https://models.bytefuture.ai @@ -63,100 +75,136 @@ ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> ANTHROPIC_MODEL=<完整模型 ID> ``` -일부 CC Switch 템플릿은 `ANTHROPIC_API_KEY`를 사용합니다. 현재 템플릿을 따르고 출처가 불분명한 여러 인증 변수를 동시에 설정하지 마세요. +일부 템플릿은 `ANTHROPIC_AUTH_TOKEN` 대신 `ANTHROPIC_API_KEY`를 사용합니다. 현재 템플릿에 표시된 필드를 따르고, 출처가 불분명한 여러 인증 필드를 동시에 입력하지 마세요. + +### 3. Needs model mapping을 반드시 켜기 + +**Needs model mapping**은 반드시 켜야 합니다. Claude Code App은 Sonnet, Opus, Haiku 같은 Claude 역할로 모델을 요청합니다. CC Switch가 이 역할을 Token Station이 인식하는 전체 모델 ID로 변환해야 합니다. + +
+ Needs model mapping 옵션을 활성화한 CC Switch Provider 양식 +
Token Station Provider를 저장하기 전에 “Needs model mapping”을 명확히 활성화합니다.
+
+ +이 옵션이 꺼져 있으면 매핑되지 않은 Claude 역할 이름이 그대로 전송되어 모델을 찾을 수 없다는 오류가 발생하거나 App이 의도하지 않은 경로를 계속 사용할 수 있습니다. + +## 모델 매핑 설정하기 -Base URL에 `/v1/messages`를 추가하지 마세요. 클라이언트가 Anthropic Messages API 경로를 구성하므로 중복 경로는 404를 일으킬 수 있습니다. +Token Station Provider의 모델 매핑 영역을 열고 각 Claude 역할에 전체 Token Station 모델 ID를 할당합니다. 다음 조합으로 시작할 수 있습니다. -모델 ID에는 제공자 접두사를 포함해야 합니다. +| Claude 역할 | Token Station 모델 | +| --- | --- | +| Sonnet | `openai/gpt-5.6-terra` | +| Opus | `openai/gpt-5.6-sol` | +| Haiku | `openai/gpt-5.6-luna` | + +위 ID는 설정 예시입니다. 사용 가능한 모델은 달라질 수 있으므로 저장하기 전에 Token Station에서 현재 모델 ID와 계정 권한을 확인하세요. `openai/` 같은 Provider 접두사도 반드시 포함해야 합니다. ```text openai/gpt-5.6-sol ``` -Claude Code App의 표시 이름으로 대체하지 마세요. +일반적으로 Sonnet은 기본 범용 작업, Opus는 더 복잡한 작업, Haiku는 빠르고 가벼운 작업에 사용할 수 있습니다. 비용, 지연 시간, 모델 가용성에 따라 다르게 매핑해도 됩니다. 중요한 점은 요청될 모든 역할이 유효한 Token Station 모델로 연결되어야 한다는 것입니다. -### 3. 저장하고 활성화하기 +## CC Switch 로컬 라우팅 활성화하기 -저장 전에 확인하세요. +모델 매핑은 컴퓨터에서 실행되는 CC Switch 서비스가 적용합니다. Provider만 활성화해서는 충분하지 않습니다. -- Base URL에 불필요한 경로나 공백이 없음 -- API key 앞뒤에 공백이나 줄바꿈이 없음 -- 모델 ID에 제공자 접두사가 있음 -- 자리표시자 기호와 설명을 값으로 복사하지 않음 +1. **CC Switch Settings → Routing** 열기 +2. **Show local routing switch on the home page** 켜기 +3. 라우팅 마스터 스위치를 실행 상태로 유지하기 +4. 라우팅 대상에서 **Claude** 활성화하기 +5. Claude Code 패널로 돌아가 로컬 라우팅 토글을 On으로 전환하기 -저장 후 목록의 **Token Station**에서 Enable, Apply 또는 Switch를 누르고 현재 Provider로 표시되는지 확인합니다. +
+ 로컬 라우팅이 실행 중이고 Claude 라우팅이 활성화된 CC Switch 라우팅 설정 +
라우팅 서비스를 실행 상태로 유지하고 홈 화면 스위치와 Claude 라우팅을 활성화합니다.
+
-## Claude Code App 재시작 +이 경로를 사용하는 동안 CC Switch를 계속 실행해야 합니다. CC Switch를 종료하면 로컬 게이트웨이가 중지되고 Claude Code App은 이 설정을 통해 Token Station에 접근할 수 없습니다. -이미 실행 중인 App은 나중에 선택한 Provider를 자동으로 읽지 않는 경우가 많습니다. +실제 요청 경로는 다음과 같습니다. -### Windows +```text +Claude Code App + → CC Switch local routing + → model mapping + → Token Station + → selected model +``` -1. Claude Code App 창 닫기 -2. 시스템 트레이에 프로세스가 남았는지 확인하기 -3. 남아 있으면 종료하기 -4. CC Switch에서 설정을 적용한 뒤 App 다시 열기 +## 저장, 활성화, 재시작 -### macOS +저장하기 전에 URL에 불필요한 경로가 없는지, API Key 앞뒤에 공백이 없는지, **Needs model mapping**이 켜져 있는지, 각 모델 ID에 Provider 접두사가 포함되어 있는지 확인합니다. -1. Claude Code App에서 `Command + Q` 누르기 -2. 프로세스가 끝났는지 확인하기 -3. CC Switch에서 설정을 적용한 뒤 App 다시 열기 +Provider를 저장하고 **Token Station**을 선택한 뒤 Enable, Apply 또는 Switch를 클릭합니다. 그런 다음 Claude Code App을 완전히 종료하고 다시 엽니다. 창만 닫으면 이전 설정을 유지하는 프로세스가 남을 수 있습니다. -창만 닫는 것으로 프로세스가 끝나지 않을 수 있습니다. +Windows에서는 시스템 트레이를 확인하고 필요하면 Quit을 선택합니다. macOS에서는 `Command + Q`를 사용합니다. App을 다시 열 때도 CC Switch와 라우팅 서비스가 실행 중이어야 합니다. -## 전체 경로 검증 +## 전체 경로 검증하기 -Claude Code App에서 새 대화를 만들고 다음을 보냅니다. +Claude Code App에서 새 대화를 시작하고 다음을 전송합니다. ```text 请只回复:Token Station 测试成功 ``` -응답 후 [Token Station 대시보드](https://models.bytefuture.ai/dashboard)의 `Recent Activity`에서 확인하세요. +응답을 받은 후 [Token Station 대시보드](https://models.bytefuture.ai/dashboard)의 `Recent Activity` 또는 요청 로그에서 다음을 확인합니다. -- 새 요청이 표시됨 -- 시간과 상태가 일치함 -- 기록된 모델이 CC Switch 설정과 일치함 +- 요청한 시간에 새 기록이 나타나는지 +- 요청이 성공적으로 완료되었는지 +- 기록된 모델이 CC Switch 역할 매핑과 일치하는지 -App 응답과 Token Station 기록이 모두 있어야 경로가 활성화된 것입니다. CC Switch의 현재 Provider 표시만으로는 충분하지 않습니다. +App의 응답과 일치하는 Token Station 기록이 모두 있어야 전체 경로가 활성화되었다고 판단할 수 있습니다. CC Switch의 Current Provider 표시만으로는 충분하지 않습니다. -## 이전 설정으로 돌아가기 +## 원래 Provider로 되돌리기 -공식 Provider를 덮어쓰지 말고 보관하세요. 복원할 때 원래 Provider를 선택하고 Apply 또는 Switch를 누른 뒤 Claude Code App을 완전히 종료하고 다시 엽니다. +공식 Provider를 덮어쓰지 말고 그대로 보관하세요. 복원하려면 원래 Provider를 선택하고 Apply 또는 Switch를 클릭합니다. Token Station 경로가 더 이상 필요 없다면 관련 라우팅을 끄고 Claude Code App을 완전히 종료한 다음 다시 엽니다. ## 문제 해결 -### App이 이전 Provider를 사용함 +### App이 이전 Provider를 계속 사용함 + +App을 완전히 종료하고 Token Station Provider를 다시 적용하세요. 로컬 라우팅과 Claude 라우팅이 모두 켜져 있는지 확인한 뒤 App을 다시 엽니다. + +### 모델 매핑이 꺼져 있음 + +Provider를 편집해 **Needs model mapping**을 켜고 Sonnet, Opus, Haiku가 유효한 Token Station 모델 ID를 가리키는지 확인합니다. 저장한 뒤 Provider를 다시 적용하세요. + +### 로컬 라우팅이 꺼져 있음 + +**Settings → Routing**에서 라우팅 서비스를 시작하고 Claude 라우팅을 활성화합니다. Claude Code 패널로 돌아가 로컬 라우팅 스위치도 켭니다. + +### CC Switch가 실행 중이 아님 -창뿐 아니라 프로세스가 끝났는지 확인하세요. Token Station Provider를 다시 적용한 뒤 App을 실행합니다. +로컬 게이트웨이는 CC Switch가 실행되는 동안에만 존재합니다. CC Switch를 다시 열고 라우팅을 시작한 뒤 요청을 재시도하세요. -### API key가 없다고 표시됨 +### API Key 누락 또는 401 / 403 -템플릿이 `ANTHROPIC_AUTH_TOKEN`과 `ANTHROPIC_API_KEY` 중 무엇을 요구하는지 확인하세요. 수정 후 Provider를 다시 적용하고 App을 재시작합니다. +템플릿이 `ANTHROPIC_AUTH_TOKEN`과 `ANTHROPIC_API_KEY` 중 어느 것을 요구하는지 확인합니다. Key의 유효성, 불필요한 공백, 대상 모델에 대한 권한과 크레딧도 확인하세요. -### 401 또는 403 +### 404 응답 -key가 잘못되었거나 만료되었거나 공백이 포함되었거나 대상 모델의 권한 또는 잔액이 없을 수 있습니다. +Base URL을 `https://models.bytefuture.ai`로 설정하고 직접 추가한 `/messages`, `/v1/messages` 또는 다른 중복 경로를 제거합니다. -### 404 +### 모델을 찾을 수 없거나 접근 권한이 없음 -Base URL을 `https://models.bytefuture.ai`로 설정하고 직접 추가한 `/messages` 같은 중복 경로를 제거하세요. +Token Station에서 전체 모델 ID를 복사하고 해당 Sonnet, Opus, Haiku 매핑을 확인합니다. App에 표시된 이름으로 ID를 추측하지 마세요. -### 모델을 찾을 수 없거나 권한이 없음 +### App은 응답하지만 Token Station에 기록이 없음 -Token Station에서 전체 ID를 복사하세요. App의 표시 이름으로 추측하지 마세요. +요청이 여전히 원래 서비스를 사용할 수 있습니다. 현재 Provider, 모델 매핑, 두 라우팅 스위치, App 재시작 여부, Token Station 계정과 활동 시간 필터를 차례로 확인합니다. -### App은 응답하지만 Token Station 기록이 없음 +## 보안 참고 사항 -원래 서비스를 계속 사용 중일 수 있습니다. 현재 Provider, App 재시작 여부, Token Station 계정과 시간 필터를 확인하세요. +- 실제 API Key를 튜토리얼 스크린샷에 포함하지 마세요 +- CC Switch 설정 파일이나 인증 정보를 Git에 커밋하지 마세요 +- 유출 가능성이 있으면 Key를 즉시 폐기하고 새로 발급하세요 +- CC Switch 또는 Claude Code App을 업그레이드하기 전에 작동하는 Provider를 백업하세요 -## 보안 +## 정리 -- 실제 API key를 튜토리얼 이미지에 표시하지 않기 -- CC Switch 설정이나 인증 정보를 Git에 커밋하지 않기 -- 유출 가능성이 있으면 key를 즉시 폐기하고 다시 발급하기 -- CC Switch나 Claude Code App 업데이트 전 설정 백업하기 +이 설정은 Token Station Provider, **Needs model mapping**, CC Switch 로컬 라우팅과 Claude 라우팅, Claude Code App의 완전한 재시작이라는 네 요소가 함께 작동해야 합니다. 마지막으로 Token Station 활동 로그에서 요청을 확인해 실제로 어떤 서비스와 모델이 처리했는지 검증하세요. ## 참고 자료 diff --git a/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md index e7f9c1f..dee76c7 100644 --- a/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -1,65 +1,73 @@ --- slug: "configure-claude-code-app-with-cc-switch-and-token-station" lang: "zh" -title: "用 CC Switch 为 Claude Code App 配置 Token Station" -summary: "介绍如何在 CC Switch 中创建并启用 Token Station Provider,让 Claude Code App 读取新配置,并通过真实请求和控制台记录完成验证。" +title: "用 CC Switch 和 Token Station 配置 Claude Code App" +summary: "为 Claude Code App 配置 Token Station Provider,开启模型映射、CC Switch 本地路由和 Claude 路由,再通过真实请求验证完整链路。" category: "tutorial" date: "2026-08-17" cta: "https://models.bytefuture.ai/intro.html" draft: false --- -当你需要在官方服务、Token Station 和其他模型服务之间切换时,反复修改 Claude Code App 的配置并不方便。CC Switch 可以将每组连接参数保存为独立 Provider,切换时直接应用对应配置。 +CC Switch 可以保存多组 Claude Code Provider,让你在不同服务之间切换,而不必反复手动修改配置文件。本文将 Claude Code App 接入 Token Station,把 Claude 的 Sonnet、Opus 和 Haiku 角色映射到 Token Station 中可用的模型,并通过 CC Switch 的本地服务转发请求。 -本文介绍如何通过 CC Switch 为 Claude Code App 配置 Token Station,并用一次真实请求完成端到端验证。 - -> 本文面向 CC Switch 与 Claude Code App。命令行版 Claude Code CLI 的启动方式和变量来源不同,请使用专门的 CLI 配置方法。 +> 本文针对 CC Switch 中的 **Claude Code App** 面板。Claude Desktop 和 Claude Code CLI 使用不同的配置路径,不要直接套用它们的步骤。 ## 开始之前 请准备: -- 已安装 CC Switch 和 Claude Code App; -- 一个可用的 Token Station API Key; -- 目标模型的调用权限或可用额度。 +- 已安装的 CC Switch 和 Claude Code App +- 有效的 Token Station API Key +- 目标模型的调用权限或可用额度 -打开 [Token Station 控制台](https://models.bytefuture.ai/dashboard),确认 API Key 和目标模型的完整 ID。不要在截图、聊天记录或公开文档中展示真实密钥。 +打开 [Token Station 控制台](https://models.bytefuture.ai/dashboard),复制模型的完整 ID。不要在截图、聊天记录或 Git 仓库中暴露真实 API Key。 -## 配置流程 +## 完整配置流程 -整个过程分为五步: +整个过程包括: -1. 在 CC Switch 中新建 Claude Code Provider; -2. 填写 Token Station 地址、API Key 和模型 ID; -3. 保存并启用该 Provider; -4. 完全退出并重新打开 Claude Code App; -5. 发起请求,并在 Token Station 控制台核对记录。 +1. 在 CC Switch 中新建 Claude Code Provider +2. 填写 Token Station 地址和 API Key +3. 开启 **需要模型映射(Needs model mapping)** +4. 将 Sonnet、Opus、Haiku 映射到 Token Station 模型 ID +5. 开启 CC Switch 本地路由和 Claude 路由 +6. 启用 Provider,并完全重启 Claude Code App +7. 发起真实请求,在 Token Station 中核对记录 -## 在 CC Switch 中添加 Token Station +如果遗漏模型映射或本地路由,即使 CC Switch 显示 Token Station 是当前 Provider,App 仍可能继续使用原来的服务。 -不同版本的 CC Switch 可能使用不同的按钮名称,但核心字段相同。 +## 添加 Token Station Provider -### 1. 新建 Provider +不同版本的 CC Switch 按钮名称可能略有不同,但核心设置一致。 -打开 CC Switch,选择 **Claude Code**,进入 Provider 管理页面。点击“添加”“新增 Provider”或加号按钮,创建一条配置。 +### 1. 新建 Provider -配置名称可以填写: +打开 CC Switch,选择 **Claude Code**,进入 Provider 管理页,然后点击“添加”“新建 Provider”或加号按钮。建议使用容易辨认的名称: ```text Token Station ``` -如果需要选择类型,使用 Claude、Anthropic 或自定义 Anthropic 兼容服务。 +如果界面要求选择 Provider 类型或 API 格式,请选择 Claude、Anthropic 或 **Anthropic Messages(原生)**。 -### 2. 填写连接参数 +### 2. 填写连接设置 | 字段 | 填写内容 | | --- | --- | -| Base URL | `https://models.bytefuture.ai` | +| 请求地址 / Base URL | `https://models.bytefuture.ai` | | API Key / Auth Token | 你的 Token Station API Key | -| Model | Token Station 显示的完整模型 ID | +| API 格式 | Anthropic Messages(原生) | +| 需要模型映射 | 开启 | -如果界面要求填写环境变量,使用: +
+ CC Switch 中的 Token Station Provider 设置,已填写 API Key、请求地址和 Anthropic Messages 格式,并开启模型映射 +
请求地址使用 Token Station 根地址,API 格式选择 Anthropic Messages(原生)。
+
+ +Base URL 后不要追加 `/v1/messages`。客户端会自动拼接请求路径,重复添加可能返回 404。 + +如果当前版本以环境变量方式展示配置,请使用: ```text ANTHROPIC_BASE_URL=https://models.bytefuture.ai @@ -67,105 +75,136 @@ ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> ANTHROPIC_MODEL=<完整模型 ID> ``` -部分 CC Switch 模板可能使用 `ANTHROPIC_API_KEY`。这时应按当前模板填写,不要同时设置多个来源不明的密钥字段。 +部分模板使用 `ANTHROPIC_API_KEY` 而不是 `ANTHROPIC_AUTH_TOKEN`。应以当前模板显示的字段为准,不要同时填写多个来源不明的密钥字段。 + +### 3. 必须开启“需要模型映射” -Base URL 不要手动添加 `/v1/messages`。客户端会根据 Anthropic Messages API 自动拼接请求路径,重复添加可能导致 404。 +**需要模型映射(Needs model mapping)** 必须保持开启。Claude Code App 会以 Sonnet、Opus、Haiku 等 Claude 角色请求模型,CC Switch 需要把这些角色转换成 Token Station 能识别的完整模型 ID。 -模型 ID 必须与 Token Station 显示的值完全一致,包括提供方前缀。例如: +
+ CC Switch Provider 表单中已开启需要模型映射选项 +
保存 Token Station Provider 前,明确开启“需要模型映射”。
+
+ +如果关闭该选项,Claude 角色名可能未经映射直接发出,导致“模型不存在”,也可能让 App 继续走非预期的链路。 + +## 配置模型映射 + +进入 Token Station Provider 的模型映射区域,把每个 Claude 角色指向一个完整的 Token Station 模型 ID。可以先使用下面这组配置: + +| Claude 角色 | Token Station 模型 | +| --- | --- | +| Sonnet | `openai/gpt-5.6-terra` | +| Opus | `openai/gpt-5.6-sol` | +| Haiku | `openai/gpt-5.6-luna` | + +这些 ID 是配置示例。模型供应会变化,保存前应在 Token Station 中确认当前可用的模型 ID 和账号权限。必须保留 `openai/` 这样的提供方前缀: ```text openai/gpt-5.6-sol ``` -不要使用 Claude Code App 中的展示名称代替完整 ID。 +通常可以让 Sonnet 承担默认通用任务,Opus 处理更复杂的工作,Haiku 处理更快、更轻的任务。你也可以根据价格、速度和模型可用性调整映射。关键是每个会被请求的角色都要解析到有效的 Token Station 模型。 -### 3. 保存并启用 +## 开启 CC Switch 本地路由 -保存前检查: +模型映射由本机运行的 CC Switch 服务完成,因此只启用 Provider 还不够。 -- Base URL 没有多余路径或空格; -- API Key 前后没有换行或空格; -- 模型 ID 包含完整提供方前缀; -- 示例中的尖括号和说明文字没有被复制进去。 +1. 打开 **CC Switch 设置 → 路由** +2. 开启 **在主页显示本地路由开关** +3. 启动并保持路由总开关运行 +4. 在路由启用列表中打开 **Claude** +5. 回到 Claude Code 面板,把本地路由开关切换为 On -保存后,在 Provider 列表中找到 **Token Station**,点击“启用”“应用”或“切换”。确认 CC Switch 显示它是当前配置。 +
+ CC Switch 路由设置,本地路由正在运行,并已启用 Claude 路由 +
保持路由服务运行,显示主页开关,并明确启用 Claude 路由。
+
-## 重启 Claude Code App +使用这条链路期间,CC Switch 必须保持运行。退出 CC Switch 会停止本地网关,Claude Code App 也就无法通过该配置访问 Token Station。 -已经运行的 App 通常不会自动读取后来切换的配置,因此需要完全退出后再启动。 +实际请求路径是: -### Windows +```text +Claude Code App + → CC Switch local routing + → model mapping + → Token Station + → selected model +``` -1. 关闭 Claude Code App 窗口; -2. 检查系统托盘,确认应用没有在后台运行; -3. 如仍在运行,选择“退出”; -4. 从 CC Switch 应用配置后重新打开 App。 +## 保存、启用并重启 -### macOS +保存前确认:地址没有多余路径,API Key 前后没有空格,**需要模型映射** 已开启,并且每个模型 ID 都包含提供方前缀。 -1. 在 Claude Code App 中按 `Command + Q`; -2. 确认程序已经退出; -3. 从 CC Switch 应用配置后重新打开 App。 +保存 Provider,选择 **Token Station**,点击“启用”“应用”或“切换”。然后完全退出 Claude Code App 再重新打开。只关闭窗口可能仍会保留使用旧配置的后台进程。 -只关闭窗口不一定会结束进程。切换 Provider 后不重启,是最常见的配置未生效原因。 +Windows 用户应检查系统托盘,必要时选择“退出”;macOS 用户可以使用 `Command + Q`。重新打开 App 时,CC Switch 和路由服务都要保持运行。 -## 端到端验证 +## 验证完整链路 -在 Claude Code App 中新建会话,发送: +在 Claude Code App 中新建会话并发送: ```text 请只回复:Token Station 测试成功 ``` -收到回复后,打开 [Token Station 控制台](https://models.bytefuture.ai/dashboard),在 `Recent Activity` 或调用记录页面检查: +收到回复后,打开 [Token Station 控制台](https://models.bytefuture.ai/dashboard),进入 `Recent Activity` 或请求记录,确认: -- 是否出现了刚才的请求; -- 请求时间和状态是否正确; -- 实际模型是否与 CC Switch 中的配置一致。 +- 对应时间出现了新请求 +- 请求状态为成功 +- 实际记录的模型与 CC Switch 中的角色映射一致 -只有 App 正常返回结果,并且控制台出现对应记录,才能证明请求确实经过 Token Station。CC Switch 界面显示“当前配置”本身并不是完整验证。 +App 正常回复,并且 Token Station 出现匹配记录,才能证明整条链路已经生效。仅看到 CC Switch 的“当前 Provider”标签并不足以完成验证。 -## 切回原配置 +## 切回原 Provider -建议保留原来的官方 Provider,不要直接覆盖唯一配置。需要恢复时: - -1. 在 CC Switch 中选择原 Provider; -2. 点击“应用”或“切换”; -3. 完全退出 Claude Code App; -4. 重新打开 App 并发送测试消息。 +建议保留官方 Provider,不要覆盖唯一配置。需要恢复时,选择原 Provider,点击“应用”或“切换”;如果不再需要 Token Station 路由,可以关闭相应开关;然后完全退出并重新打开 Claude Code App。 ## 常见问题 -### 已切换 Provider,但 App 仍使用旧配置 +### App 仍在使用旧 Provider + +完全退出 App,重新应用 Token Station Provider,确认本地路由和 Claude 路由均已开启,再启动 App。 -确认 App 已完全退出,而不是只关闭窗口。重新应用 Token Station Provider,再启动 App。 +### 没有开启模型映射 -### 提示缺少 API Key +编辑 Provider,开启 **需要模型映射**,并检查 Sonnet、Opus、Haiku 是否指向有效的 Token Station 模型 ID。保存后重新应用 Provider。 -检查 CC Switch 模板要求的是 `ANTHROPIC_AUTH_TOKEN` 还是 `ANTHROPIC_API_KEY`,并确认密钥字段没有留空。修改后重新应用 Provider 并重启 App。 +### 本地路由未开启 -### 返回 401 或 403 +进入 **设置 → 路由**,启动路由服务,开启 Claude 路由,再回到 Claude Code 面板打开本地路由开关。 -通常是 API Key 错误、已经失效、含有多余空格,或账户没有目标模型的权限和额度。 +### CC Switch 没有运行 + +本地网关只在 CC Switch 运行时存在。重新打开 CC Switch,启动路由服务后再测试。 + +### 提示缺少 API Key,或返回 401、403 + +检查模板要求的是 `ANTHROPIC_AUTH_TOKEN` 还是 `ANTHROPIC_API_KEY`。确认密钥有效、没有多余空格,并且账号对目标模型有权限和额度。 ### 返回 404 -检查 Base URL 是否为 `https://models.bytefuture.ai`,并确认没有手动添加 `/messages` 或其他重复路径。 +Base URL 应为 `https://models.bytefuture.ai`。删除手动追加的 `/messages`、`/v1/messages` 或其他重复路径。 ### 返回模型不存在或无权限 -复制 Token Station 模型列表中的完整 ID,不要根据 App 的展示名称推测模型 ID。 +从 Token Station 复制完整模型 ID,并检查对应的 Sonnet、Opus 或 Haiku 映射。不要根据 App 的展示名称猜测模型 ID。 ### App 有回复,但 Token Station 没有记录 -App 可能仍在使用原服务。检查当前 Provider、App 是否在切换后重启,以及控制台账号和筛选时间是否正确。 +请求可能仍在使用原服务。逐项检查当前 Provider、模型映射、两个路由开关、App 是否已重启,以及 Token Station 账号和活动记录的时间筛选。 ## 安全建议 -- 不要在教程截图中展示真实 API Key; -- 不要把 CC Switch 配置文件或密钥提交到 Git; -- 密钥疑似泄露时,立即在 Token Station 中撤销并重新生成; -- 升级 CC Switch 或 Claude Code App 前,备份当前可用配置。 +- 不要在教程截图中显示真实 API Key +- 不要把 CC Switch 配置文件或密钥提交到 Git +- 密钥疑似泄露时,立即撤销并重新生成 +- 升级 CC Switch 或 Claude Code App 前备份可用 Provider + +## 总结 + +这套配置需要四部分共同生效:Token Station Provider、**需要模型映射**、CC Switch 本地路由与 Claude 路由,以及 Claude Code App 的完全重启。最后应在 Token Station 活动记录中核对请求,确认实际处理请求的服务和模型。 ## 参考资料 From e9e1c739a7d1f9011dae5158a216cc3e25a689d9 Mon Sep 17 00:00:00 2001 From: Takagi Date: Mon, 17 Aug 2026 18:36:36 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=B0=86=E9=9D=9E=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=B8=AD=E7=9A=84=E4=B8=AD=E6=96=87=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E5=AF=B9=E5=BA=94=E8=AF=AD=E8=A8=80=EF=BC=9B?= =?UTF-8?q?=20Replace=20Chinese=20characters=20in=20non-Chinese=20document?= =?UTF-8?q?s=20with=20the=20corresponding=20language;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../en/codex-multi-model-subagents.md | 152 +++++++++--------- ...de-app-with-cc-switch-and-token-station.md | 6 +- ...gure-claude-code-cli-with-token-station.md | 11 +- .../configure-codex-app-with-token-station.md | 21 ++- .../configure-codex-cli-with-token-station.md | 20 +-- .../ja/codex-multi-model-subagents.md | 150 ++++++++--------- ...de-app-with-cc-switch-and-token-station.md | 6 +- ...gure-claude-code-cli-with-token-station.md | 11 +- .../configure-codex-app-with-token-station.md | 21 ++- .../configure-codex-cli-with-token-station.md | 20 +-- .../ko/codex-multi-model-subagents.md | 152 +++++++++--------- ...de-app-with-cc-switch-and-token-station.md | 6 +- ...gure-claude-code-cli-with-token-station.md | 11 +- .../configure-codex-app-with-token-station.md | 21 ++- .../configure-codex-cli-with-token-station.md | 20 +-- 15 files changed, 311 insertions(+), 317 deletions(-) diff --git a/src/content/writings/en/codex-multi-model-subagents.md b/src/content/writings/en/codex-multi-model-subagents.md index e472c35..e80e5f6 100644 --- a/src/content/writings/en/codex-multi-model-subagents.md +++ b/src/content/writings/en/codex-multi-model-subagents.md @@ -14,11 +14,11 @@ Codex does not need to run every part of a large engineering task through one mo The useful pattern is a controlled loop: ```text -目标 - → 主 Agent 拆解与路由 - → Subagent 在限定范围内执行 - → 测试与独立审查 - → 主 Agent 汇总和验收 +Goal + → Main agent decomposes and routes + → Subagent works within defined boundaries + → Tests and independent review + → Main agent integrates and accepts ``` This avoids spending a flagship model on mechanical changes, makes parallel work possible, and separates implementation from review. The main agent decides whether to delegate, what context and permissions each task receives, and which checks must pass. @@ -67,13 +67,13 @@ wire_api = "responses" Provide the key through the environment: ```bash -export TOKEN_STATION_API_KEY='你的真实密钥' +export TOKEN_STATION_API_KEY='YOUR_REAL_API_KEY' ``` PowerShell: ```powershell -$env:TOKEN_STATION_API_KEY = "你的真实密钥" +$env:TOKEN_STATION_API_KEY = "YOUR_REAL_API_KEY" ``` Keep the provider ID, environment variable name, `/v1` base URL, and `wire_api = "responses"` consistent. Use complete Token Station model IDs, including prefixes such as `openai/`, `glm/`, or `google/`. @@ -91,19 +91,19 @@ max_threads = 4 max_depth = 1 [agents.researcher] -description = "只读调查代码与文档,返回证据、文件位置和结论" +description = "Read-only investigation of code and docs; return evidence, file locations, and conclusions" config_file = "agents/researcher.toml" [agents.implementer] -description = "在明确文件范围内实现功能,并运行指定测试" +description = "Implement within an explicit file scope and run the specified tests" config_file = "agents/implementer.toml" [agents.test_writer] -description = "补充测试和失败场景,不改变产品行为" +description = "Add tests and failure cases without changing product behavior" config_file = "agents/test-writer.toml" [agents.security_reviewer] -description = "只读审查高风险改动,给出可复现场景" +description = "Review high-risk changes read-only and provide reproducible scenarios" config_file = "agents/security-reviewer.toml" ``` @@ -118,9 +118,9 @@ model_reasoning_effort = "low" sandbox_mode = "read-only" developer_instructions = """ -只调查指定范围。引用文件路径、行号或文档来源。 -不要修改文件,不要扩大任务范围。 -明确区分事实、推断和待验证事项。 +Investigate only the specified scope. Cite file paths, line numbers, or documentation sources. +Do not modify files or expand the task scope. +Clearly separate facts, inferences, and items that still need verification. """ ``` @@ -133,9 +133,9 @@ model_reasoning_effort = "medium" sandbox_mode = "workspace-write" developer_instructions = """ -只修改任务中明确列出的目录和文件。 -先阅读相邻代码和项目指令,再实现最小完整改动。 -运行指定测试,并报告修改文件、测试结果和遗留风险。 +Modify only the directories and files explicitly listed in the task. +Read adjacent code and project instructions before implementing the smallest complete change. +Run the specified tests and report changed files, results, and remaining risks. """ ``` @@ -148,9 +148,9 @@ model_reasoning_effort = "high" sandbox_mode = "read-only" developer_instructions = """ -独立审查实现,不沿用实现者的结论。 -只报告可操作、可复现的问题,并给出准确文件位置。 -重点检查权限、数据边界、错误处理和测试缺口。 +Review the implementation independently without adopting the implementer's conclusions. +Report only actionable, reproducible issues and include precise file locations. +Focus on permissions, data boundaries, error handling, and test gaps. """ ``` @@ -175,18 +175,18 @@ Keep cross-module decisions and high-risk authentication, permissions, migration Add concise rules to the project `AGENTS.md`: ```markdown -当任务复杂、可并行或需要独立复核时,先判断是否需要 Subagent。 - -任务路由规则: -- 简单、机械、低风险工作交给 researcher 或快速角色; -- 批量代码实现交给 implementer; -- 外部资料调查交给 researcher,并要求给出来源; -- 测试补充交给 test_writer; -- 架构、安全、权限和最终验收由主 Agent 负责; -- 每个子任务必须包含明确范围、输出和验收标准; -- 不让两个可写 Agent 同时修改同一文件; -- Subagent 结果必须通过测试或独立检查; -- 小任务由主 Agent 直接完成,不为使用 Subagent 而拆分。 +When a task is complex, parallelizable, or needs independent review, first decide whether subagents are necessary. + +Task routing rules: +- Give simple, mechanical, low-risk work to the researcher or a fast role. +- Give bulk code implementation to the implementer. +- Give external research to the researcher and require sources. +- Give test additions to the test_writer. +- Keep architecture, security, permissions, and final acceptance with the main agent. +- Every subtask must include a clear scope, output, and acceptance criteria. +- Do not let two write-capable agents modify the same file at the same time. +- Validate subagent results with tests or an independent check. +- Let the main agent handle small tasks directly; do not split work merely to use a subagent. ``` ## Validate every third-party model @@ -200,69 +200,69 @@ One successful text response does not establish reliable agentic coding or tool Suppose the project needs image validation, size limits, object storage, and unit tests. The main agent can build this task graph: ```text -主 Agent -├── Researcher:调查框架上传接口和对象存储 SDK -├── Implementer:实现上传服务和 API -├── Test Writer:编写格式、大小和异常场景测试 -└── Security Reviewer:检查路径穿越、MIME 欺骗和资源滥用 +Main agent +├── Researcher: investigate framework upload APIs and the object storage SDK +├── Implementer: implement the upload service and API +├── Test Writer: test formats, size limits, and failure cases +└── Security Reviewer: check path traversal, MIME spoofing, and resource abuse ``` Research task: ```text -阅读项目使用的 Web 框架和对象存储 SDK 文档。 +Read the documentation for the project's web framework and object storage SDK. -只返回: -1. 推荐的上传处理方式; -2. 流式处理与内存限制; -3. 官方建议的错误处理方式; -4. 相关接口名称和来源。 +Return only: +1. The recommended upload handling method. +2. Streaming and memory limits. +3. The officially recommended error handling approach. +4. Relevant API names and sources. -不要修改代码。 +Do not modify code. ``` Implementation task: ```text -在 src/upload 范围内实现上传服务。 - -要求: -- 最大文件大小 10 MB; -- 只允许 JPEG、PNG 和 WebP; -- 不信任客户端提供的 Content-Type; -- 使用现有对象存储客户端; -- 不修改数据库结构; -- 完成后列出修改文件、测试结果和待验证事项。 +Implement the upload service within src/upload. + +Requirements: +- Maximum file size: 10 MB. +- Allow only JPEG, PNG, and WebP. +- Do not trust the client-provided Content-Type. +- Use the existing object storage client. +- Do not change the database schema. +- When complete, list changed files, test results, and items still needing verification. ``` Test task: ```text -为上传功能补充测试。 - -必须覆盖: -- 合法 JPEG; -- 超过大小限制; -- 扩展名和实际内容不一致; -- 空文件; -- 存储服务失败; -- 并发上传时文件名冲突。 +Add tests for the upload feature. + +Cover all of the following: +- Valid JPEG. +- File over the size limit. +- Extension does not match the actual content. +- Empty file. +- Storage service failure. +- Filename collision during concurrent uploads. ``` Security review: ```text -只审查上传实现,不修改文件。 +Review only the upload implementation. Do not modify files. -重点检查: -- 路径穿越; -- MIME 欺骗; -- 图片解析漏洞; -- 未限制的内存占用; -- 可预测文件名; -- 错误信息泄露。 +Focus on: +- Path traversal. +- MIME spoofing. +- Image parser vulnerabilities. +- Unbounded memory use. +- Predictable filenames. +- Error message disclosure. -所有结论必须给出文件位置和可复现场景。 +Every finding must include a file location and a reproducible scenario. ``` The main agent then inspects the diff, runs the full test suite, resolves conflicts, and makes the final security decision. @@ -276,11 +276,11 @@ Keep API keys in environment variables or a credential manager. Sending work to Cheaper tokens do not guarantee a lower total cost: ```text -有效成本 = -调用成本 -+ 重试成本 -+ 主 Agent 复核成本 -+ 错误修改的修复成本 +Effective cost = +Invocation cost ++ Retry cost ++ Main-agent review cost ++ Cost of repairing incorrect changes ``` Measure success rate, latency, retries, and human rework for each task class. diff --git a/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md index c40c521..a12b4d5 100644 --- a/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -71,8 +71,8 @@ If your CC Switch version displays environment variables, use: ```text ANTHROPIC_BASE_URL=https://models.bytefuture.ai -ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> -ANTHROPIC_MODEL=<完整模型 ID> +ANTHROPIC_AUTH_TOKEN= +ANTHROPIC_MODEL= ``` Some templates use `ANTHROPIC_API_KEY` instead of `ANTHROPIC_AUTH_TOKEN`. Follow the fields shown by your current template. Do not fill several undocumented credential fields at the same time. @@ -146,7 +146,7 @@ On Windows, check the system tray and choose Quit if necessary. On macOS, use `C Start a new conversation in the Claude Code App and send: ```text -请只回复:Token Station 测试成功 +Reply only: Token Station test succeeded ``` After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard) and check `Recent Activity` or the request log. Confirm that: diff --git a/src/content/writings/en/configure-claude-code-cli-with-token-station.md b/src/content/writings/en/configure-claude-code-cli-with-token-station.md index b725136..0a10185 100644 --- a/src/content/writings/en/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/en/configure-claude-code-cli-with-token-station.md @@ -57,7 +57,7 @@ Run this in PowerShell: ```powershell $env:ANTHROPIC_BASE_URL = "https://models.bytefuture.ai" -$env:ANTHROPIC_AUTH_TOKEN = "你的真实密钥" +$env:ANTHROPIC_AUTH_TOKEN = "YOUR_REAL_API_KEY" $env:ANTHROPIC_MODEL = "openai/gpt-5.6-sol" claude @@ -78,7 +78,7 @@ To make new terminals load the configuration, run: [Environment]::SetEnvironmentVariable( "ANTHROPIC_AUTH_TOKEN", - "你的真实密钥", + "YOUR_REAL_API_KEY", "User" ) @@ -105,7 +105,7 @@ Run these commands in the terminal that will start Claude Code: ```bash export ANTHROPIC_BASE_URL='https://models.bytefuture.ai' -export ANTHROPIC_AUTH_TOKEN='你的真实密钥' +export ANTHROPIC_AUTH_TOKEN='YOUR_REAL_API_KEY' export ANTHROPIC_MODEL='openai/gpt-5.6-sol' claude @@ -138,13 +138,13 @@ source ~/.bashrc Starting Claude Code does not prove that the gateway is in use. Send a real request from the same terminal that contains the variables: ```bash -claude -p '请只回复:Token Station 测试成功' +claude -p 'Reply only: Token Station test succeeded' ``` In PowerShell: ```powershell -claude -p "请只回复:Token Station 测试成功" +claude -p "Reply only: Token Station test succeeded" ``` After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard). Check the request time, status, and model under `Recent Activity`. @@ -208,4 +208,3 @@ The current process may not be using Token Station. Check `ANTHROPIC_BASE_URL`, - [Token Station](https://models.bytefuture.ai/intro.html) - [Token Station model list](https://models.bytefuture.ai/models) - [Token Station dashboard](https://models.bytefuture.ai/dashboard) - diff --git a/src/content/writings/en/configure-codex-app-with-token-station.md b/src/content/writings/en/configure-codex-app-with-token-station.md index a6a975d..da91684 100644 --- a/src/content/writings/en/configure-codex-app-with-token-station.md +++ b/src/content/writings/en/configure-codex-app-with-token-station.md @@ -78,16 +78,16 @@ Save the variable, fully quit the Codex App, and reopen it. Closing the window m An App launched from the Dock, Finder, or Launchpad usually does not inherit an `export` from the current terminal. Add the key to the current graphical login session: ```bash -launchctl setenv TOKEN_STATION_API_KEY '你的真实密钥' +launchctl setenv TOKEN_STATION_API_KEY 'YOUR_REAL_API_KEY' ``` Check that the variable exists without printing the key: ```bash if [ -n "$(launchctl getenv TOKEN_STATION_API_KEY)" ]; then - echo "TOKEN_STATION_API_KEY 已设置" + echo "TOKEN_STATION_API_KEY is set" else - echo "TOKEN_STATION_API_KEY 未设置" + echo "TOKEN_STATION_API_KEY is not set" fi ``` @@ -104,16 +104,16 @@ launchctl unsetenv TOKEN_STATION_API_KEY Environment inheritance varies by distribution, desktop environment, and installation method. If you start Codex from a terminal, set the variable in that shell: ```bash -export TOKEN_STATION_API_KEY='你的真实密钥' +export TOKEN_STATION_API_KEY='YOUR_REAL_API_KEY' ``` Check that it exists: ```bash if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then - echo "TOKEN_STATION_API_KEY 已设置" + echo "TOKEN_STATION_API_KEY is set" else - echo "TOKEN_STATION_API_KEY 未设置" + echo "TOKEN_STATION_API_KEY is not set" fi ``` @@ -122,7 +122,7 @@ Start Codex from the same terminal. To load the key in new terminals, add the `e If the App starts from GNOME, KDE, or another desktop menu and the system uses a systemd user session, you can try: ```bash -systemctl --user set-environment TOKEN_STATION_API_KEY='你的真实密钥' +systemctl --user set-environment TOKEN_STATION_API_KEY='YOUR_REAL_API_KEY' ``` Fully quit and reopen the App. To clear the variable: @@ -140,7 +140,7 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY 3. Send: ```text - 请只回复:Token Station 测试成功 +Reply only: Token Station test succeeded ``` 4. Confirm that the App returns a normal response @@ -151,10 +151,10 @@ The route should be: ```text Codex App - → config.toml 中的 token_station provider +→ token_station provider in config.toml → TOKEN_STATION_API_KEY → https://bec.bytefuture.ai/v1/responses - → Token Station 调用记录 +→ Token Station request log ``` The connection is verified only when the App responds and Token Station shows the matching record. @@ -194,4 +194,3 @@ Check that `model_provider` matches the provider block name and that the App rel - [Token Station](https://models.bytefuture.ai/intro.html) - [Token Station dashboard](https://models.bytefuture.ai/dashboard) - diff --git a/src/content/writings/en/configure-codex-cli-with-token-station.md b/src/content/writings/en/configure-codex-cli-with-token-station.md index 7a6ed89..6b0e546 100644 --- a/src/content/writings/en/configure-codex-cli-with-token-station.md +++ b/src/content/writings/en/configure-codex-cli-with-token-station.md @@ -70,7 +70,7 @@ The examples use `openai/gpt-5.6-sol`. Use the complete current ID shown by Toke Run in PowerShell: ```powershell -$env:TOKEN_STATION_API_KEY = "你的真实密钥" +$env:TOKEN_STATION_API_KEY = "YOUR_REAL_API_KEY" ``` The variable applies only to the current PowerShell process and its child processes, which is useful for an initial test. @@ -80,7 +80,7 @@ The variable applies only to the current PowerShell process and its child proces ```powershell [Environment]::SetEnvironmentVariable( "TOKEN_STATION_API_KEY", - "你的真实密钥", + "YOUR_REAL_API_KEY", "User" ) ``` @@ -91,9 +91,9 @@ Check that the variable exists without printing the key: ```powershell if ([string]::IsNullOrEmpty($env:TOKEN_STATION_API_KEY)) { - "TOKEN_STATION_API_KEY 未设置" + "TOKEN_STATION_API_KEY is not set" } else { - "TOKEN_STATION_API_KEY 已设置" + "TOKEN_STATION_API_KEY is set" } ``` @@ -112,16 +112,16 @@ To remove it later: Set the variable in the terminal that will run Codex CLI: ```bash -export TOKEN_STATION_API_KEY='你的真实密钥' +export TOKEN_STATION_API_KEY='YOUR_REAL_API_KEY' ``` Check that it exists: ```bash if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then - echo "TOKEN_STATION_API_KEY 已设置" + echo "TOKEN_STATION_API_KEY is set" else - echo "TOKEN_STATION_API_KEY 未设置" + echo "TOKEN_STATION_API_KEY is not set" fi ``` @@ -148,19 +148,19 @@ codex Then send: ```text -请只回复:Token Station 测试成功 +Reply only: Token Station test succeeded ``` You can also run a non-interactive request: ```bash -codex exec '请只回复:Token Station 测试成功' +codex exec 'Reply only: Token Station test succeeded' ``` In PowerShell, use double quotes: ```powershell -codex exec "请只回复:Token Station 测试成功" +codex exec "Reply only: Token Station test succeeded" ``` After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard). Match the request time, status, and model under `Recent Activity`. diff --git a/src/content/writings/ja/codex-multi-model-subagents.md b/src/content/writings/ja/codex-multi-model-subagents.md index 4aed63d..a794438 100644 --- a/src/content/writings/ja/codex-multi-model-subagents.md +++ b/src/content/writings/ja/codex-multi-model-subagents.md @@ -14,11 +14,11 @@ draft: false 重要なのはAgentの数ではなく、制御できる流れです。 ```text -目标 - → 主 Agent 拆解与路由 - → Subagent 在限定范围内执行 - → 测试与独立审查 - → 主 Agent 汇总和验收 +目標 + → 主 Agent が分解してルーティング + → Subagent が限定された範囲で実行 + → テストと独立レビュー + → 主 Agent が統合して受け入れ ``` 主Agentは計画、依存関係、リスク、ルーティング、競合解決、テスト、最終成果を担当します。Subagentには、特定モジュールのテスト、限定ディレクトリの移行、読み取り専用の調査など、入力と検証条件が明確な仕事を渡します。 @@ -59,13 +59,13 @@ wire_api = "responses" 環境変数でkeyを渡します。 ```bash -export TOKEN_STATION_API_KEY='你的真实密钥' +export TOKEN_STATION_API_KEY='実際の API Key' ``` PowerShell: ```powershell -$env:TOKEN_STATION_API_KEY = "你的真实密钥" +$env:TOKEN_STATION_API_KEY = "実際の API Key" ``` Provider ID、環境変数名、`/v1`までのBase URL、`wire_api = "responses"`を一致させます。モデルIDには`openai/`などの接頭辞を残します。 @@ -83,19 +83,19 @@ max_threads = 4 max_depth = 1 [agents.researcher] -description = "只读调查代码与文档,返回证据、文件位置和结论" +description = "コードと文書を読み取り専用で調査し、証拠、ファイル位置、結論を返す" config_file = "agents/researcher.toml" [agents.implementer] -description = "在明确文件范围内实现功能,并运行指定测试" +description = "明示されたファイル範囲で機能を実装し、指定されたテストを実行する" config_file = "agents/implementer.toml" [agents.test_writer] -description = "补充测试和失败场景,不改变产品行为" +description = "製品の動作を変えずにテストと失敗シナリオを追加する" config_file = "agents/test-writer.toml" [agents.security_reviewer] -description = "只读审查高风险改动,给出可复现场景" +description = "高リスクの変更を読み取り専用でレビューし、再現可能なシナリオを示す" config_file = "agents/security-reviewer.toml" ``` @@ -110,9 +110,9 @@ model_reasoning_effort = "low" sandbox_mode = "read-only" developer_instructions = """ -只调查指定范围。引用文件路径、行号或文档来源。 -不要修改文件,不要扩大任务范围。 -明确区分事实、推断和待验证事项。 +指定された範囲だけを調査する。ファイルパス、行番号、または文書の出典を引用する。 +ファイルを変更せず、タスクの範囲を広げない。 +事実、推論、未検証事項を明確に区別する。 """ ``` @@ -125,9 +125,9 @@ model_reasoning_effort = "medium" sandbox_mode = "workspace-write" developer_instructions = """ -只修改任务中明确列出的目录和文件。 -先阅读相邻代码和项目指令,再实现最小完整改动。 -运行指定测试,并报告修改文件、测试结果和遗留风险。 +タスクで明示されたディレクトリとファイルだけを変更する。 +隣接するコードとプロジェクト指示を先に読み、最小限で完全な変更を実装する。 +指定されたテストを実行し、変更ファイル、テスト結果、残るリスクを報告する。 """ ``` @@ -140,9 +140,9 @@ model_reasoning_effort = "high" sandbox_mode = "read-only" developer_instructions = """ -独立审查实现,不沿用实现者的结论。 -只报告可操作、可复现的问题,并给出准确文件位置。 -重点检查权限、数据边界、错误处理和测试缺口。 +実装者の結論を引き継がず、独立して実装をレビューする。 +対処可能で再現可能な問題だけを報告し、正確なファイル位置を示す。 +権限、データ境界、エラー処理、テスト不足を重点的に確認する。 """ ``` @@ -159,18 +159,18 @@ developer_instructions = """ プロジェクトの`AGENTS.md`に短く実行可能な規則を追加します。 ```markdown -当任务复杂、可并行或需要独立复核时,先判断是否需要 Subagent。 - -任务路由规则: -- 简单、机械、低风险工作交给 researcher 或快速角色; -- 批量代码实现交给 implementer; -- 外部资料调查交给 researcher,并要求给出来源; -- 测试补充交给 test_writer; -- 架构、安全、权限和最终验收由主 Agent 负责; -- 每个子任务必须包含明确范围、输出和验收标准; -- 不让两个可写 Agent 同时修改同一文件; -- Subagent 结果必须通过测试或独立检查; -- 小任务由主 Agent 直接完成,不为使用 Subagent 而拆分。 +タスクが複雑、並列化可能、または独立レビューが必要な場合は、まず Subagent が必要か判断する。 + +タスクのルーティング規則: +- 単純、機械的、低リスクな作業は researcher または高速な役割に渡す。 +- 大量のコード実装は implementer に渡す。 +- 外部資料の調査は researcher に渡し、出典を必須にする。 +- テスト追加は test_writer に渡す。 +- アーキテクチャ、セキュリティ、権限、最終受け入れは主 Agent が担当する。 +- 各サブタスクに明確な範囲、出力、受け入れ基準を含める。 +- 書き込み可能な 2 つの Agent に同じファイルを同時変更させない。 +- Subagent の結果をテストまたは独立チェックで検証する。 +- 小さなタスクは主 Agent が直接処理し、Subagent を使うためだけに分割しない。 ``` ## 第三者モデルを段階的に検証する @@ -183,68 +183,68 @@ OpenAI互換APIでもCodexのすべての動作を保証するわけではあり ```text 主 Agent -├── Researcher:调查框架上传接口和对象存储 SDK -├── Implementer:实现上传服务和 API -├── Test Writer:编写格式、大小和异常场景测试 -└── Security Reviewer:检查路径穿越、MIME 欺骗和资源滥用 +├── Researcher:フレームワークのアップロード API とオブジェクトストレージ SDK を調査 +├── Implementer:アップロードサービスと API を実装 +├── Test Writer:形式、サイズ、異常シナリオのテストを作成 +└── Security Reviewer:パストラバーサル、MIME 偽装、リソース乱用を確認 ``` Researcher: ```text -阅读项目使用的 Web 框架和对象存储 SDK 文档。 +プロジェクトで使用している Web フレームワークとオブジェクトストレージ SDK の文書を読む。 -只返回: -1. 推荐的上传处理方式; -2. 流式处理与内存限制; -3. 官方建议的错误处理方式; -4. 相关接口名称和来源。 +次の内容だけを返す: +1. 推奨されるアップロード処理方法。 +2. ストリーミング処理とメモリ制限。 +3. 公式に推奨されるエラー処理方法。 +4. 関連する API 名と出典。 -不要修改代码。 +コードを変更しない。 ``` Implementer: ```text -在 src/upload 范围内实现上传服务。 - -要求: -- 最大文件大小 10 MB; -- 只允许 JPEG、PNG 和 WebP; -- 不信任客户端提供的 Content-Type; -- 使用现有对象存储客户端; -- 不修改数据库结构; -- 完成后列出修改文件、测试结果和待验证事项。 +src/upload の範囲でアップロードサービスを実装する。 + +要件: +- 最大ファイルサイズは 10 MB。 +- JPEG、PNG、WebP だけを許可する。 +- クライアントが提供する Content-Type を信頼しない。 +- 既存のオブジェクトストレージクライアントを使用する。 +- データベース構造を変更しない。 +- 完了後に変更ファイル、テスト結果、未検証事項を列挙する。 ``` Test Writer: ```text -为上传功能补充测试。 - -必须覆盖: -- 合法 JPEG; -- 超过大小限制; -- 扩展名和实际内容不一致; -- 空文件; -- 存储服务失败; -- 并发上传时文件名冲突。 +アップロード機能のテストを追加する。 + +必ず次を網羅する: +- 有効な JPEG。 +- サイズ制限を超えるファイル。 +- 拡張子と実際の内容が一致しないファイル。 +- 空ファイル。 +- ストレージサービスの障害。 +- 同時アップロード時のファイル名競合。 ``` Security Reviewer: ```text -只审查上传实现,不修改文件。 +アップロード実装だけをレビューし、ファイルは変更しない。 -重点检查: -- 路径穿越; -- MIME 欺骗; -- 图片解析漏洞; -- 未限制的内存占用; -- 可预测文件名; -- 错误信息泄露。 +重点的に確認する項目: +- パストラバーサル。 +- MIME 偽装。 +- 画像パーサーの脆弱性。 +- 制限のないメモリ使用。 +- 推測可能なファイル名。 +- エラーメッセージによる情報漏えい。 -所有结论必须给出文件位置和可复现场景。 +すべての指摘にファイル位置と再現可能なシナリオを含める。 ``` 最後に主Agentがdiff、全テスト、競合、セキュリティ判断を確認します。 @@ -258,11 +258,11 @@ API keyは環境変数や認証情報管理に保存します。第三者Provide 安いモデルでも、再試行と手戻りで総コストが上がる場合があります。 ```text -有效成本 = -调用成本 -+ 重试成本 -+ 主 Agent 复核成本 -+ 错误修改的修复成本 +実効コスト = +呼び出しコスト ++ 再試行コスト ++ 主 Agent のレビューコスト ++ 誤った変更の修正コスト ``` 最初は読み取り専用Researcherから始め、次に高速な作業Agent、書き込みAgent、独立Reviewerの順で追加します。実績データを集めてから自動ルーティングを有効にしてください。 diff --git a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md index 908775d..d345b55 100644 --- a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -69,8 +69,8 @@ Base URL に `/v1/messages` を追加しないでください。クライアン ```text ANTHROPIC_BASE_URL=https://models.bytefuture.ai -ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> -ANTHROPIC_MODEL=<完整模型 ID> +ANTHROPIC_AUTH_TOKEN= +ANTHROPIC_MODEL=<完全なモデル ID> ``` 一部のテンプレートは `ANTHROPIC_AUTH_TOKEN` ではなく `ANTHROPIC_API_KEY` を使います。現在のテンプレートに表示される項目に従い、不明な認証項目を同時に複数設定しないでください。 @@ -144,7 +144,7 @@ Windows ではシステムトレイを確認し、必要なら Quit を選びま Claude Code App で新しい会話を開始し、次を送信します。 ```text -请只回复:Token Station 测试成功 +「Token Station テスト成功」とだけ返信してください ``` 応答後、[Token Station ダッシュボード](https://models.bytefuture.ai/dashboard)の `Recent Activity` またはリクエストログを開き、次を確認します。 diff --git a/src/content/writings/ja/configure-claude-code-cli-with-token-station.md b/src/content/writings/ja/configure-claude-code-cli-with-token-station.md index eae09ff..570724a 100644 --- a/src/content/writings/ja/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/ja/configure-claude-code-cli-with-token-station.md @@ -57,7 +57,7 @@ PowerShellで実行します。 ```powershell $env:ANTHROPIC_BASE_URL = "https://models.bytefuture.ai" -$env:ANTHROPIC_AUTH_TOKEN = "你的真实密钥" +$env:ANTHROPIC_AUTH_TOKEN = "実際の API Key" $env:ANTHROPIC_MODEL = "openai/gpt-5.6-sol" claude @@ -78,7 +78,7 @@ claude [Environment]::SetEnvironmentVariable( "ANTHROPIC_AUTH_TOKEN", - "你的真实密钥", + "実際の API Key", "User" ) @@ -105,7 +105,7 @@ Claude Codeを起動するターミナルで実行します。 ```bash export ANTHROPIC_BASE_URL='https://models.bytefuture.ai' -export ANTHROPIC_AUTH_TOKEN='你的真实密钥' +export ANTHROPIC_AUTH_TOKEN='実際の API Key' export ANTHROPIC_MODEL='openai/gpt-5.6-sol' claude @@ -138,13 +138,13 @@ source ~/.bashrc Claude Codeが起動するだけでは、Token Stationを使っていることは確認できません。変数を設定したターミナルから実際のリクエストを送ります。 ```bash -claude -p '请只回复:Token Station 测试成功' +claude -p '「Token Station テスト成功」とだけ返信してください' ``` PowerShellでは次を使います。 ```powershell -claude -p "请只回复:Token Station 测试成功" +claude -p "「Token Station テスト成功」とだけ返信してください" ``` 応答を受け取ったら、[Token Stationダッシュボード](https://models.bytefuture.ai/dashboard)を開き、`Recent Activity`で時刻、状態、モデルを確認します。 @@ -208,4 +208,3 @@ Token Stationに表示される完全なモデルIDを使い、プロバイダ - [Token Station](https://models.bytefuture.ai/intro.html) - [Token Stationモデル一覧](https://models.bytefuture.ai/models) - [Token Stationダッシュボード](https://models.bytefuture.ai/dashboard) - diff --git a/src/content/writings/ja/configure-codex-app-with-token-station.md b/src/content/writings/ja/configure-codex-app-with-token-station.md index 2c96967..dd3981a 100644 --- a/src/content/writings/ja/configure-codex-app-with-token-station.md +++ b/src/content/writings/ja/configure-codex-app-with-token-station.md @@ -74,16 +74,16 @@ model_provider = "token_station" Dock、Finder、Launchpadから起動したAppは、現在のターミナルの`export`を通常は引き継ぎません。グラフィカルログインセッションに変数を追加します。 ```bash -launchctl setenv TOKEN_STATION_API_KEY '你的真实密钥' +launchctl setenv TOKEN_STATION_API_KEY '実際の API Key' ``` keyを表示せずに存在を確認します。 ```bash if [ -n "$(launchctl getenv TOKEN_STATION_API_KEY)" ]; then - echo "TOKEN_STATION_API_KEY 已设置" + echo "TOKEN_STATION_API_KEY は設定済みです" else - echo "TOKEN_STATION_API_KEY 未设置" + echo "TOKEN_STATION_API_KEY は未設定です" fi ``` @@ -100,16 +100,16 @@ launchctl unsetenv TOKEN_STATION_API_KEY 環境変数の継承方法はディストリビューション、デスクトップ環境、インストール方法によって異なります。ターミナルから起動する場合は、同じShellで設定します。 ```bash -export TOKEN_STATION_API_KEY='你的真实密钥' +export TOKEN_STATION_API_KEY='実際の API Key' ``` 存在を確認します。 ```bash if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then - echo "TOKEN_STATION_API_KEY 已设置" + echo "TOKEN_STATION_API_KEY は設定済みです" else - echo "TOKEN_STATION_API_KEY 未设置" + echo "TOKEN_STATION_API_KEY は未設定です" fi ``` @@ -118,7 +118,7 @@ fi GNOMEやKDEのメニューから起動し、systemdユーザーセッションを使う場合は次を試せます。 ```bash -systemctl --user set-environment TOKEN_STATION_API_KEY='你的真实密钥' +systemctl --user set-environment TOKEN_STATION_API_KEY='実際の API Key' ``` Appを完全に終了して開き直します。削除するには: @@ -136,7 +136,7 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY 3. 次を送る ```text - 请只回复:Token Station 测试成功 +「Token Station テスト成功」とだけ返信してください ``` 4. 正常な応答を確認する @@ -147,10 +147,10 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY ```text Codex App - → config.toml 中的 token_station provider +→ config.toml 内の token_station provider → TOKEN_STATION_API_KEY → https://bec.bytefuture.ai/v1/responses - → Token Station 调用记录 +→ Token Station の呼び出し履歴 ``` Appの応答とToken Stationの対応する記録がそろえば接続完了です。 @@ -188,4 +188,3 @@ Token Stationが提供する完全なモデルIDを使い、プロバイダー - [Token Station](https://models.bytefuture.ai/intro.html) - [Token Stationダッシュボード](https://models.bytefuture.ai/dashboard) - diff --git a/src/content/writings/ja/configure-codex-cli-with-token-station.md b/src/content/writings/ja/configure-codex-cli-with-token-station.md index c214e5e..3ed6f6e 100644 --- a/src/content/writings/ja/configure-codex-cli-with-token-station.md +++ b/src/content/writings/ja/configure-codex-cli-with-token-station.md @@ -68,7 +68,7 @@ wire_api = "responses" PowerShellで実行します。 ```powershell -$env:TOKEN_STATION_API_KEY = "你的真实密钥" +$env:TOKEN_STATION_API_KEY = "実際の API Key" ``` 変数は現在のPowerShellとその子プロセスだけで有効です。 @@ -78,7 +78,7 @@ $env:TOKEN_STATION_API_KEY = "你的真实密钥" ```powershell [Environment]::SetEnvironmentVariable( "TOKEN_STATION_API_KEY", - "你的真实密钥", + "実際の API Key", "User" ) ``` @@ -89,9 +89,9 @@ keyを表示せずに変数を確認します。 ```powershell if ([string]::IsNullOrEmpty($env:TOKEN_STATION_API_KEY)) { - "TOKEN_STATION_API_KEY 未设置" + "TOKEN_STATION_API_KEY は未設定です" } else { - "TOKEN_STATION_API_KEY 已设置" + "TOKEN_STATION_API_KEY は設定済みです" } ``` @@ -110,16 +110,16 @@ if ([string]::IsNullOrEmpty($env:TOKEN_STATION_API_KEY)) { Codex CLIを実行するターミナルで設定します。 ```bash -export TOKEN_STATION_API_KEY='你的真实密钥' +export TOKEN_STATION_API_KEY='実際の API Key' ``` 存在を確認します。 ```bash if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then - echo "TOKEN_STATION_API_KEY 已设置" + echo "TOKEN_STATION_API_KEY は設定済みです" else - echo "TOKEN_STATION_API_KEY 未设置" + echo "TOKEN_STATION_API_KEY は未設定です" fi ``` @@ -146,19 +146,19 @@ codex 起動後に送信します。 ```text -请只回复:Token Station 测试成功 +「Token Station テスト成功」とだけ返信してください ``` 非対話リクエストも実行できます。 ```bash -codex exec '请只回复:Token Station 测试成功' +codex exec '「Token Station テスト成功」とだけ返信してください' ``` PowerShellでは二重引用符を使います。 ```powershell -codex exec "请只回复:Token Station 测试成功" +codex exec "「Token Station テスト成功」とだけ返信してください" ``` 応答後、[Token Stationダッシュボード](https://models.bytefuture.ai/dashboard)の`Recent Activity`で時刻、状態、モデルを照合します。 diff --git a/src/content/writings/ko/codex-multi-model-subagents.md b/src/content/writings/ko/codex-multi-model-subagents.md index f84bf9a..d631f68 100644 --- a/src/content/writings/ko/codex-multi-model-subagents.md +++ b/src/content/writings/ko/codex-multi-model-subagents.md @@ -14,11 +14,11 @@ draft: false 핵심은 Agent 수가 아니라 통제 가능한 흐름입니다. ```text -目标 - → 主 Agent 拆解与路由 - → Subagent 在限定范围内执行 - → 测试与独立审查 - → 主 Agent 汇总和验收 +목표 + → 주 Agent가 작업을 분해하고 라우팅 + → Subagent가 제한된 범위에서 실행 + → 테스트와 독립 검토 + → 주 Agent가 통합하고 최종 승인 ``` 주 Agent는 계획, 의존성, 위험, 라우팅, 충돌 해결, 테스트, 최종 결과를 책임집니다. Subagent에는 특정 모듈 테스트, 제한된 디렉터리 마이그레이션, 읽기 전용 조사처럼 입력과 검증 조건이 분명한 작업을 배정합니다. @@ -59,13 +59,13 @@ wire_api = "responses" 환경 변수로 key를 제공합니다. ```bash -export TOKEN_STATION_API_KEY='你的真实密钥' +export TOKEN_STATION_API_KEY='실제 API Key' ``` PowerShell: ```powershell -$env:TOKEN_STATION_API_KEY = "你的真实密钥" +$env:TOKEN_STATION_API_KEY = "실제 API Key" ``` Provider ID, 환경 변수 이름, `/v1`까지의 Base URL, `wire_api = "responses"`를 일치시키세요. 모델 ID에는 `openai/` 같은 제공자 접두사를 유지합니다. @@ -83,19 +83,19 @@ max_threads = 4 max_depth = 1 [agents.researcher] -description = "只读调查代码与文档,返回证据、文件位置和结论" +description = "코드와 문서를 읽기 전용으로 조사하고 근거, 파일 위치, 결론을 반환" config_file = "agents/researcher.toml" [agents.implementer] -description = "在明确文件范围内实现功能,并运行指定测试" +description = "명확히 지정된 파일 범위에서 기능을 구현하고 지정된 테스트를 실행" config_file = "agents/implementer.toml" [agents.test_writer] -description = "补充测试和失败场景,不改变产品行为" +description = "제품 동작을 바꾸지 않고 테스트와 실패 시나리오를 추가" config_file = "agents/test-writer.toml" [agents.security_reviewer] -description = "只读审查高风险改动,给出可复现场景" +description = "고위험 변경을 읽기 전용으로 검토하고 재현 가능한 시나리오를 제시" config_file = "agents/security-reviewer.toml" ``` @@ -110,9 +110,9 @@ model_reasoning_effort = "low" sandbox_mode = "read-only" developer_instructions = """ -只调查指定范围。引用文件路径、行号或文档来源。 -不要修改文件,不要扩大任务范围。 -明确区分事实、推断和待验证事项。 +지정된 범위만 조사하세요. 파일 경로, 줄 번호 또는 문서 출처를 인용하세요. +파일을 수정하거나 작업 범위를 확대하지 마세요. +사실, 추론, 추가 검증이 필요한 항목을 명확히 구분하세요. """ ``` @@ -125,9 +125,9 @@ model_reasoning_effort = "medium" sandbox_mode = "workspace-write" developer_instructions = """ -只修改任务中明确列出的目录和文件。 -先阅读相邻代码和项目指令,再实现最小完整改动。 -运行指定测试,并报告修改文件、测试结果和遗留风险。 +작업에 명시된 디렉터리와 파일만 수정하세요. +인접 코드와 프로젝트 지침을 먼저 읽고 최소한의 완전한 변경을 구현하세요. +지정된 테스트를 실행하고 변경 파일, 테스트 결과, 남은 위험을 보고하세요. """ ``` @@ -140,9 +140,9 @@ model_reasoning_effort = "high" sandbox_mode = "read-only" developer_instructions = """ -独立审查实现,不沿用实现者的结论。 -只报告可操作、可复现的问题,并给出准确文件位置。 -重点检查权限、数据边界、错误处理和测试缺口。 +구현자의 결론을 그대로 따르지 말고 독립적으로 구현을 검토하세요. +조치 가능하고 재현 가능한 문제만 보고하며 정확한 파일 위치를 제시하세요. +권한, 데이터 경계, 오류 처리, 테스트 누락을 중점적으로 확인하세요. """ ``` @@ -159,18 +159,18 @@ developer_instructions = """ 프로젝트의 `AGENTS.md`에 짧고 실행 가능한 규칙을 추가합니다. ```markdown -当任务复杂、可并行或需要独立复核时,先判断是否需要 Subagent。 - -任务路由规则: -- 简单、机械、低风险工作交给 researcher 或快速角色; -- 批量代码实现交给 implementer; -- 外部资料调查交给 researcher,并要求给出来源; -- 测试补充交给 test_writer; -- 架构、安全、权限和最终验收由主 Agent 负责; -- 每个子任务必须包含明确范围、输出和验收标准; -- 不让两个可写 Agent 同时修改同一文件; -- Subagent 结果必须通过测试或独立检查; -- 小任务由主 Agent 直接完成,不为使用 Subagent 而拆分。 +작업이 복잡하거나 병렬화할 수 있거나 독립 검토가 필요하면 먼저 Subagent가 필요한지 판단하세요. + +작업 라우팅 규칙: +- 단순하고 기계적이며 위험이 낮은 작업은 researcher 또는 빠른 역할에 맡기세요. +- 대량 코드 구현은 implementer에 맡기세요. +- 외부 자료 조사는 researcher에 맡기고 출처를 요구하세요. +- 테스트 추가는 test_writer에 맡기세요. +- 아키텍처, 보안, 권한, 최종 승인은 주 Agent가 담당하세요. +- 각 하위 작업에는 명확한 범위, 결과물, 승인 기준이 있어야 합니다. +- 쓰기 권한이 있는 두 Agent가 같은 파일을 동시에 수정하지 않게 하세요. +- Subagent 결과는 테스트 또는 독립 검토로 검증하세요. +- 작은 작업은 주 Agent가 직접 처리하고 Subagent 사용만을 위해 분할하지 마세요. ``` ## 서드파티 모델 단계별 검증 @@ -182,69 +182,69 @@ OpenAI 호환 API라고 해서 Codex의 모든 동작을 지원하는 것은 아 이미지 형식, 크기 제한, 오브젝트 스토리지, 단위 테스트를 추가한다면 주 Agent는 다음 작업 그래프를 만들 수 있습니다. ```text -主 Agent -├── Researcher:调查框架上传接口和对象存储 SDK -├── Implementer:实现上传服务和 API -├── Test Writer:编写格式、大小和异常场景测试 -└── Security Reviewer:检查路径穿越、MIME 欺骗和资源滥用 +주 Agent +├── Researcher: 프레임워크 업로드 API와 객체 스토리지 SDK 조사 +├── Implementer: 업로드 서비스와 API 구현 +├── Test Writer: 형식, 크기, 예외 시나리오 테스트 작성 +└── Security Reviewer: 경로 순회, MIME 위조, 리소스 남용 점검 ``` Researcher: ```text -阅读项目使用的 Web 框架和对象存储 SDK 文档。 +프로젝트에서 사용하는 Web 프레임워크와 객체 스토리지 SDK 문서를 읽으세요. -只返回: -1. 推荐的上传处理方式; -2. 流式处理与内存限制; -3. 官方建议的错误处理方式; -4. 相关接口名称和来源。 +다음 내용만 반환하세요: +1. 권장 업로드 처리 방식. +2. 스트리밍 처리와 메모리 제한. +3. 공식적으로 권장되는 오류 처리 방식. +4. 관련 API 이름과 출처. -不要修改代码。 +코드를 수정하지 마세요. ``` Implementer: ```text -在 src/upload 范围内实现上传服务。 - -要求: -- 最大文件大小 10 MB; -- 只允许 JPEG、PNG 和 WebP; -- 不信任客户端提供的 Content-Type; -- 使用现有对象存储客户端; -- 不修改数据库结构; -- 完成后列出修改文件、测试结果和待验证事项。 +src/upload 범위에서 업로드 서비스를 구현하세요. + +요구 사항: +- 최대 파일 크기는 10 MB. +- JPEG, PNG, WebP만 허용. +- 클라이언트가 제공한 Content-Type을 신뢰하지 않음. +- 기존 객체 스토리지 클라이언트를 사용. +- 데이터베이스 구조를 변경하지 않음. +- 완료 후 변경 파일, 테스트 결과, 추가 검증 항목을 나열. ``` Test Writer: ```text -为上传功能补充测试。 - -必须覆盖: -- 合法 JPEG; -- 超过大小限制; -- 扩展名和实际内容不一致; -- 空文件; -- 存储服务失败; -- 并发上传时文件名冲突。 +업로드 기능 테스트를 추가하세요. + +반드시 다음을 포함하세요: +- 유효한 JPEG. +- 크기 제한을 초과한 파일. +- 확장자와 실제 내용이 일치하지 않는 파일. +- 빈 파일. +- 스토리지 서비스 실패. +- 동시 업로드 중 파일 이름 충돌. ``` Security Reviewer: ```text -只审查上传实现,不修改文件。 +업로드 구현만 검토하고 파일은 수정하지 마세요. -重点检查: -- 路径穿越; -- MIME 欺骗; -- 图片解析漏洞; -- 未限制的内存占用; -- 可预测文件名; -- 错误信息泄露。 +중점 확인 항목: +- 경로 순회. +- MIME 위조. +- 이미지 파서 취약점. +- 제한되지 않은 메모리 사용. +- 예측 가능한 파일 이름. +- 오류 메시지를 통한 정보 유출. -所有结论必须给出文件位置和可复现场景。 +모든 지적에 파일 위치와 재현 가능한 시나리오를 포함하세요. ``` 마지막으로 주 Agent가 diff, 전체 테스트, 충돌, 보안 결정을 확인합니다. @@ -258,11 +258,11 @@ API key는 환경 변수나 자격 증명 관리자에 저장합니다. 서드 저렴한 모델도 재시도와 재작업 때문에 총비용이 커질 수 있습니다. ```text -有效成本 = -调用成本 -+ 重试成本 -+ 主 Agent 复核成本 -+ 错误修改的修复成本 +실질 비용 = +호출 비용 ++ 재시도 비용 ++ 주 Agent 검토 비용 ++ 잘못된 변경을 수정하는 비용 ``` 읽기 전용 Researcher부터 시작하고, 빠른 작업 Agent, 쓰기 Agent, 독립 Reviewer 순으로 추가하세요. 실제 성공률, 지연, 재시도, 사람의 재작업 시간을 기록한 뒤 자동 라우팅을 활성화합니다. diff --git a/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md index 4ec9453..48f61e6 100644 --- a/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -71,8 +71,8 @@ Base URL 뒤에 `/v1/messages`를 추가하지 마세요. 클라이언트가 요 ```text ANTHROPIC_BASE_URL=https://models.bytefuture.ai -ANTHROPIC_AUTH_TOKEN=<你的 Token Station API Key> -ANTHROPIC_MODEL=<完整模型 ID> +ANTHROPIC_AUTH_TOKEN= +ANTHROPIC_MODEL=<전체 모델 ID 입력> ``` 일부 템플릿은 `ANTHROPIC_AUTH_TOKEN` 대신 `ANTHROPIC_API_KEY`를 사용합니다. 현재 템플릿에 표시된 필드를 따르고, 출처가 불분명한 여러 인증 필드를 동시에 입력하지 마세요. @@ -146,7 +146,7 @@ Windows에서는 시스템 트레이를 확인하고 필요하면 Quit을 선택 Claude Code App에서 새 대화를 시작하고 다음을 전송합니다. ```text -请只回复:Token Station 测试成功 +Token Station 테스트 성공이라고만 답하세요 ``` 응답을 받은 후 [Token Station 대시보드](https://models.bytefuture.ai/dashboard)의 `Recent Activity` 또는 요청 로그에서 다음을 확인합니다. diff --git a/src/content/writings/ko/configure-claude-code-cli-with-token-station.md b/src/content/writings/ko/configure-claude-code-cli-with-token-station.md index 55eeb01..cdd5f1d 100644 --- a/src/content/writings/ko/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/ko/configure-claude-code-cli-with-token-station.md @@ -55,7 +55,7 @@ PowerShell에서 실행합니다. ```powershell $env:ANTHROPIC_BASE_URL = "https://models.bytefuture.ai" -$env:ANTHROPIC_AUTH_TOKEN = "你的真实密钥" +$env:ANTHROPIC_AUTH_TOKEN = "실제 API Key" $env:ANTHROPIC_MODEL = "openai/gpt-5.6-sol" claude @@ -76,7 +76,7 @@ claude [Environment]::SetEnvironmentVariable( "ANTHROPIC_AUTH_TOKEN", - "你的真实密钥", + "실제 API Key", "User" ) @@ -103,7 +103,7 @@ Claude Code를 실행할 터미널에서 설정합니다. ```bash export ANTHROPIC_BASE_URL='https://models.bytefuture.ai' -export ANTHROPIC_AUTH_TOKEN='你的真实密钥' +export ANTHROPIC_AUTH_TOKEN='실제 API Key' export ANTHROPIC_MODEL='openai/gpt-5.6-sol' claude @@ -136,13 +136,13 @@ source ~/.bashrc Claude Code가 실행된다는 사실만으로 Token Station 사용 여부를 확인할 수는 없습니다. 변수가 설정된 같은 터미널에서 실제 요청을 보내세요. ```bash -claude -p '请只回复:Token Station 测试成功' +claude -p 'Token Station 테스트 성공이라고만 답하세요' ``` PowerShell에서는: ```powershell -claude -p "请只回复:Token Station 测试成功" +claude -p "Token Station 테스트 성공이라고만 답하세요" ``` 응답을 받은 뒤 [Token Station 대시보드](https://models.bytefuture.ai/dashboard)의 `Recent Activity`에서 요청 시간, 상태, 모델을 확인합니다. @@ -206,4 +206,3 @@ Token Station에 표시되는 전체 모델 ID와 제공자 접두사를 사용 - [Token Station](https://models.bytefuture.ai/intro.html) - [Token Station 모델 목록](https://models.bytefuture.ai/models) - [Token Station 대시보드](https://models.bytefuture.ai/dashboard) - diff --git a/src/content/writings/ko/configure-codex-app-with-token-station.md b/src/content/writings/ko/configure-codex-app-with-token-station.md index 1c1d285..3c8b2aa 100644 --- a/src/content/writings/ko/configure-codex-app-with-token-station.md +++ b/src/content/writings/ko/configure-codex-app-with-token-station.md @@ -74,16 +74,16 @@ model_provider = "token_station" Dock, Finder, Launchpad에서 실행한 App은 현재 터미널의 `export`를 보통 상속하지 않습니다. 그래픽 로그인 세션에 변수를 추가합니다. ```bash -launchctl setenv TOKEN_STATION_API_KEY '你的真实密钥' +launchctl setenv TOKEN_STATION_API_KEY '실제 API Key' ``` key를 출력하지 않고 존재 여부를 확인합니다. ```bash if [ -n "$(launchctl getenv TOKEN_STATION_API_KEY)" ]; then - echo "TOKEN_STATION_API_KEY 已设置" + echo "TOKEN_STATION_API_KEY가 설정되어 있습니다" else - echo "TOKEN_STATION_API_KEY 未设置" + echo "TOKEN_STATION_API_KEY가 설정되지 않았습니다" fi ``` @@ -100,16 +100,16 @@ launchctl unsetenv TOKEN_STATION_API_KEY 환경 변수 상속 방식은 배포판, 데스크톱 환경, 설치 방법에 따라 다릅니다. 터미널에서 Codex를 실행한다면 같은 Shell에서 설정하세요. ```bash -export TOKEN_STATION_API_KEY='你的真实密钥' +export TOKEN_STATION_API_KEY='실제 API Key' ``` 존재 여부를 확인합니다. ```bash if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then - echo "TOKEN_STATION_API_KEY 已设置" + echo "TOKEN_STATION_API_KEY가 설정되어 있습니다" else - echo "TOKEN_STATION_API_KEY 未设置" + echo "TOKEN_STATION_API_KEY가 설정되지 않았습니다" fi ``` @@ -118,7 +118,7 @@ fi GNOME이나 KDE 메뉴에서 실행하고 systemd 사용자 세션을 사용한다면 다음을 시도할 수 있습니다. ```bash -systemctl --user set-environment TOKEN_STATION_API_KEY='你的真实密钥' +systemctl --user set-environment TOKEN_STATION_API_KEY='실제 API Key' ``` App을 완전히 종료하고 다시 엽니다. 삭제하려면: @@ -136,7 +136,7 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY 3. 다음 메시지 보내기 ```text - 请只回复:Token Station 测试成功 +Token Station 테스트 성공이라고만 답하세요 ``` 4. 정상 응답 확인하기 @@ -147,10 +147,10 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY ```text Codex App - → config.toml 中的 token_station provider +→ config.toml의 token_station provider → TOKEN_STATION_API_KEY → https://bec.bytefuture.ai/v1/responses - → Token Station 调用记录 +→ Token Station 호출 기록 ``` App 응답과 Token Station의 해당 기록이 모두 있어야 연결이 완료됩니다. @@ -188,4 +188,3 @@ Token Station이 제공하는 전체 모델 ID와 제공자 접두사를 사용 - [Token Station](https://models.bytefuture.ai/intro.html) - [Token Station 대시보드](https://models.bytefuture.ai/dashboard) - diff --git a/src/content/writings/ko/configure-codex-cli-with-token-station.md b/src/content/writings/ko/configure-codex-cli-with-token-station.md index 3542d44..901d9cc 100644 --- a/src/content/writings/ko/configure-codex-cli-with-token-station.md +++ b/src/content/writings/ko/configure-codex-cli-with-token-station.md @@ -68,7 +68,7 @@ wire_api = "responses" PowerShell에서 실행합니다. ```powershell -$env:TOKEN_STATION_API_KEY = "你的真实密钥" +$env:TOKEN_STATION_API_KEY = "실제 API Key" ``` 현재 PowerShell과 하위 프로세스에서만 유효합니다. @@ -78,7 +78,7 @@ $env:TOKEN_STATION_API_KEY = "你的真实密钥" ```powershell [Environment]::SetEnvironmentVariable( "TOKEN_STATION_API_KEY", - "你的真实密钥", + "실제 API Key", "User" ) ``` @@ -89,9 +89,9 @@ key를 출력하지 않고 변수를 확인합니다. ```powershell if ([string]::IsNullOrEmpty($env:TOKEN_STATION_API_KEY)) { - "TOKEN_STATION_API_KEY 未设置" + "TOKEN_STATION_API_KEY가 설정되지 않았습니다" } else { - "TOKEN_STATION_API_KEY 已设置" + "TOKEN_STATION_API_KEY가 설정되어 있습니다" } ``` @@ -110,16 +110,16 @@ if ([string]::IsNullOrEmpty($env:TOKEN_STATION_API_KEY)) { Codex CLI를 실행할 터미널에서 설정합니다. ```bash -export TOKEN_STATION_API_KEY='你的真实密钥' +export TOKEN_STATION_API_KEY='실제 API Key' ``` 존재 여부를 확인합니다. ```bash if [ -n "${TOKEN_STATION_API_KEY:-}" ]; then - echo "TOKEN_STATION_API_KEY 已设置" + echo "TOKEN_STATION_API_KEY가 설정되어 있습니다" else - echo "TOKEN_STATION_API_KEY 未设置" + echo "TOKEN_STATION_API_KEY가 설정되지 않았습니다" fi ``` @@ -146,19 +146,19 @@ codex 실행 후 다음을 보냅니다. ```text -请只回复:Token Station 测试成功 +Token Station 테스트 성공이라고만 답하세요 ``` 비대화형 요청도 실행할 수 있습니다. ```bash -codex exec '请只回复:Token Station 测试成功' +codex exec 'Token Station 테스트 성공이라고만 답하세요' ``` PowerShell에서는 큰따옴표를 사용합니다. ```powershell -codex exec "请只回复:Token Station 测试成功" +codex exec "Token Station 테스트 성공이라고만 답하세요" ``` 응답 후 [Token Station 대시보드](https://models.bytefuture.ai/dashboard)의 `Recent Activity`에서 시간, 상태, 모델을 비교하세요. From a63c1908ad2d73b6ae1e96895cdcd0433664a10a Mon Sep 17 00:00:00 2001 From: alabulei1 Date: Tue, 18 Aug 2026 00:42:43 +0800 Subject: [PATCH 5/8] Writings: make the five new tutorials read as native English Prose-only pass over PR #29. No technical content, commands, model IDs, or config values changed. - Replace verbless stub-colon openers ("Confirm that:", "Prepare:", "Check:", "Run in PowerShell:") with real sentences. This pattern is the loudest translationese tic in the set. - Fix "access or available credit", which read as a choice when both are required. Corrected in all four languages (en/zh/ja/ko). - Lowercase "App" used as a common noun (18 places). Product names ("the Codex App", "the Claude Code App") keep their capitals, matching the already-published Codex article. - Join sentence pairs where the second silently explains the first, a Chinese parataxis pattern that reads as disconnected in English. Kept the house voice: no contractions, no em-dashes. --- ...de-app-with-cc-switch-and-token-station.md | 24 ++++++++--------- ...gure-claude-code-cli-with-token-station.md | 6 ++--- .../configure-codex-app-with-token-station.md | 26 +++++++++---------- .../configure-codex-cli-with-token-station.md | 18 ++++++------- ...de-app-with-cc-switch-and-token-station.md | 2 +- ...gure-claude-code-cli-with-token-station.md | 2 +- .../configure-codex-app-with-token-station.md | 2 +- .../configure-codex-cli-with-token-station.md | 2 +- ...de-app-with-cc-switch-and-token-station.md | 2 +- ...gure-claude-code-cli-with-token-station.md | 2 +- .../configure-codex-app-with-token-station.md | 2 +- .../configure-codex-cli-with-token-station.md | 2 +- ...de-app-with-cc-switch-and-token-station.md | 2 +- ...gure-claude-code-cli-with-token-station.md | 2 +- .../configure-codex-app-with-token-station.md | 2 +- .../configure-codex-cli-with-token-station.md | 2 +- 16 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md index a12b4d5..9a3b1f0 100644 --- a/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -15,11 +15,11 @@ CC Switch can store several Claude Code providers and switch between them withou ## Before you start -Prepare: +You need the following in place: - CC Switch and the Claude Code App - A valid Token Station API key -- Access or available credit for the models you plan to use +- Access to the models you plan to use, and credit to spend on them Open the [Token Station dashboard](https://models.bytefuture.ai/dashboard) and copy the complete model IDs. Keep the API key out of screenshots, chat messages, and version control. @@ -35,7 +35,7 @@ The complete setup is: 6. Enable the provider and fully restart the Claude Code App 7. Send a request and verify it in Token Station -Skipping model mapping or local routing can leave the App on its previous service even when CC Switch shows Token Station as the current provider. +Skipping model mapping or local routing can leave the app on its previous service even when CC Switch shows Token Station as the current provider. ## Add the Token Station provider @@ -86,7 +86,7 @@ The **Needs model mapping** switch must be On. The Claude Code App requests mode
Enable “Needs model mapping” before saving the Token Station provider.
-If this option is disabled, selecting a Claude role can send an unmapped model name and produce a model-not-found error, or the App may continue using an unintended route. +If this option is disabled, selecting a Claude role can send an unmapped model name and produce a model-not-found error, or the app may continue using an unintended route. ## Configure model mapping @@ -108,7 +108,7 @@ Sonnet is normally used for the default general-purpose role, Opus for more dema ## Enable CC Switch local routing -Model mapping is applied by the CC Switch service running on your computer. Enabling the provider alone is not enough. +Enabling the provider is not enough on its own: the mapping is applied by the CC Switch service running on your computer, so that service has to be up. 1. Open **CC Switch Settings → Routing** 2. Turn on **Show local routing switch on the home page** @@ -139,7 +139,7 @@ Before saving, confirm that the URL has no extra path, the API key has no surrou Save the provider, select **Token Station**, and click Enable, Apply, or Switch. Then completely quit the Claude Code App and reopen it. Closing only the window may leave the process running with its old configuration. -On Windows, check the system tray and choose Quit if necessary. On macOS, use `Command + Q`. Keep CC Switch and its routing service running when you reopen the App. +On Windows, check the system tray and choose Quit if necessary. On macOS, use `Command + Q`. Keep CC Switch and its routing service running when you reopen the app. ## Verify the complete route @@ -155,7 +155,7 @@ After the response arrives, open the [Token Station dashboard](https://models.by - The request completed successfully - The recorded model matches the role mapping in CC Switch -A response in the App and a matching Token Station record together prove that the complete route is active. The Current Provider label in CC Switch is not sufficient evidence by itself. +A response in the app and a matching Token Station record together prove that the complete route is active. The Current Provider label in CC Switch is not sufficient evidence by itself. ## Switch back to the original provider @@ -163,9 +163,9 @@ Keep the official provider instead of overwriting it. To restore it, select the ## Troubleshooting -### The App still uses the old provider +### The app still uses the old provider -Fully quit the App, apply the Token Station provider again, confirm local routing and Claude routing are On, then reopen the App. +Fully quit the app, apply the Token Station provider again, confirm local routing and Claude routing are On, then reopen the app. ### Model mapping is disabled @@ -189,11 +189,11 @@ Use `https://models.bytefuture.ai` as the base URL and remove manually appended ### Model not found or access denied -Copy the complete model ID from Token Station and verify the corresponding Sonnet, Opus, or Haiku mapping. Do not infer an ID from the App's display name. +Copy the complete model ID from Token Station and verify the corresponding Sonnet, Opus, or Haiku mapping. Do not infer an ID from the app's display name. -### The App responds, but Token Station has no record +### The app responds, but Token Station has no record -The request may still be using the original service. Check the active provider, model mapping, both routing switches, the App restart, the Token Station account, and the activity time filter. +The request may still be using the original service. Check the active provider, model mapping, both routing switches, the app restart, the Token Station account, and the activity time filter. ## Security notes diff --git a/src/content/writings/en/configure-claude-code-cli-with-token-station.md b/src/content/writings/en/configure-claude-code-cli-with-token-station.md index 0a10185..5d5a8c0 100644 --- a/src/content/writings/en/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/en/configure-claude-code-cli-with-token-station.md @@ -15,11 +15,11 @@ This guide covers Windows, macOS, and Linux. Two details matter most: do not app ## Before you start -You need: +Start with these three things in place: - Claude Code CLI installed, with `claude --version` returning version information - A [Token Station](https://models.bytefuture.ai/intro.html) account and API key -- Access or available credit for the target model +- Access to the target model, and credit to spend on it The examples use `openai/gpt-5.6-sol`. Model IDs can change, so copy the complete ID from the current [Token Station model list](https://models.bytefuture.ai/models). @@ -89,7 +89,7 @@ To make new terminals load the configuration, run: ) ``` -Close the current PowerShell window and open a new one before running `claude`. Existing processes do not receive newly saved variables. +Close the current PowerShell window and open a new one before running `claude`. A process keeps the environment it started with, so an open terminal will never see the variables you just saved. To remove the variables later: diff --git a/src/content/writings/en/configure-codex-app-with-token-station.md b/src/content/writings/en/configure-codex-app-with-token-station.md index da91684..035a6a2 100644 --- a/src/content/writings/en/configure-codex-app-with-token-station.md +++ b/src/content/writings/en/configure-codex-app-with-token-station.md @@ -11,15 +11,15 @@ draft: false The Codex App can register a custom model provider in `config.toml`. Point that provider at the Token Station Responses API to use models available through Token Station and bill requests to your Token Station API key. -This guide covers Windows, macOS, and Linux. Desktop apps and terminal programs may inherit environment variables from different sources. On macOS, an App launched from the Dock or Finder usually does not read `~/.zshrc`. +This guide covers Windows, macOS, and Linux. Desktop apps and terminal programs may inherit environment variables from different sources. On macOS, an app launched from the Dock or Finder usually does not read `~/.zshrc`. ## Before you start -You need: +You need three things: - The Codex App installed - A [Token Station](https://models.bytefuture.ai/intro.html) account and API key -- Access or available credit for the target model +- Access to the target model, and credit to spend on it The examples use `openai/gpt-5.6-sol`. Copy the complete current model ID from Token Station. @@ -71,11 +71,11 @@ Open **Advanced system settings → Environment Variables**. Under User variable The variable name must exactly match `env_key` in `config.toml`. -Save the variable, fully quit the Codex App, and reopen it. Closing the window may not end the process, and a running App does not automatically receive a new variable. +Save the variable, then quit the Codex App completely and reopen it. Closing the window often leaves the process running, and a running app will not see the new variable. ## macOS: configure the API key -An App launched from the Dock, Finder, or Launchpad usually does not inherit an `export` from the current terminal. Add the key to the current graphical login session: +An app launched from the Dock, Finder, or Launchpad usually does not inherit an `export` from the current terminal. Add the key to the current graphical login session: ```bash launchctl setenv TOKEN_STATION_API_KEY 'YOUR_REAL_API_KEY' @@ -119,13 +119,13 @@ fi Start Codex from the same terminal. To load the key in new terminals, add the `export` command to `~/.bashrc` or `~/.zshrc`. -If the App starts from GNOME, KDE, or another desktop menu and the system uses a systemd user session, you can try: +If the app starts from GNOME, KDE, or another desktop menu and the system uses a systemd user session, you can try: ```bash systemctl --user set-environment TOKEN_STATION_API_KEY='YOUR_REAL_API_KEY' ``` -Fully quit and reopen the App. To clear the variable: +Fully quit and reopen the app. To clear the variable: ```bash systemctl --user unset-environment TOKEN_STATION_API_KEY @@ -143,7 +143,7 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY Reply only: Token Station test succeeded ``` -4. Confirm that the App returns a normal response +4. Confirm that the app returns a normal response 5. Open the [Token Station dashboard](https://models.bytefuture.ai/dashboard) 6. Match the request time, status, and model under `Recent Activity` @@ -157,15 +157,15 @@ Codex App → Token Station request log ``` -The connection is verified only when the App responds and Token Station shows the matching record. +The connection is verified only when the app responds and Token Station shows the matching record. ## Troubleshooting ### Codex cannot find the API key -Confirm that the variable name exactly matches `env_key = "TOKEN_STATION_API_KEY"`, then restart the App after setting it. +Confirm that the variable name exactly matches `env_key = "TOKEN_STATION_API_KEY"`, then restart the app after setting it. -On macOS, an `export` in `~/.zshrc` may not reach an App launched from the Dock. Use `launchctl setenv` and restart the App. +On macOS, an `export` in `~/.zshrc` may not reach an app launched from the Dock. Use `launchctl setenv` and restart the app. ### 401 or 403 response @@ -173,7 +173,7 @@ The key may be invalid, contain extra whitespace, lack model access, or have no ### 404 response -Check: +Recheck these two fields: ```toml base_url = "https://bec.bytefuture.ai/v1" @@ -188,7 +188,7 @@ Use the complete model ID supplied by Token Station and keep its provider prefix ### Codex responds, but Token Station has no record -Check that `model_provider` matches the provider block name and that the App reloaded the edited `config.toml`. Test again and match the request by time. +Check that `model_provider` matches the provider block name and that the app reloaded the edited `config.toml`. Test again and match the request by time. ## References diff --git a/src/content/writings/en/configure-codex-cli-with-token-station.md b/src/content/writings/en/configure-codex-cli-with-token-station.md index 6b0e546..e1fbc42 100644 --- a/src/content/writings/en/configure-codex-cli-with-token-station.md +++ b/src/content/writings/en/configure-codex-cli-with-token-station.md @@ -15,11 +15,11 @@ This guide is for the command-line version of Codex. The Codex App can inherit e ## Before you start -Confirm that: +Three things need to be in place before you edit any configuration: - Codex CLI is installed and `codex --version` returns version information - You have a working Token Station API key -- Your account has access or available credit for the target model +- Your account has access to the target model, and credit to spend on it > Never expose a real API key in documentation, screenshots, chats, or repositories. @@ -30,7 +30,7 @@ Codex CLI reads its user configuration from: - Windows: `%USERPROFILE%\.codex\config.toml` - macOS and Linux: `~/.codex/config.toml` -Add: +Add this block: ```toml model = "openai/gpt-5.6-sol" @@ -54,7 +54,7 @@ Merge these fields with any existing configuration instead of overwriting settin | `env_key` | Environment variable that stores the API key | | `wire_api` | Selects the Responses API | -Check these details: +Four details here are easy to get wrong: - `model_provider = "token_station"` matches `[model_providers.token_station]` - `base_url` ends at `/v1`, without `/responses` @@ -67,7 +67,7 @@ The examples use `openai/gpt-5.6-sol`. Use the complete current ID shown by Toke ### Load the key temporarily -Run in PowerShell: +Run this in PowerShell: ```powershell $env:TOKEN_STATION_API_KEY = "YOUR_REAL_API_KEY" @@ -85,7 +85,7 @@ The variable applies only to the current PowerShell process and its child proces ) ``` -Close the terminal and open a new PowerShell window. Existing processes do not receive newly saved variables. +Close the terminal and open a new PowerShell window, since a process that is already running will not pick up a variable saved after it started. Check that the variable exists without printing the key: @@ -145,7 +145,7 @@ Start an interactive session: codex ``` -Then send: +Then send this prompt: ```text Reply only: Token Station test succeeded @@ -179,7 +179,7 @@ Confirm that Codex CLI is installed and its installation directory is in `PATH`. ### Codex cannot find the API key -Confirm that: +Four things have to line up: - The variable is named `TOKEN_STATION_API_KEY` - `config.toml` uses `env_key = "TOKEN_STATION_API_KEY"` @@ -192,7 +192,7 @@ The key may be invalid, contain extra whitespace, lack model access, or have no ### 404 response -Check: +Recheck these two fields: ```toml base_url = "https://bec.bytefuture.ai/v1" diff --git a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md index d345b55..2306601 100644 --- a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -17,7 +17,7 @@ CC Switch を使うと、複数の Claude Code Provider を保存し、設定フ - CC Switch と Claude Code App - 有効な Token Station API Key -- 利用するモデルへのアクセス権または利用可能なクレジット +- 利用するモデルへのアクセス権と利用可能なクレジット [Token Station ダッシュボード](https://models.bytefuture.ai/dashboard)を開き、完全なモデル ID を確認します。API Key をスクリーンショット、チャット、Git リポジトリに含めないでください。 diff --git a/src/content/writings/ja/configure-claude-code-cli-with-token-station.md b/src/content/writings/ja/configure-claude-code-cli-with-token-station.md index 570724a..ba5ea2d 100644 --- a/src/content/writings/ja/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/ja/configure-claude-code-cli-with-token-station.md @@ -19,7 +19,7 @@ Claude Code CLIは、Anthropic Messages APIを使ってサードパーティー - Claude Code CLI。`claude --version`でバージョンを確認できること - [Token Station](https://models.bytefuture.ai/intro.html)のアカウントとAPI key -- 対象モデルの利用権限または利用可能な残高 +- 対象モデルの利用権限と利用可能な残高 例では`openai/gpt-5.6-sol`を使います。モデルIDは更新される場合があるため、[Token Stationのモデル一覧](https://models.bytefuture.ai/models)に表示される完全なIDを使ってください。 diff --git a/src/content/writings/ja/configure-codex-app-with-token-station.md b/src/content/writings/ja/configure-codex-app-with-token-station.md index dd3981a..9ae931c 100644 --- a/src/content/writings/ja/configure-codex-app-with-token-station.md +++ b/src/content/writings/ja/configure-codex-app-with-token-station.md @@ -17,7 +17,7 @@ Codex Appは`config.toml`でカスタムモデルProviderを登録できます - Codex App - [Token Station](https://models.bytefuture.ai/intro.html)のアカウントとAPI key -- 対象モデルの利用権限または残高 +- 対象モデルの利用権限と残高 例では`openai/gpt-5.6-sol`を使います。Token Stationに表示される完全なモデルIDを確認してください。 diff --git a/src/content/writings/ja/configure-codex-cli-with-token-station.md b/src/content/writings/ja/configure-codex-cli-with-token-station.md index 3ed6f6e..2ab637d 100644 --- a/src/content/writings/ja/configure-codex-cli-with-token-station.md +++ b/src/content/writings/ja/configure-codex-cli-with-token-station.md @@ -17,7 +17,7 @@ Codex CLIは`config.toml`でカスタムモデルProviderを設定できます - `codex --version`で確認できるCodex CLI - 利用可能なToken Station API key -- 対象モデルの利用権限または残高 +- 対象モデルの利用権限と残高 > 実際のAPI keyを文書、画像、チャット、リポジトリに公開しないでください。 diff --git a/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md index 48f61e6..22d09fe 100644 --- a/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -19,7 +19,7 @@ CC Switch를 사용하면 여러 Claude Code Provider를 저장하고 설정 파 - CC Switch와 Claude Code App - 유효한 Token Station API Key -- 사용할 모델에 대한 접근 권한 또는 사용 가능한 크레딧 +- 사용할 모델에 대한 접근 권한과 사용 가능한 크레딧 [Token Station 대시보드](https://models.bytefuture.ai/dashboard)를 열고 전체 모델 ID를 확인합니다. API Key를 스크린샷, 채팅 메시지, Git 저장소에 노출하지 마세요. diff --git a/src/content/writings/ko/configure-claude-code-cli-with-token-station.md b/src/content/writings/ko/configure-claude-code-cli-with-token-station.md index cdd5f1d..84d4adc 100644 --- a/src/content/writings/ko/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/ko/configure-claude-code-cli-with-token-station.md @@ -17,7 +17,7 @@ Claude Code CLI는 Anthropic Messages API를 통해 서드파티 모델 게이 - `claude --version`으로 확인할 수 있는 Claude Code CLI - [Token Station](https://models.bytefuture.ai/intro.html) 계정과 API key -- 대상 모델의 사용 권한 또는 사용 가능한 잔액 +- 대상 모델의 사용 권한과 사용 가능한 잔액 예시는 `openai/gpt-5.6-sol`을 사용합니다. 모델 ID는 바뀔 수 있으므로 [Token Station 모델 목록](https://models.bytefuture.ai/models)에 표시되는 전체 ID를 사용하세요. diff --git a/src/content/writings/ko/configure-codex-app-with-token-station.md b/src/content/writings/ko/configure-codex-app-with-token-station.md index 3c8b2aa..2952403 100644 --- a/src/content/writings/ko/configure-codex-app-with-token-station.md +++ b/src/content/writings/ko/configure-codex-app-with-token-station.md @@ -17,7 +17,7 @@ Codex App은 `config.toml`에 사용자 지정 모델 Provider를 등록할 수 - Codex App - [Token Station](https://models.bytefuture.ai/intro.html) 계정과 API key -- 대상 모델의 사용 권한 또는 잔액 +- 대상 모델의 사용 권한과 잔액 예시는 `openai/gpt-5.6-sol`을 사용합니다. Token Station에 표시되는 현재 전체 모델 ID를 확인하세요. diff --git a/src/content/writings/ko/configure-codex-cli-with-token-station.md b/src/content/writings/ko/configure-codex-cli-with-token-station.md index 901d9cc..82db8c7 100644 --- a/src/content/writings/ko/configure-codex-cli-with-token-station.md +++ b/src/content/writings/ko/configure-codex-cli-with-token-station.md @@ -17,7 +17,7 @@ Codex CLI는 `config.toml`에서 사용자 지정 모델 Provider를 지원합 - `codex --version`으로 확인할 수 있는 Codex CLI - 사용 가능한 Token Station API key -- 대상 모델의 사용 권한 또는 잔액 +- 대상 모델의 사용 권한과 잔액 > 실제 API key를 문서, 이미지, 채팅 또는 저장소에 공개하지 마세요. diff --git a/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md index dee76c7..99e96f2 100644 --- a/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -19,7 +19,7 @@ CC Switch 可以保存多组 Claude Code Provider,让你在不同服务之间 - 已安装的 CC Switch 和 Claude Code App - 有效的 Token Station API Key -- 目标模型的调用权限或可用额度 +- 目标模型的调用权限和可用额度 打开 [Token Station 控制台](https://models.bytefuture.ai/dashboard),复制模型的完整 ID。不要在截图、聊天记录或 Git 仓库中暴露真实 API Key。 diff --git a/src/content/writings/zh/configure-claude-code-cli-with-token-station.md b/src/content/writings/zh/configure-claude-code-cli-with-token-station.md index d5b58fa..bdf3c17 100644 --- a/src/content/writings/zh/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/zh/configure-claude-code-cli-with-token-station.md @@ -19,7 +19,7 @@ Claude Code CLI 可以通过 Anthropic Messages API 连接第三方模型网关 - 已安装 Claude Code CLI,运行 `claude --version` 可以看到版本信息; - 一个可用的 [Token Station](https://models.bytefuture.ai/intro.html) 账户和 API Key; -- 目标模型的调用权限或可用额度。 +- 目标模型的调用权限和可用额度。 本文以 `openai/gpt-5.6-sol` 为例。模型 ID 可能随平台更新,请以 [Token Station 模型列表](https://models.bytefuture.ai/models) 显示的完整 ID 为准。 diff --git a/src/content/writings/zh/configure-codex-app-with-token-station.md b/src/content/writings/zh/configure-codex-app-with-token-station.md index d5a264d..a59f5af 100644 --- a/src/content/writings/zh/configure-codex-app-with-token-station.md +++ b/src/content/writings/zh/configure-codex-app-with-token-station.md @@ -19,7 +19,7 @@ Codex App 可以通过 `config.toml` 注册自定义模型提供方。将 provid - 已安装 Codex App; - 一个可用的 [Token Station](https://models.bytefuture.ai/intro.html) 账户和 API Key; -- 目标模型的调用权限或可用额度。 +- 目标模型的调用权限和可用额度。 本文以 `openai/gpt-5.6-sol` 为例。请以 Token Station 当前显示的完整模型 ID 为准。 diff --git a/src/content/writings/zh/configure-codex-cli-with-token-station.md b/src/content/writings/zh/configure-codex-cli-with-token-station.md index 6586e66..eed739d 100644 --- a/src/content/writings/zh/configure-codex-cli-with-token-station.md +++ b/src/content/writings/zh/configure-codex-cli-with-token-station.md @@ -19,7 +19,7 @@ Codex CLI 支持通过 `config.toml` 注册自定义模型提供方。配置 Tok - 已安装 Codex CLI,运行 `codex --version` 可以看到版本信息; - 已获取可用的 Token Station API Key; -- 账户拥有目标模型的调用权限或可用额度。 +- 账户拥有目标模型的调用权限和可用额度。 > 不要在文档、截图、聊天记录或代码仓库中公开真实密钥。 From 55a3bec5a87ab6e4a62fe6381a37a944d99519aa Mon Sep 17 00:00:00 2001 From: alabulei1 Date: Tue, 18 Aug 2026 00:56:25 +0800 Subject: [PATCH 6/8] Writings: fix transitions, collocations, and flattened structure Second prose pass over PR #29, continuing the native-English cleanup. No technical content, commands, model IDs, or config values changed. Transitions: each per-OS and verification section used to open on a bare imperative, so the reader got a stack of commands with no thread. Added a bridging sentence where a step's reason was missing, following the one place the set already did this well ("Starting Claude Code does not prove that the gateway is in use"). Collocations and modality in the subagents article: "spending a flagship model" (a model is not spent), "Codex may define roles" (reads as permission, means version-dependent), "The mature design does not" (design as agent), plus a seven-item list whose members were not grammatically parallel. Structure: the English collapsed sections the Chinese keeps as named subsections, which is where the connective tissue was lost. Restored the five failure modes and the five rollout stages, and added the summary the English dropped. Rewrote one sentence that stacked five nouns after "high-risk" and could not be parsed. Consistency across the five articles: one verb for the dashboard check, one completion sentence, one merge verb, and OS headings in a single form. "Configure Windows" was also wrong: the key is configured on Windows, not Windows itself. Also indented the code fence inside the Codex App numbered list in en/ja/ko, which zh already had right. All four now render six list items with the block inside the ol. --- .../en/codex-multi-model-subagents.md | 72 ++++++++++++++----- ...de-app-with-cc-switch-and-token-station.md | 2 +- ...gure-claude-code-cli-with-token-station.md | 8 ++- .../configure-codex-app-with-token-station.md | 18 +++-- .../configure-codex-cli-with-token-station.md | 12 ++-- .../configure-codex-app-with-token-station.md | 2 +- .../configure-codex-app-with-token-station.md | 2 +- 7 files changed, 81 insertions(+), 35 deletions(-) diff --git a/src/content/writings/en/codex-multi-model-subagents.md b/src/content/writings/en/codex-multi-model-subagents.md index e80e5f6..3785fc1 100644 --- a/src/content/writings/en/codex-multi-model-subagents.md +++ b/src/content/writings/en/codex-multi-model-subagents.md @@ -11,7 +11,7 @@ draft: false Codex does not need to run every part of a large engineering task through one model. A capable main agent can interpret the goal, delegate bounded work to specialized subagents, and retain final responsibility for testing and acceptance. -The useful pattern is a controlled loop: +What works is a controlled loop: ```text Goal @@ -21,7 +21,7 @@ Goal → Main agent integrates and accepts ``` -This avoids spending a flagship model on mechanical changes, makes parallel work possible, and separates implementation from review. The main agent decides whether to delegate, what context and permissions each task receives, and which checks must pass. +This avoids paying flagship prices for mechanical changes, makes parallel work possible, and separates implementation from review. The main agent decides whether to delegate, what context and permissions each task receives, and which checks must pass. ## Main agent, subagents, and tools @@ -29,13 +29,13 @@ The main agent handles planning, dependencies, risk, routing, conflict resolutio Subagents work best on narrow, verifiable tasks: inspect `src/auth` without editing, add tests for one module, migrate a specified directory, extract APIs from official documentation, or compare two implementations. -Tools provide access to files, code search, tests, browsers, MCP services, and Git. Model choice cannot compensate for excessive permissions or an unclear write scope. +Tools, not the model, decide what an agent can actually touch: files, code search, tests, browsers, MCP services, and Git. No model choice compensates for permissions that are too broad or a write scope that is unclear. ## Profiles are not agent roles A named Codex profile layers configuration onto a session. It does not by itself become a role that the main agent can select automatically. Multi-agent routing also needs a role description and delegation boundary. -Codex may define roles through `[agents.]` entries and separate configuration files. These fields can change between versions. Check the installed version: +Depending on the version, Codex defines roles through `[agents.]` entries and separate configuration files, and these fields change between releases. Check what you have installed: ```bash codex --version @@ -168,7 +168,7 @@ Other models can replace these examples when their complete Token Station IDs ar | Security review | Careful reasoning | False negatives and positives are costly | | Final review | Different model from implementer | Reduces correlated mistakes | -Keep cross-module decisions and high-risk authentication, permissions, migrations, payments, and deletion with a strong model and independent review. Fast models fit work that tests, type checks, or formatters can verify cheaply. Tasks that depend heavily on implicit conversation context may be safer with the main agent. +Two kinds of work belong with a strong model and an independent reviewer: decisions that cross module boundaries, and anything high-risk, which means authentication, permissions, migrations, payments, and deletion. Fast models fit work that tests, type checks, or formatters can verify cheaply. Work that leans on implicit conversation context is usually safer with the main agent. ## Write explicit routing rules @@ -191,7 +191,7 @@ Task routing rules: ## Validate every third-party model -OpenAI-compatible APIs do not necessarily support every Codex behavior. Test each model in stages: plain text, accurate file reading, read-only search, a small temporary edit, correction after a test failure, permission and timeout errors, and the resulting Token Station activity record. +OpenAI-compatible APIs do not necessarily support every Codex behavior. Promote each model through the same stages: a plain text reply, an accurate file read, a read-only search, a small temporary edit, a correction after a failing test, a clean failure on a permission or timeout error, and a matching record in the Token Station activity log. One successful text response does not establish reliable agentic coding or tool use. @@ -269,27 +269,65 @@ The main agent then inspects the diff, runs the full test suite, resolves confli ## Common failure modes -Do not create subagents for one-line work. Do not allow two writable agents to edit the same file. Treat “completed” as a claim until the main agent checks the diff and runs tests. +### Do not create a subagent for one-line work -Keep API keys in environment variables or a credential manager. Sending work to a third-party provider may transmit prompts and source context. Private projects should review retention, training use, storage location, compliance requirements, and directories that must not leave the environment. +Every subagent costs context transfer and coordination. Splitting pays off when the work is parallelizable, large enough to matter, needs different expertise, needs independent review, or has a very clear boundary. -Cheaper tokens do not guarantee a lower total cost: +### Do not let two writable agents touch the same file + +Divide write scope by directory or module. One agent implements while another reviews read-only, dependent tasks run in sequence, and the main agent does the final integration. + +### The main agent cannot take results on trust + +A subagent reporting “completed” means only that it believes it finished. The main agent still has to read the diff, run the tests, check the error output, confirm nothing was modified out of scope, and decide whether the result answers the original requirement. + +### Protect API keys and private code + +Supply keys through environment variables, a secret manager, or the operating system credential store. Handing a task to a third-party provider can send prompts and source context to that service. For private projects, settle data retention, training use, storage region, compliance requirements, and the directories that must never leave the environment before you route anything. + +Give each subagent the minimum context its task needs, and no more. + +### Cheaper tokens do not guarantee a lower total cost + +A cheap model that fails often, retries, and then needs rework from a strong model can cost more than the strong model would have: ```text -Effective cost = -Invocation cost -+ Retry cost -+ Main-agent review cost -+ Cost of repairing incorrect changes +effective cost = +invocation cost ++ retry cost ++ main-agent review cost ++ cost of repairing incorrect changes ``` -Measure success rate, latency, retries, and human rework for each task class. +Judge a model on measured outcomes per task class, not on price per million tokens. ## Roll out in stages -Start with a read-only researcher. Add a fast worker for formatting, test scaffolds, and bounded replacements. Grant workspace write access only after tool use is stable. Add an independent reviewer, then introduce automatic routing based on observed task results. +### Stage 1: main agent plus a read-only researcher + +Prove out repository search, documentation investigation, and structured reporting first. Read-only permissions keep the cost of a mistake low. + +### Stage 2: add a fast worker + +Hand the fast worker formatting, test scaffolds, documentation gaps, and bulk replacements inside an explicit scope, and require tool verification of the result. + +### Stage 3: add an implementer + +Grant workspace write access only once tool calls and file edits are stable, and limit that write scope to named directories or files. + +### Stage 4: add an independent reviewer + +Put implementation and review on different models, then compare what each one actually catches. + +### Stage 5: measure before automating routing + +Record success rate, latency, token spend, retry rate, and human rework time, then adjust the mapping from tasks to models on that record. + +## Summary + +A mature multi-model setup does not spawn an agent for every task, and does not always reach for the strongest or the cheapest model. It picks an adequate executor based on complexity, risk, verifiability, and context dependence, while keeping critical decisions, permission control, and final quality with the main agent. -The mature design does not always choose the strongest or cheapest model. It selects an adequate model for each job while keeping critical decisions, permission control, and final quality with the main agent. +Configure one reliable provider first, then define a small number of roles with clear boundaries. Use `--strict-config` to check whether your Codex version recognizes the fields, start with read-only tasks, and open up automatic routing and write access last. ## References diff --git a/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md index 9a3b1f0..4734237 100644 --- a/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/en/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -108,7 +108,7 @@ Sonnet is normally used for the default general-purpose role, Opus for more dema ## Enable CC Switch local routing -Enabling the provider is not enough on its own: the mapping is applied by the CC Switch service running on your computer, so that service has to be up. +This is the step most often skipped, and skipping it is why the app keeps answering from its old service. Enabling the provider is not enough on its own: the mapping is applied by the CC Switch service running on your computer, so that service has to be up. 1. Open **CC Switch Settings → Routing** 2. Turn on **Show local routing switch on the home page** diff --git a/src/content/writings/en/configure-claude-code-cli-with-token-station.md b/src/content/writings/en/configure-claude-code-cli-with-token-station.md index 5d5a8c0..26eab34 100644 --- a/src/content/writings/en/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/en/configure-claude-code-cli-with-token-station.md @@ -49,7 +49,9 @@ openai/gpt-5.6-sol Do not shorten it to `gpt-5.6-sol`. -## Configure Windows +How you load these three variables depends on your operating system. + +## Windows: set the environment variables ### Temporary configuration @@ -99,7 +101,7 @@ To remove the variables later: [Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", $null, "User") ``` -## Configure macOS and Linux +## macOS and Linux: set the environment variables Run these commands in the terminal that will start Claude Code: @@ -149,7 +151,7 @@ claude -p "Reply only: Token Station test succeeded" After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard). Check the request time, status, and model under `Recent Activity`. -The connection is complete only when: +The setup is complete only when: - Claude Code returns a normal response - The matching request appears in Token Station diff --git a/src/content/writings/en/configure-codex-app-with-token-station.md b/src/content/writings/en/configure-codex-app-with-token-station.md index 035a6a2..4b48de5 100644 --- a/src/content/writings/en/configure-codex-app-with-token-station.md +++ b/src/content/writings/en/configure-codex-app-with-token-station.md @@ -40,7 +40,7 @@ env_key = "TOKEN_STATION_API_KEY" wire_api = "responses" ``` -Merge these fields with any existing configuration instead of replacing settings you still need. +Merge these fields with any existing configuration instead of overwriting settings you still need. | Field | Purpose | | --- | --- | @@ -60,7 +60,9 @@ model_provider = "token_station" Keep `base_url` at `/v1`; do not append `/responses`. Keep the provider prefix in the model ID as well. -## Windows: configure the API key +The provider block names the environment variable but does not supply its value, and a desktop app does not always see what your shell sees. The next three sections cover each operating system. + +## Windows: load the API key Open **Advanced system settings → Environment Variables**. Under User variables, create: @@ -73,7 +75,7 @@ The variable name must exactly match `env_key` in `config.toml`. Save the variable, then quit the Codex App completely and reopen it. Closing the window often leaves the process running, and a running app will not see the new variable. -## macOS: configure the API key +## macOS: load the API key An app launched from the Dock, Finder, or Launchpad usually does not inherit an `export` from the current terminal. Add the key to the current graphical login session: @@ -99,7 +101,7 @@ A variable set with `launchctl setenv` usually lasts only for the current graphi launchctl unsetenv TOKEN_STATION_API_KEY ``` -## Linux: configure the API key +## Linux: load the API key Environment inheritance varies by distribution, desktop environment, and installation method. If you start Codex from a terminal, set the variable in that shell: @@ -135,17 +137,19 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY ## Verify the complete route +A reply in the app is only half the evidence. Check both ends of the route: + 1. Fully quit and reopen the Codex App 2. Create a new conversation 3. Send: ```text -Reply only: Token Station test succeeded + Reply only: Token Station test succeeded ``` 4. Confirm that the app returns a normal response 5. Open the [Token Station dashboard](https://models.bytefuture.ai/dashboard) -6. Match the request time, status, and model under `Recent Activity` +6. Check the request time, status, and model under `Recent Activity` The route should be: @@ -157,7 +161,7 @@ Codex App → Token Station request log ``` -The connection is verified only when the app responds and Token Station shows the matching record. +The setup is complete only when the app responds and Token Station shows the matching record. ## Troubleshooting diff --git a/src/content/writings/en/configure-codex-cli-with-token-station.md b/src/content/writings/en/configure-codex-cli-with-token-station.md index e1fbc42..dbae4af 100644 --- a/src/content/writings/en/configure-codex-cli-with-token-station.md +++ b/src/content/writings/en/configure-codex-cli-with-token-station.md @@ -63,7 +63,9 @@ Four details here are easy to get wrong: The examples use `openai/gpt-5.6-sol`. Use the complete current ID shown by Token Station. -## Configure Windows +The provider block names the environment variable but does not supply its value. That part depends on your operating system. + +## Windows: load the API key ### Load the key temporarily @@ -107,7 +109,7 @@ To remove it later: ) ``` -## Configure macOS and Linux +## macOS and Linux: load the API key Set the variable in the terminal that will run Codex CLI: @@ -137,9 +139,9 @@ Open a new terminal after editing, or run `source ~/.zshrc` or `source ~/.bashrc > A key in a shell configuration file is stored as plaintext. Keep that file out of Git and public sync folders. -## Verify the configuration +## Verify the connection -Start an interactive session: +A `config.toml` that parses is not proof that requests reach Token Station. Start an interactive session: ```bash codex @@ -163,7 +165,7 @@ In PowerShell, use double quotes: codex exec "Reply only: Token Station test succeeded" ``` -After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard). Match the request time, status, and model under `Recent Activity`. +After the response arrives, open the [Token Station dashboard](https://models.bytefuture.ai/dashboard). Check the request time, status, and model under `Recent Activity`. The setup is complete only when: diff --git a/src/content/writings/ja/configure-codex-app-with-token-station.md b/src/content/writings/ja/configure-codex-app-with-token-station.md index 9ae931c..53a346a 100644 --- a/src/content/writings/ja/configure-codex-app-with-token-station.md +++ b/src/content/writings/ja/configure-codex-app-with-token-station.md @@ -136,7 +136,7 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY 3. 次を送る ```text -「Token Station テスト成功」とだけ返信してください + 「Token Station テスト成功」とだけ返信してください ``` 4. 正常な応答を確認する diff --git a/src/content/writings/ko/configure-codex-app-with-token-station.md b/src/content/writings/ko/configure-codex-app-with-token-station.md index 2952403..0495dfc 100644 --- a/src/content/writings/ko/configure-codex-app-with-token-station.md +++ b/src/content/writings/ko/configure-codex-app-with-token-station.md @@ -136,7 +136,7 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY 3. 다음 메시지 보내기 ```text -Token Station 테스트 성공이라고만 답하세요 + Token Station 테스트 성공이라고만 답하세요 ``` 4. 정상 응답 확인하기 From f8fc6fd58ad53a3126bc5d7d5986abeb0b3ba61d Mon Sep 17 00:00:00 2001 From: alabulei1 Date: Tue, 18 Aug 2026 01:17:03 +0800 Subject: [PATCH 7/8] Writings: bring ja/ko up to the same structure, fix screenshot term The ja and ko versions of the subagents article were compressed harder than the English one, so the same flattening fixed in the previous commit applied to them too. Restored in both languages: - The five named failure modes, in place of three dense paragraphs. This also recovers a line the translations dropped, that a subagent should get the minimum context its task needs. - The five rollout stages, which had been folded into one trailing sentence inside the failure-modes section, with no section of their own. - The summary, which neither translation had. - The main agent / subagent / tools section, which ja and ko never had at all. They compressed it into a single sentence and lost the tools layer entirely, which is the article's central point: tools, not the model, decide what an agent can touch. en, ja, and ko now all carry 12 H2 and 13 H3 sections. zh keeps its finer breakdown, which is the source structure. Also fixed "screenshot", which had slipped to "image" in four places (three ja, one ko) while the same warning used the correct word elsewhere in the same language. The cost-formula blocks are untouched. --- .../ja/codex-multi-model-subagents.md | 60 +++++++++++++++++-- ...de-app-with-cc-switch-and-token-station.md | 2 +- .../configure-codex-app-with-token-station.md | 2 +- .../configure-codex-cli-with-token-station.md | 2 +- .../ko/codex-multi-model-subagents.md | 60 +++++++++++++++++-- .../configure-codex-cli-with-token-station.md | 2 +- 6 files changed, 114 insertions(+), 14 deletions(-) diff --git a/src/content/writings/ja/codex-multi-model-subagents.md b/src/content/writings/ja/codex-multi-model-subagents.md index a794438..bfb4e6f 100644 --- a/src/content/writings/ja/codex-multi-model-subagents.md +++ b/src/content/writings/ja/codex-multi-model-subagents.md @@ -21,7 +21,13 @@ draft: false → 主 Agent が統合して受け入れ ``` -主Agentは計画、依存関係、リスク、ルーティング、競合解決、テスト、最終成果を担当します。Subagentには、特定モジュールのテスト、限定ディレクトリの移行、読み取り専用の調査など、入力と検証条件が明確な仕事を渡します。 +## 主Agent、Subagent、ツール + +主Agentは計画、依存関係、リスク、ルーティング、競合解決、テスト、最終的な引き渡しを担当します。コードの大半を書かないとしても、そのモデルは判断と修正において信頼できるものにしてください。 + +Subagentが最も力を発揮するのは、範囲が狭く検証できるタスクです。`src/auth`を編集せずに調査する、1つのモジュールにテストを追加する、指定したディレクトリを移行する、公式ドキュメントからAPIを抽出する、2つの実装を比較する、といった仕事が該当します。 + +Agentが実際に触れられる範囲を決めるのはモデルではなくツールです。ファイル、コード検索、テスト、ブラウザ、MCPサービス、Gitがその対象になります。ツール権限が広すぎたり書き込み範囲が曖昧だったりする状態は、どのモデルを選んでも埋め合わせられません。 ## ProfileとAgentの役割を区別する @@ -251,11 +257,27 @@ Security Reviewer: ## 失敗しやすい点 -1行の変更にSubagentを作らないでください。複数の書き込みAgentに同じファイルを触らせず、「完了」という報告はdiffとテストで確認します。 +### 1行の変更にSubagentを作らない + +Subagentを作るたびにコンテキストの受け渡しと調整のコストが発生します。分割が有効なのは、並行して実行できる、作業量が大きい、異なる専門性が必要、独立した検証が必要、または境界が非常に明確な場合です。 + +### 複数の書き込みAgentに同じファイルを触らせない + +書き込み範囲はディレクトリまたはモジュールで分けます。一方のAgentが実装し、もう一方は読み取り専用で審査します。依存関係のあるタスクは順番に実行し、最終的な統合は主Agentが行います。 + +### 主Agentは結果を無条件に信頼できない -API keyは環境変数や認証情報管理に保存します。第三者Providerへ送るプロンプトとコードについて、保持、学習利用、保存地域、コンプライアンス、外部送信禁止ディレクトリを確認してください。 +Subagentの「完了」は、そのAgentが完了したと考えているという意味にすぎません。主Agentはdiffを読み、テストを実行し、エラー出力を確認し、範囲外の変更がないことを確かめ、結果が元の要件を満たしているかを判断する必要があります。 -安いモデルでも、再試行と手戻りで総コストが上がる場合があります。 +### API keyと非公開コードを守る + +keyは環境変数、シークレット管理、またはOSの資格情報ストアから渡します。第三者Providerにタスクを渡すと、プロンプトとコードのコンテキストがそのサービスへ送られる可能性があります。非公開プロジェクトでは、データ保持、学習利用、保存地域、コンプライアンス要件、外部に出してはいけないディレクトリを、ルーティングを始める前に確認してください。 + +Subagentには、そのタスクに必要な最小限のコンテキストだけを渡します。 + +### 安いモデルが総コストを下げるとは限らない + +頻繁に失敗して再試行し、最後に強いモデルで手戻りが発生する安いモデルは、最初から強いモデルを使うより高くつくことがあります。 ```text 実効コスト = @@ -265,7 +287,35 @@ API keyは環境変数や認証情報管理に保存します。第三者Provide + 誤った変更の修正コスト ``` -最初は読み取り専用Researcherから始め、次に高速な作業Agent、書き込みAgent、独立Reviewerの順で追加します。実績データを集めてから自動ルーティングを有効にしてください。 +モデルは100万Tokenあたりの価格ではなく、タスク種別ごとの実測結果で判断します。 + +## 段階的に導入する + +### 第1段階:主Agentと読み取り専用Researcher + +まずリポジトリ検索、ドキュメント調査、構造化された報告を検証します。読み取り専用の権限なら、失敗したときのコストが小さく済みます。 + +### 第2段階:高速な作業Agentを追加する + +整形、テストの雛形、ドキュメントの補完、範囲を明示した一括置換を任せ、結果はツールで検証させます。 + +### 第3段階:実装Agentを追加する + +ツール呼び出しとファイル変更が安定してから、ワークスペースへの書き込み権限を与えます。書き込み範囲はディレクトリやファイル名で明確に限定します。 + +### 第4段階:独立Reviewerを追加する + +実装と審査を別のモデルに割り当て、それぞれが実際に何を見つけられるかを比べます。 + +### 第5段階:自動ルーティングの前に測る + +成功率、遅延、Token消費、再試行率、人手による手戻り時間を記録し、その記録に基づいてタスクとモデルの対応を調整します。 + +## まとめ + +成熟した複数モデルの構成は、タスクごとにAgentを増やすことはせず、常に最強または最安のモデルを選ぶこともしません。複雑さ、リスク、検証しやすさ、コンテキスト依存に応じて十分な実行者を選び、重要な判断、権限の管理、最終的な品質は主Agentに残します。 + +まず信頼できるProviderを1つ設定し、次に境界の明確な少数の役割を定義します。`--strict-config`で現在のCodexがフィールドを認識するかを確認し、読み取り専用のタスクから検証を始め、自動ルーティングと書き込み権限は最後に開放してください。 ## 参考資料 diff --git a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md index 2306601..55c2683 100644 --- a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -195,7 +195,7 @@ Token Station から完全なモデル ID をコピーし、対応する Sonnet ## セキュリティ上の注意 -- 実際の API Key をチュートリアルの画像に含めない +- 実際の API Key をチュートリアルのスクリーンショットに含めない - CC Switch の設定や認証情報を Git にコミットしない - 漏えいの可能性があれば、すぐに Key を無効化して再発行する - CC Switch や Claude Code App の更新前に、動作する Provider をバックアップする diff --git a/src/content/writings/ja/configure-codex-app-with-token-station.md b/src/content/writings/ja/configure-codex-app-with-token-station.md index 53a346a..34f41f2 100644 --- a/src/content/writings/ja/configure-codex-app-with-token-station.md +++ b/src/content/writings/ja/configure-codex-app-with-token-station.md @@ -21,7 +21,7 @@ Codex Appは`config.toml`でカスタムモデルProviderを登録できます 例では`openai/gpt-5.6-sol`を使います。Token Stationに表示される完全なモデルIDを確認してください。 -> 実際のAPI keyを`config.toml`、画像、チャット、リポジトリに記載しないでください。Codexには環境変数から読み込ませます。 +> 実際のAPI keyを`config.toml`、スクリーンショット、チャット、リポジトリに記載しないでください。Codexには環境変数から読み込ませます。 ## Token Station Providerを登録する diff --git a/src/content/writings/ja/configure-codex-cli-with-token-station.md b/src/content/writings/ja/configure-codex-cli-with-token-station.md index 2ab637d..3757b9f 100644 --- a/src/content/writings/ja/configure-codex-cli-with-token-station.md +++ b/src/content/writings/ja/configure-codex-cli-with-token-station.md @@ -19,7 +19,7 @@ Codex CLIは`config.toml`でカスタムモデルProviderを設定できます - 利用可能なToken Station API key - 対象モデルの利用権限と残高 -> 実際のAPI keyを文書、画像、チャット、リポジトリに公開しないでください。 +> 実際のAPI keyを文書、スクリーンショット、チャット、リポジトリに公開しないでください。 ## Token Station Providerを設定する diff --git a/src/content/writings/ko/codex-multi-model-subagents.md b/src/content/writings/ko/codex-multi-model-subagents.md index d631f68..6399a44 100644 --- a/src/content/writings/ko/codex-multi-model-subagents.md +++ b/src/content/writings/ko/codex-multi-model-subagents.md @@ -21,7 +21,13 @@ draft: false → 주 Agent가 통합하고 최종 승인 ``` -주 Agent는 계획, 의존성, 위험, 라우팅, 충돌 해결, 테스트, 최종 결과를 책임집니다. Subagent에는 특정 모듈 테스트, 제한된 디렉터리 마이그레이션, 읽기 전용 조사처럼 입력과 검증 조건이 분명한 작업을 배정합니다. +## 주 Agent, Subagent, 도구 + +주 Agent는 계획, 의존성, 위험, 라우팅, 충돌 해결, 테스트, 최종 인도를 책임집니다. 코드를 가장 많이 쓰지 않더라도 그 모델은 판단과 교정에서 신뢰할 수 있어야 합니다. + +Subagent는 범위가 좁고 검증 가능한 작업에서 가장 잘 동작합니다. `src/auth`를 수정하지 않고 조사하기, 한 모듈에 테스트를 추가하기, 지정된 디렉터리를 마이그레이션하기, 공식 문서에서 API를 추출하기, 두 구현을 비교하기 같은 작업입니다. + +Agent가 실제로 건드릴 수 있는 범위를 정하는 것은 모델이 아니라 도구입니다. 파일, 코드 검색, 테스트, 브라우저, MCP 서비스, Git이 그 대상입니다. 도구 권한이 너무 넓거나 쓰기 범위가 불분명한 상태는 어떤 모델을 골라도 보완되지 않습니다. ## Profile과 Agent 역할 구분 @@ -251,11 +257,27 @@ Security Reviewer: ## 자주 발생하는 문제 -한 줄 수정에 Subagent를 만들지 마세요. 여러 쓰기 Agent가 같은 파일을 수정하게 하지 말고, “완료”라는 보고는 diff와 테스트로 검증하세요. +### 한 줄 수정에 Subagent를 만들지 않는다 + +Subagent를 만들 때마다 컨텍스트 전달과 조정 비용이 발생합니다. 분할이 유리한 경우는 병렬로 실행할 수 있거나, 작업량이 크거나, 다른 전문성이 필요하거나, 독립적인 검증이 필요하거나, 경계가 매우 명확한 작업입니다. + +### 여러 쓰기 Agent가 같은 파일을 수정하지 않게 한다 + +쓰기 범위는 디렉터리나 모듈 단위로 나눕니다. 한 Agent가 구현하고 다른 Agent는 읽기 전용으로 검토하며, 의존 관계가 있는 작업은 순서대로 실행하고, 최종 통합은 주 Agent가 담당합니다. + +### 주 Agent는 결과를 무조건 신뢰할 수 없다 -API key는 환경 변수나 자격 증명 관리자에 저장합니다. 서드파티 Provider로 전송되는 프롬프트와 코드에 대해 보존, 학습 사용, 저장 지역, 규정 준수, 외부 전송 금지 디렉터리를 확인해야 합니다. +Subagent의 “완료”는 그 Agent가 끝났다고 판단했다는 뜻일 뿐입니다. 주 Agent는 여전히 diff를 읽고, 테스트를 실행하고, 오류 출력을 확인하고, 범위를 벗어난 수정이 없는지 확인하고, 결과가 원래 요구사항을 충족하는지 판단해야 합니다. -저렴한 모델도 재시도와 재작업 때문에 총비용이 커질 수 있습니다. +### API key와 비공개 코드를 보호한다 + +key는 환경 변수, 시크릿 관리자 또는 운영체제 자격 증명 저장소를 통해 전달합니다. 서드파티 Provider에 작업을 넘기면 프롬프트와 코드 컨텍스트가 그 서비스로 전송될 수 있습니다. 비공개 프로젝트라면 라우팅을 시작하기 전에 데이터 보존, 학습 사용, 저장 지역, 규정 준수 요건, 외부로 나가면 안 되는 디렉터리를 먼저 정리하세요. + +Subagent에는 해당 작업에 필요한 최소한의 컨텍스트만 전달합니다. + +### 저렴한 모델이 총비용을 낮추지는 않는다 + +자주 실패해 재시도하고 결국 강한 모델로 재작업하게 되는 저렴한 모델은, 처음부터 강한 모델을 쓰는 것보다 비싸질 수 있습니다. ```text 실질 비용 = @@ -265,7 +287,35 @@ API key는 환경 변수나 자격 증명 관리자에 저장합니다. 서드 + 잘못된 변경을 수정하는 비용 ``` -읽기 전용 Researcher부터 시작하고, 빠른 작업 Agent, 쓰기 Agent, 독립 Reviewer 순으로 추가하세요. 실제 성공률, 지연, 재시도, 사람의 재작업 시간을 기록한 뒤 자동 라우팅을 활성화합니다. +모델은 100만 Token당 가격이 아니라 작업 종류별 실측 결과로 판단합니다. + +## 단계별 도입 + +### 1단계: 주 Agent와 읽기 전용 Researcher + +먼저 저장소 검색, 문서 조사, 구조화된 보고를 검증합니다. 읽기 전용 권한이면 실패했을 때의 비용이 작습니다. + +### 2단계: 빠른 작업 Agent 추가 + +서식 정리, 테스트 골격, 문서 보완, 범위를 명시한 일괄 치환을 맡기고 결과는 도구로 검증하게 합니다. + +### 3단계: 구현 Agent 추가 + +도구 호출과 파일 수정이 안정된 뒤에 워크스페이스 쓰기 권한을 부여하고, 쓰기 범위는 디렉터리나 파일 이름으로 명확히 제한합니다. + +### 4단계: 독립 Reviewer 추가 + +구현과 검토를 서로 다른 모델에 배정하고, 각 모델이 실제로 무엇을 잡아내는지 비교합니다. + +### 5단계: 자동 라우팅 전에 측정 + +성공률, 지연, Token 소비, 재시도율, 사람의 재작업 시간을 기록하고, 그 기록에 따라 작업과 모델의 대응을 조정합니다. + +## 요약 + +성숙한 다중 모델 구성은 작업마다 Agent를 늘리지 않고, 항상 가장 강한 모델이나 가장 저렴한 모델을 고르지도 않습니다. 복잡도, 위험, 검증 가능성, 컨텍스트 의존도에 따라 충분한 실행자를 고르고, 중요한 결정과 권한 통제, 최종 품질은 주 Agent에 남깁니다. + +먼저 신뢰할 수 있는 Provider 하나를 설정하고, 경계가 분명한 소수의 역할을 정의하세요. `--strict-config`로 현재 Codex 버전이 필드를 인식하는지 확인하고, 읽기 전용 작업부터 검증하며, 자동 라우팅과 쓰기 권한은 마지막에 엽니다. ## 참고 자료 diff --git a/src/content/writings/ko/configure-codex-cli-with-token-station.md b/src/content/writings/ko/configure-codex-cli-with-token-station.md index 82db8c7..5919328 100644 --- a/src/content/writings/ko/configure-codex-cli-with-token-station.md +++ b/src/content/writings/ko/configure-codex-cli-with-token-station.md @@ -19,7 +19,7 @@ Codex CLI는 `config.toml`에서 사용자 지정 모델 Provider를 지원합 - 사용 가능한 Token Station API key - 대상 모델의 사용 권한과 잔액 -> 실제 API key를 문서, 이미지, 채팅 또는 저장소에 공개하지 마세요. +> 실제 API key를 문서, 스크린샷, 채팅 또는 저장소에 공개하지 마세요. ## Token Station Provider 설정 From c387dae349f19b2cb823c1ceeb55d49365dd1490 Mon Sep 17 00:00:00 2001 From: alabulei1 Date: Tue, 18 Aug 2026 01:22:38 +0800 Subject: [PATCH 8/8] Writings: port the section transitions to zh/ja/ko MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous passes added bridging sentences to the English only, which left the four languages reading differently at the same six junctions. Ported all of them, so every language gets the same reason for why a step follows the one before it: - Provider block to the per-OS sections, in all three config articles: the block names the environment variable but does not supply its value. - Codex App: a desktop app does not necessarily see what the shell sees. - Verification: a config file that parses is not evidence that requests reach Token Station, and a reply in the app is only half the evidence. - CC Switch local routing: the step most often skipped, and the reason the app keeps answering from its old service. zh already had one of these, in the Claude Code CLI article. That sentence is where the English version's good one came from; the other five junctions were bare in every language. Also applied the class-4 reorder at the routing section for ja and ko, which still had the two-sentence form where the second silently explained the first. zh already carried the causal connective. OS headings are left as they are per language: "Windows 配置", "Windowsでの設定", "Windows 설정" all read naturally, unlike the English "Configure Windows" that needed fixing. --- ...figure-claude-code-app-with-cc-switch-and-token-station.md | 2 +- .../ja/configure-claude-code-cli-with-token-station.md | 2 ++ .../writings/ja/configure-codex-app-with-token-station.md | 4 ++++ .../writings/ja/configure-codex-cli-with-token-station.md | 4 +++- ...figure-claude-code-app-with-cc-switch-and-token-station.md | 2 +- .../ko/configure-claude-code-cli-with-token-station.md | 2 ++ .../writings/ko/configure-codex-app-with-token-station.md | 4 ++++ .../writings/ko/configure-codex-cli-with-token-station.md | 4 +++- ...figure-claude-code-app-with-cc-switch-and-token-station.md | 2 +- .../zh/configure-claude-code-cli-with-token-station.md | 2 ++ .../writings/zh/configure-codex-app-with-token-station.md | 4 ++++ .../writings/zh/configure-codex-cli-with-token-station.md | 4 +++- 12 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md index 55c2683..52311e9 100644 --- a/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/ja/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -106,7 +106,7 @@ openai/gpt-5.6-sol ## CC Switch のローカルルーティングを有効にする -モデルマッピングは、ローカルで動作する CC Switch サービスによって適用されます。Provider を有効にするだけでは不十分です。 +この手順は最も飛ばされやすく、飛ばすとアプリが以前のサービスから返答し続ける原因になります。Provider を有効にするだけでは不十分で、モデルマッピングはローカルで動作する CC Switch サービスによって適用されるため、そのサービスが起動している必要があります。 1. **CC Switch Settings → Routing** を開く 2. **Show local routing switch on the home page** を有効にする diff --git a/src/content/writings/ja/configure-claude-code-cli-with-token-station.md b/src/content/writings/ja/configure-claude-code-cli-with-token-station.md index ba5ea2d..cc0f915 100644 --- a/src/content/writings/ja/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/ja/configure-claude-code-cli-with-token-station.md @@ -49,6 +49,8 @@ openai/gpt-5.6-sol `gpt-5.6-sol`のように省略しないでください。 +この3つの変数をどう読み込ませるかはOSによって異なります。 + ## Windowsでの設定 ### 一時設定 diff --git a/src/content/writings/ja/configure-codex-app-with-token-station.md b/src/content/writings/ja/configure-codex-app-with-token-station.md index 34f41f2..4154bd2 100644 --- a/src/content/writings/ja/configure-codex-app-with-token-station.md +++ b/src/content/writings/ja/configure-codex-app-with-token-station.md @@ -58,6 +58,8 @@ model_provider = "token_station" `base_url`は`/v1`までとし、`/responses`を追加しません。モデルIDのプロバイダー接頭辞も残します。 +Providerの設定は環境変数の名前を宣言するだけで、値そのものは渡しません。さらに、デスクトップアプリが見る環境は、ターミナルが見ているものと同じとは限りません。以下の3節でOSごとの手順を説明します。 + ## Windows:API keyを設定する **システムの詳細設定 → 環境変数**を開き、ユーザー環境変数を作成します。 @@ -131,6 +133,8 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY ## 経路を確認する +Codex Appが返答しても、それは証拠の半分にすぎません。経路の両端を確認します。 + 1. Codex Appを完全に終了して開き直す 2. 新しい会話を作成する 3. 次を送る diff --git a/src/content/writings/ja/configure-codex-cli-with-token-station.md b/src/content/writings/ja/configure-codex-cli-with-token-station.md index 3757b9f..658c17b 100644 --- a/src/content/writings/ja/configure-codex-cli-with-token-station.md +++ b/src/content/writings/ja/configure-codex-cli-with-token-station.md @@ -61,6 +61,8 @@ wire_api = "responses" 例は`openai/gpt-5.6-sol`です。Token Stationに表示される現在の完全なIDを使ってください。 +Providerの設定は環境変数の名前を宣言するだけで、値そのものは渡しません。そこはOSによって異なります。 + ## Windowsでの設定 ### 一時的にkeyを読み込む @@ -137,7 +139,7 @@ fi ## 設定を確認する -対話モードを起動します。 +`config.toml`が正しく解析されることは、リクエストがToken Stationに届いている証拠にはなりません。対話モードを起動します。 ```bash codex diff --git a/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md index 22d09fe..2900e36 100644 --- a/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/ko/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -108,7 +108,7 @@ openai/gpt-5.6-sol ## CC Switch 로컬 라우팅 활성화하기 -모델 매핑은 컴퓨터에서 실행되는 CC Switch 서비스가 적용합니다. Provider만 활성화해서는 충분하지 않습니다. +이 단계는 가장 자주 건너뛰는 단계이고, 건너뛰면 앱이 계속 이전 서비스로 응답하게 됩니다. Provider만 활성화하는 것으로는 부족합니다. 모델 매핑은 컴퓨터에서 실행되는 CC Switch 서비스가 적용하므로 그 서비스가 실행 중이어야 합니다. 1. **CC Switch Settings → Routing** 열기 2. **Show local routing switch on the home page** 켜기 diff --git a/src/content/writings/ko/configure-claude-code-cli-with-token-station.md b/src/content/writings/ko/configure-claude-code-cli-with-token-station.md index 84d4adc..72a9a42 100644 --- a/src/content/writings/ko/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/ko/configure-claude-code-cli-with-token-station.md @@ -47,6 +47,8 @@ openai/gpt-5.6-sol `gpt-5.6-sol`로 줄이지 마세요. +이 세 변수를 어떻게 불러오는지는 운영체제마다 다릅니다. + ## Windows 설정 ### 임시 설정 diff --git a/src/content/writings/ko/configure-codex-app-with-token-station.md b/src/content/writings/ko/configure-codex-app-with-token-station.md index 0495dfc..0e71763 100644 --- a/src/content/writings/ko/configure-codex-app-with-token-station.md +++ b/src/content/writings/ko/configure-codex-app-with-token-station.md @@ -58,6 +58,8 @@ model_provider = "token_station" `base_url`은 `/v1`까지만 입력하고 `/responses`를 추가하지 마세요. 모델 ID의 제공자 접두사도 유지합니다. +Provider 설정은 환경 변수의 이름만 지정하고 값은 제공하지 않습니다. 게다가 데스크톱 앱이 보는 환경은 터미널이 보는 환경과 같지 않을 수 있습니다. 다음 세 절에서 운영체제별 방법을 다룹니다. + ## Windows: API key 설정 **고급 시스템 설정 → 환경 변수**를 열고 사용자 변수를 만듭니다. @@ -131,6 +133,8 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY ## 전체 경로 검증 +Codex App이 응답하는 것은 증거의 절반일 뿐입니다. 경로의 양쪽 끝을 모두 확인하세요. + 1. Codex App을 완전히 종료하고 다시 열기 2. 새 대화 만들기 3. 다음 메시지 보내기 diff --git a/src/content/writings/ko/configure-codex-cli-with-token-station.md b/src/content/writings/ko/configure-codex-cli-with-token-station.md index 5919328..0bb1ce4 100644 --- a/src/content/writings/ko/configure-codex-cli-with-token-station.md +++ b/src/content/writings/ko/configure-codex-cli-with-token-station.md @@ -61,6 +61,8 @@ wire_api = "responses" 예시는 `openai/gpt-5.6-sol`을 사용합니다. Token Station에 표시되는 현재 전체 ID를 사용하세요. +Provider 설정은 환경 변수의 이름만 지정하고 값은 제공하지 않습니다. 값을 넣는 방법은 운영체제마다 다릅니다. + ## Windows 설정 ### key 임시 로드 @@ -137,7 +139,7 @@ fi ## 설정 검증 -대화형 세션을 시작합니다. +`config.toml`이 정상적으로 파싱된다는 것은 요청이 Token Station에 도달했다는 증거가 아닙니다. 대화형 세션을 시작합니다. ```bash codex diff --git a/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md b/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md index 99e96f2..315dc9d 100644 --- a/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md +++ b/src/content/writings/zh/configure-claude-code-app-with-cc-switch-and-token-station.md @@ -108,7 +108,7 @@ openai/gpt-5.6-sol ## 开启 CC Switch 本地路由 -模型映射由本机运行的 CC Switch 服务完成,因此只启用 Provider 还不够。 +这一步最容易被跳过,而跳过它正是应用继续用旧服务回复的原因。模型映射由本机运行的 CC Switch 服务完成,因此只启用 Provider 还不够。 1. 打开 **CC Switch 设置 → 路由** 2. 开启 **在主页显示本地路由开关** diff --git a/src/content/writings/zh/configure-claude-code-cli-with-token-station.md b/src/content/writings/zh/configure-claude-code-cli-with-token-station.md index bdf3c17..63fad16 100644 --- a/src/content/writings/zh/configure-claude-code-cli-with-token-station.md +++ b/src/content/writings/zh/configure-claude-code-cli-with-token-station.md @@ -49,6 +49,8 @@ openai/gpt-5.6-sol 不要简写为 `gpt-5.6-sol`。 +这三个变量的加载方式因操作系统而异。 + ## Windows 配置 ### 临时配置 diff --git a/src/content/writings/zh/configure-codex-app-with-token-station.md b/src/content/writings/zh/configure-codex-app-with-token-station.md index a59f5af..c06e3c6 100644 --- a/src/content/writings/zh/configure-codex-app-with-token-station.md +++ b/src/content/writings/zh/configure-codex-app-with-token-station.md @@ -60,6 +60,8 @@ model_provider = "token_station" `base_url` 只写到 `/v1`,不要手动添加 `/responses`。模型名称也要保留 `openai/` 等提供方前缀。 +Provider 配置只声明了环境变量的名字,并没有提供它的值;而桌面应用看到的环境未必和你的终端一致。下面三节分别说明各操作系统的做法。 + ## Windows:配置 API Key 打开 **高级系统设置 → 环境变量**,在“用户变量”区域新建: @@ -135,6 +137,8 @@ systemctl --user unset-environment TOKEN_STATION_API_KEY ## 端到端验证 +Codex App 能回复只是证据的一半。链路两端都要检查: + 1. 完全退出并重新打开 Codex App; 2. 新建对话; 3. 发送: diff --git a/src/content/writings/zh/configure-codex-cli-with-token-station.md b/src/content/writings/zh/configure-codex-cli-with-token-station.md index eed739d..73aa944 100644 --- a/src/content/writings/zh/configure-codex-cli-with-token-station.md +++ b/src/content/writings/zh/configure-codex-cli-with-token-station.md @@ -63,6 +63,8 @@ wire_api = "responses" 本文以 `openai/gpt-5.6-sol` 为例。实际使用时,以 Token Station 当前模型列表为准。 +Provider 配置只声明了环境变量的名字,并没有提供它的值。这一步因操作系统而异。 + ## Windows 配置 ### 临时加载 API Key @@ -139,7 +141,7 @@ fi ## 验证配置 -可以先启动交互模式: +`config.toml` 能被解析,并不等于请求真的到达了 Token Station。可以先启动交互模式: ```bash codex