(3) Create an API Key
An API key (looks like sk-xxxxxx) is the "secret" you enter in your client. It is equivalent to your account credentials, so keep it safe and never leak it.
Steps to create
- Log in to the Console and go to Token Management on the left.
- Click Add Token at the top of the page.
- Fill in the token details in the dialog:
- Token name: to tell uses apart, e.g.
Claude Code,Codex,Image. - Token group: required — the group determines which models the token can use (see below).
- Expiry: defaults to "Never expires", or set a validity period as needed.
- Quota: even with "Unlimited quota" enabled, the token's actual usable quota is still capped by your account balance.
- Access restrictions: if you're unsure, keep the defaults — don't casually enable model restrictions or IP allowlists.
- Token name: to tell uses apart, e.g.
- Click Submit to create it, then click the Copy button to the right of the token to grab the key.
You must pick the right group
A critical step
The token group directly determines which models are available. For example, to use Claude Code, choose a Claude group; to use Codex, choose a Codex group. If you pick the wrong group, you'll easily run into "model does not exist" or failed calls when configuring your client.
Tianshu's commonly used groups (see Token Groups for details):
| Scenario | Recommended group | Notes |
|---|---|---|
| Claude Code (CLI only) | claude-cconly | Supports Claude Code connections only; great value |
| Claude (any client) | claude-max / claude-kiro | Usable across various clients |
| Codex coding | codex / codex-pro / codex-plus / codex-free | Different account pools; choose as needed |
| AI image generation | 生图专用 | GPT image model (gpt-image) |
See which models are in a group
Not sure which models a group supports? Go to the Model Marketplace:
- Open the Model Marketplace and select a group under "Available token groups" on the left.
- The model cards on the right will show the models available in that group, their discount rates and availability status.
See Using the Marketplace for more.
Next step
Once your token is created, run an environment check to confirm your machine can run the CLI tools.
