Skip to documentation
R9SR9S
Sign inGet started
On this page ↓

R9S Documentation

Build with one gateway.

Core endpoint: gw.r9s.ai/v1support@r9s.ai
On this page

Token Plan

Set up a dedicated Plan Key, send Token Plan requests, and understand included usage.

Quick start

  1. Open the Plan console, sign in, confirm your plan is active, and create or copy its dedicated Plan Key. Do not substitute a standard API key.
  2. Use https://gw.r9s.ai/v1 as the OpenAI-compatible API base URL, including /v1. For Anthropic-compatible clients, use https://gw.r9s.ai as the base URL, without /v1.
  3. Store the Plan Key on the server or in your tool’s secure credential store. Select glm-5.3-plan or glm-5.3-flash-plan.
Protocol Client base URL Full request URL
OpenAI-compatible https://gw.r9s.ai/v1 https://gw.r9s.ai/v1/chat/completions
Anthropic-compatible https://gw.r9s.ai https://gw.r9s.ai/v1/messages

Use the client base URL when configuring an SDK, not the full request URL. Anthropic-compatible clients append /v1/messages; do not add /v1 to ANTHROPIC_BASE_URL, or the path may become /v1/v1/messages. API requests require your Plan Key; opening an endpoint link in a browser does not authenticate the request.

export R9S_PLAN_BASE_URL="https://gw.r9s.ai/v1"
export R9S_PLAN_KEY="<R9S_PLAN_KEY>"

curl "${R9S_PLAN_BASE_URL%/}/chat/completions" \
  -H "Authorization: Bearer $R9S_PLAN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3-plan",
    "messages": [{"role": "user", "content": "Hello from Token Plan."}]
  }'

Use glm-5.3-flash-plan in the same request to select GLM-5.3-Flash. Both models share your plan’s billing-cycle allowance and rolling limits. Check model availability with the same Plan Key, not a different account key.

For tools that read Anthropic environment variables, set the Anthropic-compatible base URL and select the Plan models explicitly:

export ANTHROPIC_BASE_URL="https://gw.r9s.ai"
export ANTHROPIC_AUTH_TOKEN="<R9S_PLAN_KEY>"
export ANTHROPIC_MODEL="glm-5.3-plan"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-5.3-flash-plan"

These variables are client-specific settings, not a guarantee that every Anthropic SDK reads them automatically. Use your client’s documented base URL, authentication, and model settings.

A plan_model_required error means the Plan Key was paired with a non-Plan model. A plan_key_required error means a Plan-only model was paired with another key type. Correct the key/model pair instead of retrying it unchanged.

How included usage is measured

Included GLM-5.3 and GLM-5.3-Flash usage is measured at Token Plan rates: 1x off-peak; 2x from 14:00–18:00 (UTC+8). It is not cash or wallet balance.

The models have different base Token Plan rates. For an identical model and token mix, usage that consumes $1 of allowance off-peak consumes $2 during the peak window. The multiplier changes allowance consumption, not your plan’s fixed purchase price. When a limit is reached, requests pause until the applicable limit resets; there are no overage charges. Confirm the active rates, limits, and purchased terms in the Console.