---
title: "Add Token"
method: POST
path: "/api/token/"
tags: ["Token"]
---

# Add Token

`POST /api/token/`

## Request

- Base URL: `https://api.unorouter.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.unorouter.com/api/token/`
- Auth: one of:
  - API key in header `Authorization` and API key in header `New-Api-User`
  - API key in header `New-Api-User` and API key in cookie `session`

## Request body

- CreateTokenRequest: CreateTokenRequest schema
  - `allow_ips` string, nullable, required
  - `allow_user_quota_query` boolean, nullable, required
  - `auto_groups` string[], nullable, required
  - `cross_group_retry` boolean, nullable, required
  - `default_reasoning_effort` string, nullable, required
  - `expired_time` integer, required
  - `group` string, required
  - `group_mapping` string, nullable, required
  - `max_input_price` number, double, nullable, required
  - `max_output_price` number, double, nullable, required
  - `model_limits` string, required
  - `model_limits_enabled` boolean, required
  - `name` string, required
  - `prompt_cache` string, nullable, required
  - `remain_quota` integer, required
  - `unlimited_quota` boolean, required

## Response `200`

OK

- MessageResponse
  - `message` string, required
  - `success` boolean, required

## Changes

- **2026-11-28** `862a0e26e376`: 2 breaking
  - added the new required request property `max_input_price`
  - added the new required request property `max_output_price`
- **2026-10-28** `67366f1fcc53`: 1 breaking
  - added the new required request property `prompt_cache`
- **2026-10-19** `2b7368f45936`: 1 breaking
  - added the new required request property `default_reasoning_effort`
- **2026-10-16** `8b4ed85bf702`: 1 breaking
  - added the new required request property `allow_user_quota_query`

[Operation history](https://skmtc.dev/unorouter/apis/new-api/changes/api/token/post.md)

---

[API](https://skmtc.dev/unorouter/apis/new-api.md) - [All operations](https://skmtc.dev/unorouter/apis/new-api/llms.txt) - [OpenAPI document](https://skmtc.dev/unorouter/apis/new-api/revisions/1b50ada14f59?raw)
