Quick Start
In just three steps, you can call the vast range of large models on Tianshu with your existing code.
Step 1: Sign up and create a key
- Open the Console and sign up (email verification required).
- Go to Token Management, click New, and generate an API key (looks like
sk-xxxxxx). - Keep this key safe — it is equivalent to your account credentials.
Step 2: Replace the base URL
Change the base URL (base_url / BASE_URL) in your client / SDK to Tianshu's standard route:
https://tian-shu.orgThe full OpenAI-style Chat endpoint is therefore:
https://tian-shu.org/v1/chat/completionsFor long-running requests such as image generation, use the direct route
https://api.tian-shu.orginstead. See Endpoints for details.
Step 3: Make your first request
cURL
bash
curl https://tian-shu.org/v1/chat/completions \
-H "Authorization: Bearer $TIANSHU_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<pick a model from the Model Marketplace>",
"messages": [{"role": "user", "content": "Hi, please introduce yourself"}]
}'Python (openai SDK)
python
from openai import OpenAI
client = OpenAI(
api_key="your Tianshu key",
base_url="https://tian-shu.org/v1",
)
resp = client.chat.completions.create(
model="<pick a model from the Model Marketplace>",
messages=[{"role": "user", "content": "Hi, please introduce yourself"}],
)
print(resp.choices[0].message.content)Node.js (openai SDK)
js
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.TIANSHU_KEY,
baseURL: 'https://tian-shu.org/v1',
});
const resp = await client.chat.completions.create({
model: '<pick a model from the Model Marketplace>',
messages: [{ role: 'user', content: 'Hi, please introduce yourself' }],
});
console.log(resp.choices[0].message.content);Choosing a model
Put the name of the model you want to call in the model field. For all available models, their groups and live rates, check the Model Marketplace — just copy the model name to use it.
Next steps
- Onboarding Steps — the full flow: sign up, add credit, create a key, configure a client
- CC-Switch One-Click Setup — configure Claude Code / Codex with a GUI
- Token Groups — which group suits which scenario
- Endpoints — the standard route and the direct route for long requests
- Billing — pay-as-you-go and top-up rules
