メインコンテンツへスキップ
POST
Create Token
更新日: 2026-07-20

Overview

Create a new API token for calling AI model APIs.
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. Use https://crazyrouter.com as the base URL; https://api.crazyrouter.com is reserved for model APIs and returns 404 api_only_endpoint for management paths.

Authentication

This endpoint requires user-side authentication:

Request Parameters

name
string
必須
Token name for easy identification
remain_quota
integer
デフォルト:"0"
Initial quota in internal quota units. If set to 0, use it together with unlimited_quota
unlimited_quota
boolean
デフォルト:"false"
Whether the token has unlimited quota
expired_time
integer
デフォルト:"-1"
Expiration timestamp. -1 means never expires
model_limits_enabled
boolean
デフォルト:"false"
Whether to enable a model whitelist
model_limits
string
Model restriction config as a string, usually a JSON string such as ["gpt-5.5","claude-opus-4-8"]
allow_ips
string
IP whitelist string. You can pass a single IP or multiple IPs separated by newlines
group
string
Token group. It must be a group the current user is allowed to use

Response Format

The current implementation only returns a success state after creation:

Code Examples

The current create endpoint does not return the full generated key in the response. If your workflow requires copying the full token immediately, prefer creating it from the console UI and saving it there.