账户查询
获取账户资料
使用系统访问令牌读取当前账户的数据
国内用户请注意: 中国大陆用户请使用 https://toapis.cn 作为接口地址 (Base URL). 文档示例中的 https://toapis.com 请替换为 https://toapis.cn.
鉴权, 分页与错误处理见接入说明.
使用说明
仅返回自身 id, display_name, created_at, region, locale, account_type. 历史未知的时间, 区域和语言为 null, account_type 为 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"
}
}