토큰 생성
curl --request POST \
--url https://api.example.com/api/token/ \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"remain_quota": 123,
"unlimited_quota": true,
"expired_time": 123,
"model_limits_enabled": true,
"model_limits": "<string>",
"allow_ips": "<string>",
"group": "<string>"
}
'import requests
url = "https://api.example.com/api/token/"
payload = {
"name": "<string>",
"remain_quota": 123,
"unlimited_quota": True,
"expired_time": 123,
"model_limits_enabled": True,
"model_limits": "<string>",
"allow_ips": "<string>",
"group": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
remain_quota: 123,
unlimited_quota: true,
expired_time: 123,
model_limits_enabled: true,
model_limits: '<string>',
allow_ips: '<string>',
group: '<string>'
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'remain_quota' => 123,
'unlimited_quota' => true,
'expired_time' => 123,
'model_limits_enabled' => true,
'model_limits' => '<string>',
'allow_ips' => '<string>',
'group' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/token/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"remain_quota\": 123,\n \"unlimited_quota\": true,\n \"expired_time\": 123,\n \"model_limits_enabled\": true,\n \"model_limits\": \"<string>\",\n \"allow_ips\": \"<string>\",\n \"group\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/token/")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"remain_quota\": 123,\n \"unlimited_quota\": true,\n \"expired_time\": 123,\n \"model_limits_enabled\": true,\n \"model_limits\": \"<string>\",\n \"allow_ips\": \"<string>\",\n \"group\": \"<string>\"\n}")
.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::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"remain_quota\": 123,\n \"unlimited_quota\": true,\n \"expired_time\": 123,\n \"model_limits_enabled\": true,\n \"model_limits\": \"<string>\",\n \"allow_ips\": \"<string>\",\n \"group\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAPI 키 & 콘솔 관리
토큰 생성
새 API 토큰을 생성합니다
POST
/
api
/
token
/
토큰 생성
curl --request POST \
--url https://api.example.com/api/token/ \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"remain_quota": 123,
"unlimited_quota": true,
"expired_time": 123,
"model_limits_enabled": true,
"model_limits": "<string>",
"allow_ips": "<string>",
"group": "<string>"
}
'import requests
url = "https://api.example.com/api/token/"
payload = {
"name": "<string>",
"remain_quota": 123,
"unlimited_quota": True,
"expired_time": 123,
"model_limits_enabled": True,
"model_limits": "<string>",
"allow_ips": "<string>",
"group": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
remain_quota: 123,
unlimited_quota: true,
expired_time: 123,
model_limits_enabled: true,
model_limits: '<string>',
allow_ips: '<string>',
group: '<string>'
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'remain_quota' => 123,
'unlimited_quota' => true,
'expired_time' => 123,
'model_limits_enabled' => true,
'model_limits' => '<string>',
'allow_ips' => '<string>',
'group' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/token/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"remain_quota\": 123,\n \"unlimited_quota\": true,\n \"expired_time\": 123,\n \"model_limits_enabled\": true,\n \"model_limits\": \"<string>\",\n \"allow_ips\": \"<string>\",\n \"group\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/token/")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"remain_quota\": 123,\n \"unlimited_quota\": true,\n \"expired_time\": 123,\n \"model_limits_enabled\": true,\n \"model_limits\": \"<string>\",\n \"allow_ips\": \"<string>\",\n \"group\": \"<string>\"\n}")
.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::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"remain_quota\": 123,\n \"unlimited_quota\": true,\n \"expired_time\": 123,\n \"model_limits_enabled\": true,\n \"model_limits\": \"<string>\",\n \"allow_ips\": \"<string>\",\n \"group\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body내용 업데이트: 2026-07-20
인터페이스 설명
AI 모델 API를 호출하기 위한 새 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가 반환됩니다.인증 방식
이 인터페이스는 사용자 측 인증이 필요합니다.Authorization: Bearer your_access_token
New-Api-User: 1
요청 파라미터
응답 형식
현재 인터페이스는 생성 성공 시 성공 상태만 반환합니다.{
"success": true,
"message": ""
}
코드 예시
import json
import requests
headers = {
"Authorization": "Bearer your_access_token",
"New-Api-User": "1",
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0"
}
response = requests.post(
"https://crazyrouter.com/api/token/",
headers=headers,
json={
"name": "생산 환경",
"remain_quota": 100000,
"unlimited_quota": False,
"expired_time": -1,
"model_limits_enabled": True,
"model_limits": json.dumps(["gpt-5.5", "claude-opus-4-8"]),
"allow_ips": "203.0.113.10"
}
)
print(response.json())
curl -X POST https://crazyrouter.com/api/token/ \
-H "Authorization: Bearer your_access_token" \
-H "New-Api-User: 1" \
-H "Content-Type: application/json" \
-d '{
"name": "생산 환경",
"remain_quota": 100000,
"expired_time": -1,
"model_limits_enabled": true,
"model_limits": "[\"gpt-5.5\"]"
}'
현재 생성 인터페이스는 응답에 새로 생성된 완전한
key를 반환하지 않습니다. 완전한 키를 즉시 복사해야 하는 흐름이라면, 콘솔 페이지를 통해 생성하고 저장하는 것을 우선 권장합니다.