跳轉到主要內容

概覽

返回目前管理令牌所屬組織下的使用者 API Key 清單。

注意事項

  • 系統代管的 Key 不會出現在結果中。

範例

curl -X GET "https://api.tokenlab.sh/v1/management/api-keys" \
  -H "Authorization: Bearer mt-your-management-token"

請求 / 回應

使用上方的互動式 OpenAPI 面板以取得確切的架構。

Response example

{
  "object": "list",
  "data": [
    {
      "id": "key_abc123def456",
      "name": "Backend Worker",
      "key_prefix": "sk-live...",
      "status": "active",
      "limit_amount": 500,
      "limit_amount_decimal": "500",
      "used_amount": 148.25,
      "used_amount_decimal": "148.25",
      "models": [
        "gpt-5-mini",
        "claude-3-7-sonnet"
      ],
      "expires_at": "2026-12-31T23:59:59.000Z",
      "last_used_at": "2026-07-08T03:12:45.000Z",
      "created_at": "2026-07-01T10:00:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 1,
    "totalPages": 1
  }
}

Important fields

object
string
Always list.
data
array
Array of API key objects.
pagination
object
Pagination metadata with page, limit, total, and totalPages.
data[].id
string
API key identifier used in follow-up Management API calls.
data[].name
string
Display name for the API key.
data[].key_prefix
string
Non-secret key prefix for display and support.
data[].status
string
One of active, inactive, or revoked.
data[].limit_amount
number | null
Spending cap in USD as a JSON number for display. null means unlimited.
data[].limit_amount_decimal
string | null
Exact spending cap in USD as a decimal string. null means unlimited.
data[].used_amount
number
Accumulated usage in USD as a JSON number for display.
data[].used_amount_decimal
string
Exact accumulated usage in USD as a decimal string.
data[].models
string[]
Per-key model allowlist. Empty array means no additional key-level model restriction.
data[].expires_at
string | null
ISO timestamp when the key expires, or null for no expiry.
data[].last_used_at
string | null
ISO timestamp for the most recent use, or null when unused.
data[].created_at
string
ISO creation timestamp.