介面指南
五分鐘快速上手
1. 建立賬號與充值
註冊或登入 CHINZY,然後在錢包中選擇充值金額與可用支付方式。模型呼叫從錢包結算;充值到賬以支付回撥確認為準。
2. 建立並儲存 API 金鑰
在控制檯建立 API Key,可設定每月消費上限。完整金鑰只顯示一次,請立即安全儲存;每個應用使用獨立金鑰,避免在瀏覽器程式碼或公開倉庫中暴露。
3. 選擇模型與協議
使用實時模型目錄中的公開別名。OpenAI 相容客戶端使用 /v1;Anthropic 相容客戶端使用 /anthropic。不要把供應商內部模型 ID 當作平臺別名。
4. 發起請求
SDK 接收 Base URL 並自動拼接介面路徑;curl 需要完整介面 URL。將金鑰放在服務端環境變數中,按所用協議傳送認證頭;流式響應使用 stream: true。
5. 檢視用量與費用
在用量頁按模型或 API Key 檢視費用、最近請求、狀態與延遲,並匯出 CSV。錢包以人民幣結算;模型目錄展示的單價單位以頁面標註為準。
示例程式碼中的欄位名、模型別名和介面路徑保持原樣,可直接用於開發。
完整技術參考(英文)
Getting started
5-minute quickstart
Five steps from a fresh account to a working LLM call. If you already have a key, jump straight to Use your API key.
Step 1 — Create an account
- Go to Sign up.
- Enter your email + a password. We send an activation link — click it to switch the account from
PENDING_VERIFICATIONtoACTIVE. - You land on the developer console.
Step 2 — Add funds
Every relay call settles against your wallet, so it starts at zero balance and you need to top up before it works.
- Open Billing.
- Pick an amount and a payment method (Alipay if configured, or the mock provider in dev environments).
- The wallet credit lands when the payment callback fires (seconds for Alipay, instant for mock).
Charges are denominated in CN¥ minor (分). Each model alias has a published per-1k-token price — see Models.
Step 3 — Create an API key
- Open API keys.
- Pick a name (e.g.
local-dev) and an optional monthly spend cap. - Click Create API key. The reveal banner shows the token starting with
tsk_. Copy it now — the platform never displays the full token again.
Step 4 — Send a request
Two URL forms come up depending on the client you use:
- Base URL (the value you pass to an SDK's
baseURL/base_urlfield):https://chinzy.com/v1 - Full endpoint URL (the URL you put in raw HTTP / curl):
https://chinzy.com/v1/chat/completions
SDKs (OpenAI, Anthropic, etc.) only need the base URL — they append /chat/completions themselves. Curl needs the full path because it has no concept of a base URL. Quick smoke test with curl:
curl https://chinzy.com/v1/chat/completions \
-H "Authorization: Bearer tsk_..." \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.2",
"messages": [{"role": "user", "content": "Say hi in one sentence"}]
}'Expected response shape: a JSON body with choices[0].message.content populated and a usage block. Status 200.
Got a different status code? Skip to the error table.
Step 5 — Watch your spend
Open Usage. Within seconds your first call shows up:
- Cycle spend — total charged this calendar month.
- By model / By API key — breakdowns sorted by spend.
- Recent calls — last 50 requests with status, latency, and cost. The status code links to the request log row in the operator console for debugging if needed.
- Download CSV — pull 7 / 30 / 90 days of activity into a spreadsheet for accounting.
You're live
From here, common next steps:
- Switch your existing OpenAI / Anthropic SDK code to point at our base URL — see SDK examples.
- Browse the full Models catalog for aliases and pricing.
- Set monthly caps on each key so a runaway client can't drain the wallet.