API setup

Connect your client

Create a key in the dashboard, then select the group for the protocol your client uses. The API host is https://tiantianapi.kdns.fr.

1. Choose a protocol

Responses

For Codex and compatible clients.

/v1/responses

Anthropic Messages

For Claude Code and compatible clients.

/v1/messages

Chat Completions

For OpenCode and chat applications.

/v1/chat/completions

2. Create and protect your API key

After signing in, open the API Keys page. Create a key in the group matching your endpoint. Use the dashboard’s setup or CC Switch import option when available. Never publish a complete API key, login password or wallet seed phrase.

3. Make a small test request

For an OpenAI-compatible Chat Completions client, the base URL is typically https://tiantianapi.kdns.fr/v1. Do not append /v1 twice. Use a model ID shown on the pricing page.

curl https://tiantianapi.kdns.fr/v1/chat/completions \
  -H "Authorization: Bearer $TIANTIAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.2","messages":[{"role":"user","content":"Hello"}]}'

4. Understand pricing

Public prices are in USD / 1M tokens. Input, output and cached input have separate prices. Your group and any account-specific multiplier determine actual billing; check usage records after a test request. The public model list may change.

5. Top up with care

Account balances are denominated in USD. Check the payment amount, credited balance and expiry before paying. For on-chain transfers, follow the order’s currency, network, address and exact amount, including any decimal suffix. If a payment does not credit automatically, contact Telegram support with the order number and payment receipt.

6. Get support

For API errors, keep the request ID, endpoint, model ID and approximate time. Do not send your full key or password. Registration and password-reset emails may appear in spam.