Skip to content

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:

VariableValue
BASE_URLhttps://api.calgine.com.cn
API_KEYAn 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.

python
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)
js
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.calgine.com.cn/v1",
  apiKey: "API_KEY",
});

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

console.log(response.choices[0].message.content);
bash
curl https://api.calgine.com.cn/v1/chat/completions \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Anthropic Protocol ​

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

python
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)
bash
curl https://api.calgine.com.cn/anthropic/v1/messages \
  -H "x-api-key: API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-5-20251101",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

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