Перейти к основному содержанию
GET
/
api
/
token
/
List Tokens
curl --request GET \
  --url https://api.example.com/api/token/
import requests

url = "https://api.example.com/api/token/"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.example.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.example.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",
]);

$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.example.com/api/token/"

req, _ := http.NewRequest("GET", url, nil)

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.example.com/api/token/")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/token/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
Дата обновления: 2026-06-23

Overview

Retrieve all API tokens created by the current user, with pagination support.
The /api/token/* endpoints are mainly for Crazyrouter dashboard automation around API key management. They require a user access token plus the New-Api-User header, and are not the normal interface for sk-xxx model calls.

Authentication

Authenticate using the user’s access token with the following headers:
Authorization: Bearer {access_token}
New-Api-User: {user_id}

Request Parameters

p
integer
по умолчанию:"1"
Page number. The backend accepts older styles too, but 1 is the recommended starting page
size
integer
по умолчанию:"10"
Items per page, maximum 100

Response Format

{
  "success": true,
  "message": "",
  "data": {
    "page": 1,
    "page_size": 10,
    "total": 1,
    "items": [
      {
        "id": 1,
        "user_id": 1,
        "key": "sk-xxxxxxxxxxxxxxxx",
        "status": 1,
        "name": "My Token",
        "created_time": 1706000000,
        "accessed_time": 1706100000,
        "expired_time": -1,
        "remain_quota": 500000,
        "unlimited_quota": false,
        "model_limits_enabled": true,
        "model_limits": "[\"gpt-5.5\",\"claude-opus-4-8\"]",
        "allow_ips": "203.0.113.10",
        "used_quota": 12345,
        "group": "default"
      }
    ]
  }
}

Field Descriptions

FieldTypeDescription
idintToken ID
keystringAPI key in sk-xxx format
statusintStatus: 1=enabled, 2=disabled
namestringToken name
expired_timeintExpiration timestamp, -1 means never expires
remain_quotaintRemaining quota
unlimited_quotaboolWhether quota is unlimited
used_quotaintUsed quota
model_limits_enabledboolWhether the model whitelist is enabled
model_limitsstringModel restriction config string
allow_ipsstringIP whitelist string
groupstringGroup

Code Examples

import requests

headers = {
    "Authorization": "Bearer your_access_token",
    "New-Api-User": "1",
    "User-Agent": "Mozilla/5.0"
}

response = requests.get(
    "https://api.crazyrouter.com/api/token/?p=1&size=100",
    headers=headers
)

page = response.json()["data"]
for token in page["items"]:
    print(f"[{token['name']}] {token['key'][:10]}... Quota: {token['remain_quota']}")
curl "https://api.crazyrouter.com/api/token/?p=1&size=100" \
  -H "Authorization: Bearer your_access_token" \
  -H "New-Api-User: 1"