Skip to content

Let's use AI to Earn!

docs: clarify environment-specific setup

Sakuraaf121272ca41
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 00000000..12dfff85
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,35 @@
+# AGENTS.md
+
+本文件定义 Codex 在 `AiToEarn` 仓库内的默认工作规则。
+
+## Communication
+
+- 默认使用简体中文回复。
+
+## Project Layout
+
+- `project/aitoearn-backend` 是 Nx + pnpm 后端工作区。
+- `project/aitoearn-web` 是 Next.js + pnpm 前端项目。
+- 根目录主要维护 README、Docker 部署文档、`docker-compose.yml` 和展示资源。
+
+## Package & Command Rules
+
+- backend/web 使用 `pnpm`。
+- 根目录没有统一 package,不要在根目录随手执行 install/build。
+- backend 改动优先在 `project/aitoearn-backend` 用 `pnpm nx ...` 验证,并遵循 `project/aitoearn-backend/CLAUDE.md`。
+- web 改动在 `project/aitoearn-web` 验证,优先使用 `pnpm run type-check` 和 `pnpm build`。
+- 纯文档改动至少运行 `git diff --check`。
+
+## Documentation Rules
+
+- 根 README 对外文档包含 `README.md`、`README_EN.md`、`README_JA.md`;涉及用户可见能力、安装、OpenClaw、MCP、Relay、API Key 或环境地址时默认三语同步。
+- Docker 部署说明涉及生产部署、环境变量或 `docker compose` 时,同步检查 `DOCKER_DEPLOYMENT_CN.md` 和 `DOCKER_DEPLOYMENT_EN.md`。
+- README 类改动保持最小可用改写,不要把参考文档整段复制进来。
+- 用户可见 README、skill、capability reference 只写当前能力与环境规则,不写 `dev`、测试环境、验证日期等来源说明。
+
+## Environment Rules
+
+- OpenClaw、MCP、Relay 都必须明确区分中国版和国际版环境:`*.aitoearn.cn` 属于中国版,`*.aitoearn.ai` 属于国际版。
+- 中国版 API Key 只能搭配 `aitoearn.cn` 相关 URL;国际版 API Key 只能搭配 `aitoearn.ai` 相关 URL。环境和 Key 不匹配会导致 401。
+- MCP 示例需要按环境区分 `https://aitoearn.cn/api/unified/mcp` / `https://aitoearn.ai/api/unified/mcp`,SSE 示例同理区分 `/api/unified/sse`。
+- Relay 示例需要按 `RELAY_API_KEY` 来源选择 `RELAY_SERVER_URL`:中国版使用 `https://aitoearn.cn/api`,国际版使用 `https://aitoearn.ai/api`。
diff --git a/README.md b/README.md
index 45b12ca2..279d93d9 100644
--- a/README.md
+++ b/README.md
@@ -164,9 +164,12 @@ AiToEarn 最核心的目标:**帮助每一位创作者赚钱**。
npx -y @aitoearn/openclaw-plugin-cli
```
-首次运行后会先让您选择环境,请注意,AitoEarn有两个环境,分别是中国版和国际版环境。
-如果使用中国版环境+国际版的key会导致401报错。
-请确保环境与key是匹配的。
+首次运行后会先让你选择环境并输入 API Key。请确保环境与 Key 匹配:
+
+- 中国版:使用 `aitoearn.cn` 获取的 API Key
+- 国际版:使用 `aitoearn.ai` 获取的 API Key
+
+环境和 Key 不匹配会导致 401。
安装完成后,你就可以在 OpenClaw 中直接接收并执行 AiToEarn 的赚钱任务:
@@ -180,6 +183,13 @@ npx -y @aitoearn/openclaw-plugin-cli
AiToEarn 支持所有兼容 MCP 协议的 AI 助手。以下是常见工具的配置方式:
+请根据 API Key 来源选择地址,环境和 Key 不匹配会导致 401:
+
+| 环境 | MCP 地址 | SSE 地址 |
+|------|---------|---------|
+| 中国版 | `https://aitoearn.cn/api/unified/mcp` | `https://aitoearn.cn/api/unified/sse` |
+| 国际版 | `https://aitoearn.ai/api/unified/mcp` | `https://aitoearn.ai/api/unified/sse` |
+
<details open>
<summary><b>Claude Desktop</b></summary>
@@ -251,6 +261,8 @@ docker compose up -d
在 `docker-compose.yml` 的 `aitoearn-server` 服务中添加(API Key 获取方式见 [上方说明](#get-api-key)):
+请根据 `RELAY_API_KEY` 来源选择 `RELAY_SERVER_URL`:中国版 Key 使用 `https://aitoearn.cn/api`,国际版 Key 使用 `https://aitoearn.ai/api`。环境和 Key 不匹配会导致 401。
+
```yaml
RELAY_SERVER_URL: https://aitoearn.ai/api
RELAY_API_KEY: 你的API-Key
diff --git a/README_EN.md b/README_EN.md
index b5ccf2b0..d74a3e7d 100644
--- a/README_EN.md
+++ b/README_EN.md
@@ -163,7 +163,7 @@ The simplest way — just open your browser:
npx -y @aitoearn/openclaw-plugin-cli
```
-On first run, follow the prompts to complete the required selections and enter your API Key to finish setup.
+On first run, select the environment and enter your API Key. Make sure they match: China uses an API Key from `aitoearn.cn`, and international uses one from `aitoearn.ai`. A mismatch returns 401.
After setup, you can receive and execute AiToEarn earning tasks directly inside OpenClaw:
@@ -177,6 +177,13 @@ After setup, you can receive and execute AiToEarn earning tasks directly inside
AiToEarn works with any MCP-compatible AI assistant. Here's how to configure the most popular ones:
+Choose the URL that matches your API Key. A mismatched environment and key returns 401:
+
+| Environment | MCP URL | SSE URL |
+|-------------|---------|---------|
+| China | `https://aitoearn.cn/api/unified/mcp` | `https://aitoearn.cn/api/unified/sse` |
+| International | `https://aitoearn.ai/api/unified/mcp` | `https://aitoearn.ai/api/unified/sse` |
+
<details open>
<summary><b>Claude Desktop</b></summary>
@@ -248,6 +255,8 @@ Open **[http://localhost:8080](http://localhost:8080)** and you're ready to go.
Add to `docker-compose.yml` under `aitoearn-server` (see [How to Get an API Key](#get-api-key)):
+Choose `RELAY_SERVER_URL` based on where `RELAY_API_KEY` was created: use `https://aitoearn.cn/api` for China keys and `https://aitoearn.ai/api` for international keys. A mismatch returns 401.
+
```yaml
RELAY_SERVER_URL: https://aitoearn.ai/api
RELAY_API_KEY: your-api-key
diff --git a/README_JA.md b/README_JA.md
index 303e5e6a..b2d9c618 100644
--- a/README_JA.md
+++ b/README_JA.md
@@ -168,7 +168,7 @@ AiToEarnブラウザ拡張機能を通じて、上記のすべてのプラット
npx -y @aitoearn/openclaw-plugin-cli
```
-初回実行時は案内に従って必要な項目を選択し、API Key を入力してインストールと設定を完了してください。
+初回実行時は環境を選択し、API Key を入力してください。中国版は `aitoearn.cn` の API Key、国際版は `aitoearn.ai` の API Key を使用します。環境と Key が一致しない場合は 401 になります。
設定後は、OpenClaw 内で AiToEarn の収益化タスクを直接受け取り実行できます。
@@ -182,6 +182,13 @@ npx -y @aitoearn/openclaw-plugin-cli
AiToEarnはMCPプロトコルに対応するすべてのAIアシスタントで動作します。一般的なツールの設定方法:
+API Key の取得元に合わせて URL を選択してください。環境と Key が一致しない場合は 401 になります。
+
+| 環境 | MCP URL | SSE URL |
+|------|---------|---------|
+| 中国版 | `https://aitoearn.cn/api/unified/mcp` | `https://aitoearn.cn/api/unified/sse` |
+| 国際版 | `https://aitoearn.ai/api/unified/mcp` | `https://aitoearn.ai/api/unified/sse` |
+
<details open>
<summary><b>Claude Desktop</b></summary>
@@ -253,6 +260,8 @@ docker compose up -d
`docker-compose.yml`の`aitoearn-server`サービスに以下を追加(API Keyの取得方法は[上記](#get-api-key)を参照):
+`RELAY_API_KEY` の取得元に合わせて `RELAY_SERVER_URL` を選択してください。中国版 Key は `https://aitoearn.cn/api`、国際版 Key は `https://aitoearn.ai/api` を使用します。環境と Key が一致しない場合は 401 になります。
+
```yaml
RELAY_SERVER_URL: https://aitoearn.ai/api
RELAY_API_KEY: あなたのAPI-Key