Skip to content

(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

  1. Log in to the Console and go to Token Management on the left.
  2. Click Add Token at the top of the page.
  3. 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.
  4. 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):

ScenarioRecommended groupNotes
Claude Code (CLI only)claude-cconlySupports Claude Code connections only; great value
Claude (any client)claude-max / claude-kiroUsable across various clients
Codex codingcodex / codex-pro / codex-plus / codex-freeDifferent 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:

  1. Open the Model Marketplace and select a group under "Available token groups" on the left.
  2. 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.