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

# 创建 / 列出 API Key - POST,GET /v1/apikeys

> POST /v1/apikeys 创建 API Key（仅展示一次）；GET /v1/apikeys 查询是否已拥有 Key。每个用户仅一个 Key。

每个用户仅持有一个 API Key。创建后 Key 原文**仅返回一次**，请妥善保存；之后只能用 `GET` 查询是否已存在，无法再次明文获取。

## 接口

```http theme={null}
POST /v1/apikeys
GET  /v1/apikeys
```

## 认证

`Authorization: Bearer <jwt>` 或 `X-API-Key <sk_...>`（仅需登录）。

## 响应（POST）

<ResponseField name="api_key" type="string">
  新创建的 API Key 原文（如 `sk_aria_...`），仅展示一次。
</ResponseField>

<ResponseField name="note" type="string">
  提示文案。
</ResponseField>

## 响应（GET）

<ResponseField name="has_key" type="boolean">
  当前用户是否已拥有 API Key。
</ResponseField>

## 示例

<RequestExample>
  ```bash cURL theme={null}
  # 创建
  curl -X POST https://memo.ariacompute.cn/v1/apikeys \
    -H "Authorization: Bearer <jwt>"

  # 查询
  curl https://memo.ariacompute.cn/v1/apikeys \
    -H "Authorization: Bearer <jwt>"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "api_key": "sk_aria_01a2b3c4d5e6f7890abcdef",
    "note": "shown only once"
  }
  ```

  ```json 200 theme={null}
  {
    "has_key": true
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.