Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion English/ai-stack/token-plan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

---

Expand Down
56 changes: 44 additions & 12 deletions English/ai-stack/token-plan/a-z-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down Expand Up @@ -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:
Expand All @@ -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`) |

Expand All @@ -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:

Expand All @@ -141,7 +150,7 @@ In the tool's Settings, fill in:
| **API Key** | `<your subscription-key>` |
| **Model** | `<model code>` — 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" %}
Expand Down Expand Up @@ -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="<your subscription-key>"
```

{% endtab %}

{% tab title="Windows PowerShell" %}

```powershell
$env:ANTHROPIC_BASE_URL = "https://tokenplan.api.greennode.ai"
$env:ANTHROPIC_AUTH_TOKEN = "<your subscription-key>"
```

{% 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
Expand Down Expand Up @@ -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 : <that person's own key>
Model : <model code>
```
Expand Down
6 changes: 3 additions & 3 deletions English/ai-stack/token-plan/buy-token-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Expand Down Expand Up @@ -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` |

Expand All @@ -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 %}

---
Expand Down
7 changes: 4 additions & 3 deletions English/ai-stack/token-plan/manage-token-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <subscription-key>` and `"model": "<model code>"` in the body (get the model code from the **Models** tab, e.g. `glm-5.2`).

Expand All @@ -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 %}

---
Expand Down
4 changes: 3 additions & 1 deletion Vietnamese/ai-stack/token-plan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

---

Expand Down
56 changes: 44 additions & 12 deletions Vietnamese/ai-stack/token-plan/huong-dan-a-z.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}
Expand Down Expand Up @@ -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á:
Expand All @@ -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`) |

Expand All @@ -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:

Expand All @@ -141,7 +150,7 @@ Vào phần Settings của tool, điền:
| **API Key** | `<subscription-key của bạn>` |
| **Model** | `<model code>` — 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" %}
Expand Down Expand Up @@ -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="<subscription-key của bạn>"
```

{% endtab %}

{% tab title="Windows PowerShell" %}

```powershell
$env:ANTHROPIC_BASE_URL = "https://tokenplan.api.greennode.ai"
$env:ANTHROPIC_AUTH_TOKEN = "<subscription-key của bạn>"
```

{% 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
Expand Down Expand Up @@ -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 : <key riêng của người đó>
Model : <model code>
```
Expand Down
Loading
Loading