跳轉到主要內容
GET
/
api
/
token
/
{id}
cURL
curl https://api.cometapi.com/api/token/1234 \
  -H "Authorization: your-access-token"
{
  "success": true,
  "message": "",
  "data": {
    "id": 1234,
    "user_id": 5678,
    "key": "<COMETAPI_KEY>",
    "status": 1,
    "name": "production",
    "created_time": 1766102400,
    "accessed_time": 1766102400,
    "expired_time": -1,
    "remain_quota": 100000,
    "unlimited_quota": false,
    "model_limits_enabled": false,
    "model_limits": "",
    "allow_ips": null,
    "used_quota": 0,
    "group": "",
    "cross_group_retry": false
  }
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

使用此端點可根據 ID 取得單一 API 金鑰記錄。
請先在 Console → Personal Settings 產生個人存取權杖,然後將其作為原始 Authorization 標頭值送出。不要加上 Bearer 前綴。
id 路徑參數是由 列出 API 金鑰 回傳的數字金鑰 ID。

API 金鑰狀態

StatusMeaning
1已啟用
2已停用
3已過期
4已耗盡

回傳欄位

FieldTypeDescription
idinteger數字 API 金鑰 ID。請將此值用於更新 API 金鑰刪除 API 金鑰
keystring由管理 API 回傳的 API 金鑰值。請將其視為機密,並在模型請求中作為 Authorization: Bearer <COMETAPI_KEY> 使用。
statusinteger運作狀態。只有 1 表示該金鑰已啟用,可用於模型請求。
namestring供使用者辨識的金鑰顯示名稱。
created_timeinteger金鑰建立時間的 Unix 秒級時間戳。
accessed_timeinteger金鑰上次使用時間的 Unix 秒級時間戳。
expired_timeinteger金鑰到期時間的 Unix 秒級時間戳。-1 表示永不過期。
remain_quotainteger以 CometAPI 內部配額單位計算的剩餘配額。
used_quotainteger此金鑰已消耗的配額,單位為 CometAPI 內部配額單位。
unlimited_quotaboolean此金鑰是否略過剩餘配額檢查。
model_limits_enabledboolean此金鑰是否啟用模型限制。
model_limitsstringmodel_limits_enabledtrue 時,此金鑰允許使用的 model ID,以逗號分隔。空值表示未設定模型清單。
allow_ipsstring or nullIP 允許清單,為以換行分隔的單一字串。每個項目可以是單一 IPv4 位址、單一 IPv6 位址、IPv4 CIDR 或 IPv6 CIDR。null"" 表示沒有 IP 限制。
groupstring帳戶群組限制。空值表示沒有明確的群組限制。
cross_group_retryboolean是否啟用跨群組重試以進行自動群組路由。

授權

Authorization
string
header
必填

Personal access token copied from CometAPI Console > Personal Settings. Send the raw token value; do not prefix it with Bearer.

路徑參數

id
integer
必填

Numeric API key ID returned by the list endpoint.

回應

200 - application/json

API key record.

success
boolean
必填
message
string
必填
data
object
必填