Quick Start

Get integrated in 5 minutes and start using every model on Calgine Tokens right away.

Step 1: Create an Account

Sign up at the Calgine Tokens Console. Once registered, you'll need the following two configuration values:

Variable Value
BASE_URL https://api.calgine.com.cn
API_KEY An API token you create in the console

Step 2: Create an API Key

Go to Workspace → API Tokens and click "Add Token". Once created, the system will display your API Key. Copy it and store it securely.

Step 3: Make Your First Request

Replace API_KEY with the token you just created. BASE_URL is always https://api.calgine.com.cn.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.calgine.com.cn/v1",
    api_key="API_KEY",
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message.content)

Anthropic Protocol

If you use Claude Code, Cursor, or other tools built on the Anthropic SDK, you can use the Anthropic-compatible endpoint directly:

import anthropic

client = anthropic.Anthropic(
    base_url="https://api.calgine.com.cn/anthropic",
    api_key="API_KEY",
)

message = client.messages.create(
    model="claude-opus-4-5-20251101",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}]
)

print(message.content[0].text)

Next Steps

  • Providers & Routing: Learn how to configure provider routing to prioritize official direct connections or low-cost channels
  • User Levels: Learn about user levels, group permissions, and the discount system
  • Pricing: Learn about billing methods and the pricing system
  • Use Cases: Configuration examples for tools like Claude Code and Cursor