From 30f4d1b7ebdf8d491757bd02e2ae81a49cd62524 Mon Sep 17 00:00:00 2001 From: Hana <115437281+Hana-Hasa@users.noreply.github.com> Date: Wed, 5 Aug 2026 10:40:50 +0700 Subject: [PATCH] =?UTF-8?q?[docs]=20AI=20Stack=20=E2=80=94=20Token=20Plan:?= =?UTF-8?q?=20document=20both=20Base=20URL=20forms=20(Anthropic=20vs=20Ope?= =?UTF-8?q?nAI)=20=E2=80=94=20VI=20+=20EN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every Token Plan page only gave the OpenAI-standard endpoint with /v1, so Claude Code / Claude Desktop users had no correct Base URL. Aligns with the values already published in the AI Coding guides (commit 48ff1bab): OpenAI standard -> https://tokenplan.api.greennode.ai/v1 Anthropic standard -> https://tokenplan.api.greennode.ai (no /v1) - README: Subscription Endpoint split into the two forms - A-Z guide: new section 5.6 for Anthropic-standard tools with ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN blocks; 5.1 and 5.2 relabelled as the OpenAI-standard path; section 5 opens with a standard-to-URL table; Package Detail and "3 values" tables list both forms; the 404 row now covers the wrong-form-for-your-standard case; the key handout block in 6.2 shows both - Buy / Manage: Subscription Endpoint and the PAYG comparison table list both forms; the Claude Code note gives the actual URL instead of asking the reader to check with support Co-Authored-By: Claude Opus 5 (1M context) --- English/ai-stack/token-plan/README.md | 4 +- English/ai-stack/token-plan/a-z-guide.md | 56 +++++++++++++++---- English/ai-stack/token-plan/buy-token-plan.md | 6 +- .../ai-stack/token-plan/manage-token-plan.md | 7 ++- Vietnamese/ai-stack/token-plan/README.md | 4 +- .../ai-stack/token-plan/huong-dan-a-z.md | 56 +++++++++++++++---- .../ai-stack/token-plan/mua-goi-token-plan.md | 6 +- .../ai-stack/token-plan/quan-ly-token-plan.md | 7 ++- 8 files changed, 108 insertions(+), 38 deletions(-) diff --git a/English/ai-stack/token-plan/README.md b/English/ai-stack/token-plan/README.md index b359e2b5..6d54232f 100644 --- a/English/ai-stack/token-plan/README.md +++ b/English/ai-stack/token-plan/README.md @@ -17,7 +17,9 @@ Portal (Packages / My Token Plans) ``` - **Portal:** Token Plan sits under the **API Key** group, next to **API Keys**, on **AI Platform**. -- **Subscription Endpoint:** `https://tokenplan.api.greennode.ai/v1` — OpenAI SDK compatible, separate from the GreenNode MaaS Endpoint used by PAYG API Keys. +- **Subscription Endpoint:** one shared host, `tokenplan.api.greennode.ai`, separate from the GreenNode MaaS Endpoint used by PAYG API Keys. Whether you append `/v1` depends on your tool's standard: + - **OpenAI**-standard tools (Cursor, OpenCode, Codex…): `https://tokenplan.api.greennode.ai/v1` + - **Anthropic**-standard tools (Claude Code, Claude Desktop): `https://tokenplan.api.greennode.ai` — **no** `/v1` --- diff --git a/English/ai-stack/token-plan/a-z-guide.md b/English/ai-stack/token-plan/a-z-guide.md index 217bf5e5..b850bd84 100644 --- a/English/ai-stack/token-plan/a-z-guide.md +++ b/English/ai-stack/token-plan/a-z-guide.md @@ -60,7 +60,7 @@ Not enough credit? Top up in the AI Platform Console before buying — the syste | **Duration** | The plan cycle (usually 30 days) | | **Tokens / Requests per cycle** | The allowance per cycle — tracked **independently per model**, with no transfer between them | | **Included Models** | The models you can call (Model, Status, **Model code**, Provider) — remember the **Model code**, you'll need to enter it in your tool shortly | -| **Subscription Endpoint** | `https://tokenplan.api.greennode.ai/v1` — this is the **Base URL** you will use | +| **Subscription Endpoint** | `https://tokenplan.api.greennode.ai` — this is the **Base URL** you will use. OpenAI-standard tools append `/v1`, Anthropic-standard tools do **not** — see [Section 5](#5-set-it-up-in-the-tool-running-your-agent) | | **What happens when activated** | What happens right after activation | {% hint style="warning" %} @@ -106,7 +106,9 @@ The **Plan Detail** page has 2 tabs — you need information from both: **The `Models` tab** → grab 2 things: -- The **Gateway base URL** shared by the whole plan: `https://tokenplan.api.greennode.ai/v1` +- The **Gateway base URL** shared by the whole plan — pick the form that matches your tool's standard: + - **OpenAI**-standard tools (Cursor, OpenCode, Codex…): `https://tokenplan.api.greennode.ai/v1` + - **Anthropic**-standard tools (Claude Code, Claude Desktop): `https://tokenplan.api.greennode.ai` — **no** `/v1` - The **Model code** of the model you want (e.g. `glm-5.2`) — copy it exactly, one wrong character breaks the call **The `Subscription keys` tab** → grab the key: @@ -117,7 +119,7 @@ Jot these 3 values down: | Information | Value | |---|---| -| **Base URL** | `https://tokenplan.api.greennode.ai/v1` | +| **Base URL** | `https://tokenplan.api.greennode.ai/v1` (OpenAI standard) or `https://tokenplan.api.greennode.ai` (Anthropic standard, **no** `/v1`) | | **API key** | the subscription-key you just copied | | **Model** | the model code from the Models tab (e.g. `glm-5.2`) | @@ -129,9 +131,16 @@ A subscription-key is a **secret** — anyone holding it can call models and bur ## 5. Set it up in the tool running your agent -The Token Plan Subscription Endpoint follows the **OpenAI-compatible** standard. That means any tool that lets you change `base_url` in the OpenAI format will work — just enter the 3 values from Section 4 and change nothing else. +Token Plan uses one shared host for every tool — the two standards differ only in the `/v1` suffix and in the environment variable names: + +| Tool standard | Base URL to enter | +|---|---| +| **OpenAI** (Cursor, Continue.dev, OpenCode, Codex, LiteLLM, OpenAI SDK…) | `https://tokenplan.api.greennode.ai/v1` — **with** `/v1` | +| **Anthropic** (Claude Code, Claude Desktop, Anthropic SDK) | `https://tokenplan.api.greennode.ai` — **without** `/v1` | + +Nothing else changes — you still only need the 3 values from Section 4. -### 5.1 Tools with built-in config fields (Cursor, Continue.dev, and similar) +### 5.1 OpenAI-standard tools with built-in config fields (Cursor, Continue.dev, and similar) In the tool's Settings, fill in: @@ -141,7 +150,7 @@ In the tool's Settings, fill in: | **API Key** | `` | | **Model** | `` — e.g. `glm-5.2` | -### 5.2 Tools that read environment variables (CLI) +### 5.2 OpenAI-standard tools that read environment variables (CLI) {% tabs %} {% tab title="macOS / Linux / WSL" %} @@ -211,18 +220,40 @@ curl https://tokenplan.api.greennode.ai/v1/chat/completions \ | `401 Unauthorized` | Wrong key, key Disabled, or characters missing from the copy | Re-copy the key from the **Subscription keys** tab, check Status = `ACTIVE` | | `403 Forbidden` | Calling a model **not included in the plan** | Only call models listed in that plan's **Models** tab | | `402 Payment Required` | The plan has expired or was deleted | **Buy again** or turn Auto-renew back on | -| `404 Not Found` | Base URL missing `/v1` | The Base URL must end with `/v1` | +| `404 Not Found` | The Base URL doesn't match your tool's standard | OpenAI-standard tools: the Base URL must end with `/v1`. Anthropic-standard tools (Claude Code): the Base URL must **not** have `/v1` | | Requests run out of tokens mid-cycle | That model's token pool hit 0 | Wait for the new cycle, buy another plan, or switch to a PAYG API Key for now | | Response parse error | The tool appends `/v1` to the base URL itself | Try dropping `/v1` if the tool handles it for you | +### 5.6 Anthropic-standard tools (Claude Code, Claude Desktop) + +These tools speak the Anthropic protocol rather than OpenAI, so the Base URL is the **same host without `/v1`**, and the environment variable names differ too: + +{% tabs %} +{% tab title="macOS / Linux / WSL" %} + +```bash +export ANTHROPIC_BASE_URL="https://tokenplan.api.greennode.ai" +export ANTHROPIC_AUTH_TOKEN="" +``` + +{% endtab %} + +{% tab title="Windows PowerShell" %} + +```powershell +$env:ANTHROPIC_BASE_URL = "https://tokenplan.api.greennode.ai" +$env:ANTHROPIC_AUTH_TOKEN = "" +``` + +{% endtab %} +{% endtabs %} + +Full walkthrough: [Claude Code](../ai-coding/cli-tools/claude-code.md). + 📎 *Detailed configuration for specific tools (LiteLLM, Cursor, Continue.dev, Node.js SDK…): [Connect OpenAI-compatible Clients to GreenNode MaaS](../ai-coding/connect-openai-compatible-to-maas.md) — the steps stay the same, just point the Base URL and key at your Token Plan values from Section 4.* 📎 *Supported tools and how to pick the right one: [AI Coding](../ai-coding/README.md) · [Getting Started with AI Coding](../ai-coding/getting-started.md) · [CLI Tools](../ai-coding/cli-tools/README.md)* -{% hint style="warning" %} -**Claude Code / the Anthropic SDK** follow the Anthropic standard (the base URL has **no** `/v1`), which differs from the OpenAI-compatible Subscription Endpoint above. If you want to use that family of tools, see [Claude Code](../ai-coding/cli-tools/claude-code.md) and confirm the applicable Token Plan endpoint with the support team. -{% endhint %} - --- ## 6. Manage: issue a key to each member @@ -278,7 +309,8 @@ The new key appears with status `ACTIVE` and automatically shows up on the [Acce **Step 3 — Hand the key to the member.** Send each person exactly 3 values: ``` -Base URL : https://tokenplan.api.greennode.ai/v1 +Base URL : https://tokenplan.api.greennode.ai/v1 # OpenAI-standard tools (Cursor, OpenCode, Codex…) + https://tokenplan.api.greennode.ai # Anthropic-standard tools (Claude Code, Claude Desktop) API key : Model : ``` diff --git a/English/ai-stack/token-plan/buy-token-plan.md b/English/ai-stack/token-plan/buy-token-plan.md index d8023584..d60c0815 100644 --- a/English/ai-stack/token-plan/buy-token-plan.md +++ b/English/ai-stack/token-plan/buy-token-plan.md @@ -23,7 +23,7 @@ **Step 2: View details before buying** 1. Click a Plan Type to open **Package Detail** -2. Review Max keys, Model count, Duration, the token/request allowance per cycle, the **Included Models** table (Model, Status, Model code, Provider), **What happens when activated**, and the **Subscription Endpoint** (`https://tokenplan.api.greennode.ai/v1`, OpenAI SDK compatible) +2. Review Max keys, Model count, Duration, the token/request allowance per cycle, the **Included Models** table (Model, Status, Model code, Provider), **What happens when activated**, and the **Subscription Endpoint** — host `tokenplan.api.greennode.ai`, with `/v1` for OpenAI-standard tools and **no** `/v1` for Anthropic-standard tools {% hint style="warning" %} Once purchased, a plan **cannot be swapped for a different Plan Type or returned on request**. To stop a plan mid-cycle, use **Delete** instead — the unused allowance for the current cycle is refunded pro rata to Credits (see [Manage Token Plan](manage-token-plan.md)). @@ -71,7 +71,7 @@ To let an AI coding tool call the models in your plan, you need exactly **3 valu | Value | Where to get it | |---|---| -| **Base URL** | `https://tokenplan.api.greennode.ai/v1` — the **Subscription Endpoint** in Package Detail | +| **Base URL** | The **Subscription Endpoint** in Package Detail — `https://tokenplan.api.greennode.ai/v1` for OpenAI-standard tools, `https://tokenplan.api.greennode.ai` (**no** `/v1`) for Anthropic-standard tools such as Claude Code | | **API key** | The **Subscription keys** tab in Plan Detail — use the built-in `default-key` or one you create | | **Model code** | The **Models** tab in Plan Detail — e.g. `glm-5.2` | @@ -88,7 +88,7 @@ With all 3 values in hand, pick the guide for the tool you use: | Add an MCP Server to your tool | [Using MCP Servers with AI Coding](../ai-coding/mcp-servers.md) | {% hint style="info" %} -The AI Coding pages are written for PAYG API Keys. With Token Plan, keep every step exactly the same and swap just 2 values: **Base URL** to the Subscription Endpoint above, and **API key** to your plan's subscription-key. +The AI Coding pages are written for PAYG API Keys. With Token Plan, keep every step exactly the same and swap just 2 values: **API key** to your plan's subscription-key, and **Base URL** to the Subscription Endpoint above — in the form your tool's standard expects (`/v1` for OpenAI, no `/v1` for Anthropic). {% endhint %} --- diff --git a/English/ai-stack/token-plan/manage-token-plan.md b/English/ai-stack/token-plan/manage-token-plan.md index 102366f6..abaec1f3 100644 --- a/English/ai-stack/token-plan/manage-token-plan.md +++ b/English/ai-stack/token-plan/manage-token-plan.md @@ -152,9 +152,10 @@ Once you have a subscription-key and the model is included in the plan, calling | | PAYG API Key | Subscription-key (Token Plan) | |---|---|---| -| Base URL | GreenNode MaaS Endpoint | `https://tokenplan.api.greennode.ai/v1` | +| Base URL — **OpenAI**-standard tools | GreenNode MaaS Endpoint + `/v1` | `https://tokenplan.api.greennode.ai/v1` | +| Base URL — **Anthropic**-standard tools | GreenNode MaaS Endpoint (**no** `/v1`) | `https://tokenplan.api.greennode.ai` (**no** `/v1`) | | Key | API Key | Subscription-key | -| Compatibility | OpenAI SDK | OpenAI SDK | +| Compatibility | OpenAI SDK / Anthropic SDK | OpenAI SDK / Anthropic SDK | Send a `POST` request to the endpoint above with the header `Authorization: Bearer ` and `"model": ""` in the body (get the model code from the **Models** tab, e.g. `glm-5.2`). @@ -173,7 +174,7 @@ When you issue a subscription-key to a team member, send the matching guide alon Those pages are written for PAYG API Keys — keep every step the same and only swap the Base URL and API key per the comparison table above. {% hint style="warning" %} -**Claude Code / the Anthropic SDK** follow the Anthropic standard (the base URL has **no** `/v1`), which differs from the OpenAI-compatible Subscription Endpoint. See [Claude Code](../ai-coding/cli-tools/claude-code.md) and confirm the applicable Token Plan endpoint with the support team. +**Claude Code / Claude Desktop / the Anthropic SDK** follow the Anthropic standard: the Base URL is `https://tokenplan.api.greennode.ai` — the same host but **without** `/v1`, and they read `ANTHROPIC_BASE_URL` / `ANTHROPIC_AUTH_TOKEN` instead of `OPENAI_*`. See [Claude Code](../ai-coding/cli-tools/claude-code.md). {% endhint %} --- diff --git a/Vietnamese/ai-stack/token-plan/README.md b/Vietnamese/ai-stack/token-plan/README.md index 7cb48ad9..447c07d7 100644 --- a/Vietnamese/ai-stack/token-plan/README.md +++ b/Vietnamese/ai-stack/token-plan/README.md @@ -17,7 +17,9 @@ Portal (Packages / My Token Plans) ``` - **Portal:** Token Plan nằm trong nhóm **API Key**, cùng cấp với **API Keys**, trên **AI Platform**. -- **Subscription Endpoint:** `https://tokenplan.api.greennode.ai/v1` — tương thích OpenAI SDK, tách biệt với GreenNode MaaS Endpoint dùng cho API Key PAYG. +- **Subscription Endpoint:** dùng chung một host `tokenplan.api.greennode.ai`, tách biệt với GreenNode MaaS Endpoint dùng cho API Key PAYG. Có thêm hậu tố `/v1` hay không là tuỳ chuẩn của tool: + - Tool chuẩn **OpenAI** (Cursor, OpenCode, Codex…): `https://tokenplan.api.greennode.ai/v1` + - Tool chuẩn **Anthropic** (Claude Code, Claude Desktop): `https://tokenplan.api.greennode.ai` — **không** có `/v1` --- diff --git a/Vietnamese/ai-stack/token-plan/huong-dan-a-z.md b/Vietnamese/ai-stack/token-plan/huong-dan-a-z.md index 6b98df46..54843bf3 100644 --- a/Vietnamese/ai-stack/token-plan/huong-dan-a-z.md +++ b/Vietnamese/ai-stack/token-plan/huong-dan-a-z.md @@ -60,7 +60,7 @@ Credit chưa đủ? Nạp thêm tại AI Platform Console trước khi mua — h | **Duration** | Chu kỳ gói (thường 30 ngày) | | **Tokens / Requests per cycle** | Hạn mức mỗi chu kỳ — tính **riêng cho từng model**, không bù trừ qua lại | | **Included Models** | Danh sách model được gọi (Model, Status, **Model code**, Provider) — nhớ **Model code**, lát nữa cần điền vào tool | -| **Subscription Endpoint** | `https://tokenplan.api.greennode.ai/v1` — chính là **Base URL** bạn sẽ dùng | +| **Subscription Endpoint** | `https://tokenplan.api.greennode.ai` — chính là **Base URL** bạn sẽ dùng. Tool chuẩn OpenAI thêm `/v1` ở cuối, tool chuẩn Anthropic thì **không** — xem [Mục 5](#5-setup-vao-tool-dang-chay-agent) | | **What happens when activated** | Điều gì xảy ra ngay sau khi kích hoạt | {% hint style="warning" %} @@ -106,7 +106,9 @@ Trang **Plan Detail** có 2 tab — bạn cần lấy thông tin ở cả hai: **Tab `Models`** → lấy 2 thứ: -- **Gateway base URL** dùng chung cho cả gói: `https://tokenplan.api.greennode.ai/v1` +- **Gateway base URL** dùng chung cho cả gói — chọn dạng theo chuẩn của tool: + - Tool chuẩn **OpenAI** (Cursor, OpenCode, Codex…): `https://tokenplan.api.greennode.ai/v1` + - Tool chuẩn **Anthropic** (Claude Code, Claude Desktop): `https://tokenplan.api.greennode.ai` — **không** có `/v1` - **Model code** của model muốn dùng (ví dụ `glm-5.2`) — copy chính xác, sai một ký tự là lỗi **Tab `Subscription keys`** → lấy chìa khoá: @@ -117,7 +119,7 @@ Chép 3 giá trị này ra Notepad: | Thông tin | Giá trị | | ------------------ | ---------------------------------------------- | -| **Base URL** | `https://tokenplan.api.greennode.ai/v1` | +| **Base URL** | `https://tokenplan.api.greennode.ai/v1` (chuẩn OpenAI) hoặc `https://tokenplan.api.greennode.ai` (chuẩn Anthropic, **không** `/v1`) | | **API key** | subscription-key vừa copy | | **Model** | model code từ tab Models (ví dụ `glm-5.2`) | @@ -129,9 +131,16 @@ Subscription-key là **bí mật** — ai cầm được key là gọi được ## 5. Setup vào tool đang chạy agent -Subscription Endpoint của Token Plan theo chuẩn **OpenAI-compatible**. Nghĩa là bất kỳ tool nào cho phép đổi `base_url` theo format OpenAI đều dùng được — chỉ cần điền 3 giá trị ở Mục 4, không đổi gì khác. +Token Plan dùng chung một host cho mọi tool — hai chuẩn chỉ khác nhau ở hậu tố `/v1` và ở tên biến môi trường: -### 5.1 Tool có ô cấu hình sẵn (Cursor, Continue.dev, và tương tự) +| Chuẩn của tool | Base URL điền vào | +|---|---| +| **OpenAI** (Cursor, Continue.dev, OpenCode, Codex, LiteLLM, OpenAI SDK…) | `https://tokenplan.api.greennode.ai/v1` — **có** `/v1` | +| **Anthropic** (Claude Code, Claude Desktop, Anthropic SDK) | `https://tokenplan.api.greennode.ai` — **không** có `/v1` | + +Ngoài Base URL thì không đổi gì khác — vẫn đúng 3 giá trị ở Mục 4. + +### 5.1 Tool chuẩn OpenAI có ô cấu hình sẵn (Cursor, Continue.dev, và tương tự) Vào phần Settings của tool, điền: @@ -141,7 +150,7 @@ Vào phần Settings của tool, điền: | **API Key** | `` | | **Model** | `` — ví dụ `glm-5.2` | -### 5.2 Tool đọc biến môi trường (CLI) +### 5.2 Tool chuẩn OpenAI đọc biến môi trường (CLI) {% tabs %} {% tab title="macOS / Linux / WSL" %} @@ -211,18 +220,40 @@ curl https://tokenplan.api.greennode.ai/v1/chat/completions \ | `401 Unauthorized` | Key sai, key bị Disable, hoặc copy thiếu ký tự | Copy lại key ở tab **Subscription keys**, kiểm tra Status = `ACTIVE` | | `403 Forbidden` | Gọi model **không nằm trong gói** | Chỉ gọi model có trong tab **Models** của gói đó | | `402 Payment Required` | Gói đã hết hạn hoặc đã bị xoá | Mua lại (**Buy again**) hoặc bật lại Auto-renew | -| `404 Not Found` | Base URL thiếu `/v1` | Base URL phải kết thúc bằng `/v1` | +| `404 Not Found` | Base URL sai dạng so với chuẩn của tool | Tool chuẩn OpenAI: Base URL phải kết thúc bằng `/v1`. Tool chuẩn Anthropic (Claude Code): Base URL **không** được có `/v1` | | Request hết token giữa chừng | Pool token của model đó đã về 0 | Đợi chu kỳ mới, mua thêm 1 gói, hoặc tạm chuyển sang API Key PAYG | | Response lỗi parse | Tool tự nối `/v1` vào base URL | Thử bỏ `/v1` nếu tool tự xử lý | +### 5.6 Tool chuẩn Anthropic (Claude Code, Claude Desktop) + +Nhóm này nói giao thức Anthropic chứ không phải OpenAI, nên Base URL là **cùng host nhưng không có `/v1`**, và tên biến môi trường cũng khác: + +{% tabs %} +{% tab title="macOS / Linux / WSL" %} + +```bash +export ANTHROPIC_BASE_URL="https://tokenplan.api.greennode.ai" +export ANTHROPIC_AUTH_TOKEN="" +``` + +{% endtab %} + +{% tab title="Windows PowerShell" %} + +```powershell +$env:ANTHROPIC_BASE_URL = "https://tokenplan.api.greennode.ai" +$env:ANTHROPIC_AUTH_TOKEN = "" +``` + +{% endtab %} +{% endtabs %} + +Hướng dẫn đầy đủ: [Kết nối Claude Code với GreenNode MaaS](../ai-coding/dong-lenh/claude-code.md). + 📎 *Cấu hình chi tiết cho từng tool cụ thể (LiteLLM, Cursor, Continue.dev, Node.js SDK…): [Kết nối OpenAI-compatible với GreenNode MaaS](../ai-coding/ket-noi-openai-compatible-voi-maas.md) — các bước giữ nguyên, chỉ đổi Base URL và key sang giá trị Token Plan ở Mục 4.* 📎 *Danh sách tool đang hỗ trợ và cách chọn tool phù hợp: [AI Coding](../ai-coding/README.md) · [Bắt đầu với AI Coding](../ai-coding/bat-dau.md) · [Nhóm Dòng lệnh (CLI)](../ai-coding/dong-lenh/README.md)* -{% hint style="warning" %} -**Claude Code / Anthropic SDK** dùng chuẩn Anthropic (base URL **không** có `/v1`), khác với Subscription Endpoint OpenAI-compatible ở trên. Nếu bạn muốn dùng nhóm tool này, xem [Kết nối Claude Code với GreenNode MaaS](../ai-coding/dong-lenh/claude-code.md) và xác nhận với đội hỗ trợ về endpoint áp dụng cho Token Plan. -{% endhint %} - --- ## 6. Quản lý: cấp phát cho từng thành viên @@ -278,7 +309,8 @@ Key mới xuất hiện với trạng thái `ACTIVE`, đồng thời tự độn **Bước 3 — Giao key cho thành viên.** Gửi cho mỗi người đúng 3 giá trị: ``` -Base URL : https://tokenplan.api.greennode.ai/v1 +Base URL : https://tokenplan.api.greennode.ai/v1 # tool chuẩn OpenAI (Cursor, OpenCode, Codex…) + https://tokenplan.api.greennode.ai # tool chuẩn Anthropic (Claude Code, Claude Desktop) API key : Model : ``` diff --git a/Vietnamese/ai-stack/token-plan/mua-goi-token-plan.md b/Vietnamese/ai-stack/token-plan/mua-goi-token-plan.md index 9efa8d1f..c7d04f85 100644 --- a/Vietnamese/ai-stack/token-plan/mua-goi-token-plan.md +++ b/Vietnamese/ai-stack/token-plan/mua-goi-token-plan.md @@ -23,7 +23,7 @@ **Bước 2: Xem chi tiết trước khi mua** 1. Nhấn vào 1 Plan Type để mở **Package Detail** -2. Xem đầy đủ: số Max keys, số Model, Duration, hạn mức token/request mỗi chu kỳ, danh sách **Included Models** (Model, Status, Model code, Provider), mục **What happens when activated**, và **Subscription Endpoint** (`https://tokenplan.api.greennode.ai/v1`, tương thích OpenAI SDK) +2. Xem đầy đủ: số Max keys, số Model, Duration, hạn mức token/request mỗi chu kỳ, danh sách **Included Models** (Model, Status, Model code, Provider), mục **What happens when activated**, và **Subscription Endpoint** — host `tokenplan.api.greennode.ai`, thêm `/v1` cho tool chuẩn OpenAI và **không** có `/v1` cho tool chuẩn Anthropic {% hint style="warning" %} Gói đã mua **không thể đổi sang Plan Type khác hoặc trả lại theo yêu cầu tùy ý**. Nếu cần dừng gói giữa chu kỳ, dùng action **Delete** — phần hạn mức chưa dùng của chu kỳ hiện tại sẽ được hoàn lại pro rata vào Credits (xem [Quản lý Token Plan](quan-ly-token-plan.md)). @@ -71,7 +71,7 @@ Gói xuất hiện trong **My Token Plans** với trạng thái `ACTIVE`, **Auto | Giá trị | Lấy ở đâu | |---|---| -| **Base URL** | `https://tokenplan.api.greennode.ai/v1` — mục **Subscription Endpoint** trong Package Detail | +| **Base URL** | Mục **Subscription Endpoint** trong Package Detail — `https://tokenplan.api.greennode.ai/v1` cho tool chuẩn OpenAI, `https://tokenplan.api.greennode.ai` (**không** `/v1`) cho tool chuẩn Anthropic như Claude Code | | **API key** | Tab **Subscription keys** trong Plan Detail — dùng `default-key` có sẵn hoặc key bạn tự tạo | | **Model code** | Tab **Models** trong Plan Detail — ví dụ `glm-5.2` | @@ -88,7 +88,7 @@ Có đủ 3 giá trị rồi thì chọn hướng dẫn theo tool đang dùng: | Thêm MCP Server vào tool | [Dùng MCP Server với AI Coding](../ai-coding/mcp-openrouter.md) | {% hint style="info" %} -Các trang AI Coding viết theo API Key PAYG. Dùng Token Plan thì giữ nguyên toàn bộ các bước, chỉ đổi 2 giá trị: **Base URL** thành Subscription Endpoint ở trên và **API key** thành subscription-key của gói. +Các trang AI Coding viết theo API Key PAYG. Dùng Token Plan thì giữ nguyên toàn bộ các bước, chỉ đổi 2 giá trị: **API key** thành subscription-key của gói, và **Base URL** thành Subscription Endpoint ở trên — nhớ đúng dạng theo chuẩn của tool (`/v1` cho OpenAI, không `/v1` cho Anthropic). {% endhint %} --- diff --git a/Vietnamese/ai-stack/token-plan/quan-ly-token-plan.md b/Vietnamese/ai-stack/token-plan/quan-ly-token-plan.md index 1548b2af..c4d616d6 100644 --- a/Vietnamese/ai-stack/token-plan/quan-ly-token-plan.md +++ b/Vietnamese/ai-stack/token-plan/quan-ly-token-plan.md @@ -152,9 +152,10 @@ Sau khi có subscription-key và model nằm trong gói, cách gọi model **ho | | API Key PAYG | Subscription-key (Token Plan) | |---|---|---| -| Base URL | GreenNode MaaS Endpoint | `https://tokenplan.api.greennode.ai/v1` | +| Base URL — tool chuẩn **OpenAI** | GreenNode MaaS Endpoint + `/v1` | `https://tokenplan.api.greennode.ai/v1` | +| Base URL — tool chuẩn **Anthropic** | GreenNode MaaS Endpoint (**không** `/v1`) | `https://tokenplan.api.greennode.ai` (**không** `/v1`) | | Key | API Key | Subscription-key | -| Tương thích | OpenAI SDK | OpenAI SDK | +| Tương thích | OpenAI SDK / Anthropic SDK | OpenAI SDK / Anthropic SDK | Gửi request `POST` tới endpoint trên với header `Authorization: Bearer ` và trường `"model": ""` trong body (model code lấy từ tab **Models**, ví dụ `glm-5.2`). @@ -173,7 +174,7 @@ Khi cấp subscription-key cho một thành viên, gửi kèm link tương ứng Các trang trên viết theo API Key PAYG — giữ nguyên mọi bước, chỉ đổi Base URL và API key theo bảng so sánh ở trên. {% hint style="warning" %} -**Claude Code / Anthropic SDK** dùng chuẩn Anthropic (base URL **không** có `/v1`), khác với Subscription Endpoint OpenAI-compatible. Xem [Claude Code](../ai-coding/dong-lenh/claude-code.md) và xác nhận với đội hỗ trợ về endpoint áp dụng cho Token Plan. +**Claude Code / Claude Desktop / Anthropic SDK** dùng chuẩn Anthropic: Base URL là `https://tokenplan.api.greennode.ai` — cùng host nhưng **không** có `/v1`, và dùng biến `ANTHROPIC_BASE_URL` / `ANTHROPIC_AUTH_TOKEN` thay vì `OPENAI_*`. Xem [Claude Code](../ai-coding/dong-lenh/claude-code.md). {% endhint %} ---