跳轉到主要內容
GET
/
api
/
token
cURL
curl "https://api.cometapi.com/api/token/?p=1&page_size=20" \
  -H "Authorization: your-access-token"
{
  "success": true,
  "message": "",
  "data": {
    "page": 1,
    "page_size": 20,
    "total": 1,
    "items": [
      {
        "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.

使用此端點可列出屬於已驗證 CometAPI 帳戶的 API 金鑰。系統會優先回傳最新建立的金鑰。
請先在 Console → Personal Settings 產生 personal access token,然後將它作為原始 Authorization 標頭值送出。不要加上 Bearer 前綴。

分頁

查詢參數說明
p頁碼。預設為 1
page_size每頁項目數。超過 100 的值會被限制為 100

API 金鑰狀態

狀態含義
1已啟用
2已停用
3已過期
4已用盡

回傳欄位

欄位類型說明
idinteger數值型 API 金鑰 ID。可將此值用於取得單一 API 金鑰更新 API 金鑰刪除 API 金鑰
keystring由管理 API 回傳的 API 金鑰值。請將其視為機密,並在模型請求中以 Authorization: Bearer <COMETAPI_KEY> 使用。
statusinteger運作狀態。只有 1 表示該金鑰可用於模型請求。
namestring供使用者辨識的金鑰顯示名稱。
created_timeinteger金鑰建立時間的 Unix 時間戳(秒)。
accessed_timeinteger金鑰上次使用時間的 Unix 時間戳(秒)。
expired_timeinteger金鑰到期時間的 Unix 時間戳(秒)。-1 表示永不過期。
remain_quotaintegerCometAPI 內部配額單位中的剩餘配額。
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.

查詢參數

p
integer
預設值:1

Page number to return. Defaults to 1.

必填範圍: x >= 1
page_size
integer
預設值:20

Number of keys per page. Values above 100 are capped at 100 by the backend.

必填範圍: 1 <= x <= 100

回應

200 - application/json

Paginated API key list.

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