> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建新 KEY

> 创建一个新的 API KEY

## 请求参数

### 请求头（headers）

<ResponseField type="string" required>
  请求身份认证。接口使用 AIHubMix Manage Key 进行身份认证。
</ResponseField>

<ResponseField type="string">
  请求内容类型。此参数必须设置为 application/json。
</ResponseField>

### 请求体（Request Body）

<ResponseField name="name" type="string" required>
  新 Key 的名称。
</ResponseField>

<ResponseField name="expired_time" type="integer">
  过期时间。存储格式为 UNIX 时间戳，-1 表示永不过期。
</ResponseField>

<ResponseField name="unlimited_quota" type="boolen">
  是否限额。
</ResponseField>

<ResponseField name="remain_quota" type="integer">
  remain\_quota 为：期望限额\*500000
</ResponseField>

<ResponseField name="models" type="text">
  限制模型。
</ResponseField>

<ResponseField name="subnet" type="text">
  限制 IP
</ResponseField>

## 响应参数

<ResponseField name="data" type="object">
  用户新建 Key 相关信息（通常包含 id、name 等）。

  <ResponseField name="id" type="integer">
    Key ID。
  </ResponseField>

  <ResponseField name="user_id" type="integer">
    用户 ID
  </ResponseField>

  <ResponseField name="status" type="integer">
    Key 状态。0 为未启用，1 为启用。
  </ResponseField>

  <ResponseField name="name" type="string">
    Key 名称。
  </ResponseField>

  <ResponseField name="created_time" type="integer">
    Key 创建时间，保存格式为 UNIX 时间戳。
  </ResponseField>

  <ResponseField name="accessed_time" type="integer">
    Key 获取时间，保存格式为 UNIX 时间戳。
  </ResponseField>

  <ResponseField name="expired_time" type="string">
    Key 过期时间，-1 表示永不过期。
  </ResponseField>

  <ResponseField name="remain_quota" type="string">
    限额余量，-1 表示无限额。
  </ResponseField>

  <ResponseField name="unlimited_quota" type="boolean">
    是否限额。
  </ResponseField>

  <ResponseField name="used_quota" type="integer">
    已使用额度为：used\_quota / 500000
  </ResponseField>

  <ResponseField name="models" type="text">
    限制当前 Key 使用的模型。
  </ResponseField>

  <ResponseField name="subnet" type="text">
    IP 限制。
  </ResponseField>
</ResponseField>

<ResponseField name="message" type="string">
  请求失败的详细信息。请求成功时不会返回此参数。
</ResponseField>

<ResponseField name="success" type="boolean">
  是否成功
</ResponseField>

***

更新时间：2026-06-01
