API 金鑰
取得單一 API 金鑰
根據 ID 取得已驗證帳戶的一筆 CometAPI API 金鑰記錄。
GET
cURL
使用此端點可根據 ID 取得單一 API 金鑰記錄。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.
請先在 Console → Personal Settings 產生個人存取權杖,然後將其作為原始
Authorization 標頭值送出。不要加上 Bearer 前綴。id 路徑參數是由 列出 API 金鑰 回傳的數字金鑰 ID。
API 金鑰狀態
| Status | Meaning |
|---|---|
1 | 已啟用 |
2 | 已停用 |
3 | 已過期 |
4 | 已耗盡 |
回傳欄位
| Field | Type | Description |
|---|---|---|
id | integer | 數字 API 金鑰 ID。請將此值用於更新 API 金鑰與刪除 API 金鑰。 |
key | string | 由管理 API 回傳的 API 金鑰值。請將其視為機密,並在模型請求中作為 Authorization: Bearer <COMETAPI_KEY> 使用。 |
status | integer | 運作狀態。只有 1 表示該金鑰已啟用,可用於模型請求。 |
name | string | 供使用者辨識的金鑰顯示名稱。 |
created_time | integer | 金鑰建立時間的 Unix 秒級時間戳。 |
accessed_time | integer | 金鑰上次使用時間的 Unix 秒級時間戳。 |
expired_time | integer | 金鑰到期時間的 Unix 秒級時間戳。-1 表示永不過期。 |
remain_quota | integer | 以 CometAPI 內部配額單位計算的剩餘配額。 |
used_quota | integer | 此金鑰已消耗的配額,單位為 CometAPI 內部配額單位。 |
unlimited_quota | boolean | 此金鑰是否略過剩餘配額檢查。 |
model_limits_enabled | boolean | 此金鑰是否啟用模型限制。 |
model_limits | string | 當 model_limits_enabled 為 true 時,此金鑰允許使用的 model ID,以逗號分隔。空值表示未設定模型清單。 |
allow_ips | string or null | IP 允許清單,為以換行分隔的單一字串。每個項目可以是單一 IPv4 位址、單一 IPv6 位址、IPv4 CIDR 或 IPv6 CIDR。null 或 "" 表示沒有 IP 限制。 |
group | string | 帳戶群組限制。空值表示沒有明確的群組限制。 |
cross_group_retry | boolean | 是否啟用跨群組重試以進行自動群組路由。 |
授權
Personal access token copied from CometAPI Console > Personal Settings. Send the raw token value; do not prefix it with Bearer.
路徑參數
Numeric API key ID returned by the list endpoint.