Skip to main content
POST
Create Token
Last updated: 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

string
required
Token name for easy identification
integer
default:"0"
Initial quota in internal quota units. If set to 0, use it together with unlimited_quota
boolean
default:"false"
Whether the token has unlimited quota
integer
default:"-1"
Expiration timestamp. -1 means never expires
boolean
default:"false"
Whether to enable a model whitelist
string
Model restriction config as a string, usually a JSON string such as ["gpt-5.5","claude-opus-4-8"]
string
IP whitelist string. You can pass a single IP or multiple IPs separated by newlines
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.