토큰 목록 조회
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_bodyAPI 키 & 콘솔 관리
토큰 목록 조회
현재 사용자의 API 토큰 목록을 페이지네이션으로 조회
GET
/
api
/
token
/
토큰 목록 조회
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-07-20
인터페이스 설명
현재 사용자가 생성한 모든 API 토큰(Token)을 조회하며, 페이지네이션을 지원합니다.이
/api/token/* 계열 인터페이스는 주로 Crazyrouter 콘솔에서 API Key 관리 자동화에 사용됩니다. 사용자 access token과 New-Api-User 요청 헤더가 필요하며, 일반적인 sk-xxx 모델 호출 흐름에서 직접 사용하는 인터페이스가 아닙니다. 요청 기본 주소는 반드시 https://crazyrouter.com을 사용해야 합니다. https://api.crazyrouter.com은 모델 API 전용 진입점이므로 관리 경로를 호출하면 404 api_only_endpoint가 반환됩니다.인증 방식
사용자의 Access Token으로 인증하며, 요청 헤더에 다음을 포함해야 합니다.Authorization: Bearer {access_token}
New-Api-User: {user_id}
요청 파라미터
integer
기본값:"1"
페이지 번호. 코드는 이전 방식과의 호환성을 유지하지만,
1부터 시작하는 것을 권장합니다integer
기본값:"10"
페이지당 개수, 최대 100
응답 형식
{
"success": true,
"message": "",
"data": {
"page": 1,
"page_size": 10,
"total": 1,
"items": [
{
"id": 1,
"user_id": 1,
"key": "sk-xxxxxxxxxxxxxxxx",
"status": 1,
"name": "내 토큰",
"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"
}
]
}
}
필드 설명
| 필드 | 타입 | 설명 |
|---|---|---|
id | int | 토큰 ID |
key | string | API Key(sk-xxx 형식) |
status | int | 상태: 1=활성화, 2=비활성화 |
name | string | 토큰 이름 |
expired_time | int | 만료 타임스탬프, -1은 만료되지 않음을 의미 |
remain_quota | int | 잔여 크레딧 |
unlimited_quota | bool | 무제한 크레딧 여부 |
used_quota | int | 이미 사용한 크레딧 |
model_limits_enabled | bool | 모델 화이트리스트 활성화 여부 |
model_limits | string | 모델 제한 설정 문자열 |
allow_ips | string | IP 화이트리스트 문자열 |
group | string | 그룹 |
코드 예시
import requests
headers = {
"Authorization": "Bearer your_access_token",
"New-Api-User": "1",
"User-Agent": "Mozilla/5.0"
}
response = requests.get(
"https://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]}... 크레딧: {token['remain_quota']}")
curl "https://crazyrouter.com/api/token/?p=1&size=100" \
-H "Authorization: Bearer your_access_token" \
-H "New-Api-User: 1"