API keys
List API keys
Use CometAPI GET /api/token/ to list API keys for the authenticated account with pagination.
GET
/
api
/
token
/
cURL
curl "https://api.cometapi.com/api/token/?p=1&page_size=20" \
-H "Authorization: your-access-token"import requests
url = "https://api.cometapi.com/api/token/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.cometapi.com/api/token/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/api/token/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/api/token/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cometapi.com/api/token/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/api/token/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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
}
]
}
}Use this endpoint to list API keys that belong to the authenticated CometAPI account. The newest keys are returned first.
Generate a personal access token at Console → Personal Settings, then send it as the raw
Authorization header value. Do not prefix it with Bearer.Pagination
| Query parameter | Description |
|---|---|
p | Page number. Defaults to 1. |
page_size | Items per page. Values above 100 are capped at 100. |
API key status
| Status | Meaning |
|---|---|
1 | Enabled |
2 | Disabled |
3 | Expired |
4 | Exhausted |
Returned fields
| Field | Type | Description |
|---|---|---|
id | integer | Numeric API key ID. Use this value with Get a single API key, Update an API key, and Delete an API key. |
key | string | API key value returned by the management API. Treat it as a secret and use it as Authorization: Bearer $COMETAPI_KEY for model requests. |
status | integer | Operational status. Only 1 means the key is enabled for model requests. |
name | string | User-readable display name for the key. |
created_time | integer | Unix timestamp in seconds when the key was created. |
accessed_time | integer | Unix timestamp in seconds when the key was last used. |
expired_time | integer | Unix timestamp in seconds when the key expires. -1 means no expiration. |
remain_quota | integer | Remaining quota in CometAPI internal quota units. |
used_quota | integer | Quota already consumed by this key in CometAPI internal quota units. |
unlimited_quota | boolean | Whether the key bypasses remaining-quota checks. |
model_limits_enabled | boolean | Whether model restrictions are active for this key. |
model_limits | string | Comma-separated model IDs allowed by this key when model_limits_enabled is true. Empty means no configured model list. |
allow_ips | string or null | IP allowlist as one newline-separated string. Each entry can be a single IPv4 address, single IPv6 address, IPv4 CIDR, or IPv6 CIDR. null or "" means no IP restriction. |
group | string | Account group restriction. Empty means no explicit group restriction. |
cross_group_retry | boolean | Whether cross-group retry is enabled for automatic group routing. |
Authorizations
Personal access token copied from CometAPI Console > Personal Settings. Send the raw token value; do not prefix it with Bearer.
Query Parameters
Page number to return. Defaults to 1.
Required range:
x >= 1Number of keys per page. Values above 100 are capped at 100 by the backend.
Required range:
1 <= x <= 100Last modified on June 23, 2026
⌘I
cURL
curl "https://api.cometapi.com/api/token/?p=1&page_size=20" \
-H "Authorization: your-access-token"import requests
url = "https://api.cometapi.com/api/token/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.cometapi.com/api/token/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/api/token/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/api/token/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cometapi.com/api/token/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/api/token/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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
}
]
}
}