ToAPIsToAPIs
帳戶查詢

取得帳戶資料

使用系統存取權杖讀取目前帳戶的資料

GET
/api/v1/account

中國大陸用戶請注意: 中國大陸用戶請使用 https://toapis.cn 作為接口地址 (Base URL). 文檔示例中的 https://toapis.com 請替換為 https://toapis.cn.

驗證, 分頁及錯誤處理請參閱接入說明.

使用說明

僅回傳自身 id, display_name, created_at, region, locale, account_type. 歷史未知時間, 區域與語言為 null, 帳戶類型為 normal 或 sub. 不回傳電子郵件, 使用者名稱或憑證.

驗證

Authorizationstring請求頭必填

使用系統存取權杖, 格式為 Bearer YOUR_SYSTEM_ACCESS_TOKEN. 此介面不接受模型 API Key, 不需要 X-User-Id.

請求參數

此介面不接受路徑或查詢參數, 不需要請求主體.

請求示例

curl --request GET \
  --url 'https://toapis.com/api/v1/account' \
  --header 'Authorization: Bearer YOUR_SYSTEM_ACCESS_TOKEN'
import requests

response = requests.get(
    "https://toapis.com/api/v1/account",
    headers={"Authorization": "Bearer YOUR_SYSTEM_ACCESS_TOKEN"},
    timeout=30,
)
response.raise_for_status()
print(response.json())
const url = new URL("https://toapis.com/api/v1/account");

const response = await fetch(url, {
  headers: { Authorization: "Bearer YOUR_SYSTEM_ACCESS_TOKEN" },
  signal: AbortSignal.timeout(30_000),
});

if (!response.ok) {
  throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
console.log(await response.json());

回應欄位

範例使用虛構資料, 並假設 credits_per_usd="100". 實際換算請以回應為準.

codeinteger

業務狀態碼, 成功時為 0.

messagestring

回應訊息, 成功時為空字串. 錯誤訊息依請求語言回傳.

dataobject

本次查詢的結果物件.

data.idstring

目前驗證帳戶的 ID. 以十進位 ID 字串回傳.

data.display_namestring

帳戶顯示名稱.

data.created_atstring | null

建立時間. 時間格式為含時區的 RFC 3339. 無法確認或不適用時為 null.

data.regionstring | null

帳戶區域, 歷史資料未知時為 null.

data.localestring | null

帳戶的語言偏好, 不一定是本次回應協商的語言. 無法確認或不適用時為 null.

data.account_typestring

帳戶類型: normal 為主帳戶, sub 為子帳戶.

響應示例

{
  "code": 0,
  "message": "",
  "data": {
    "id": "7",
    "display_name": "Example User",
    "created_at": "2026-10-01T00:00:00Z",
    "region": "global",
    "locale": "zh",
    "account_type": "normal"
  }
}