> ## 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.

# POST /api/auth/register/email — 使用邮箱注册账户

> 使用邮箱地址与密码创建咏唱引擎账户。返回会话令牌，并在配置 SMTP 时发送欢迎邮件。

使用邮箱地址与密码创建新的咏唱引擎账户。返回会话 JWT 与新的用户档案。当 SMTP 配置完成时，后端还会发送 `user_registered` 欢迎邮件。

**方法：** `POST` **路径：** `/api/auth/register/email` **认证：** 无

## 请求

<ParamField body="email" type="string" required>
  邮箱地址。必须唯一。
</ParamField>

<ParamField body="password" type="string" required>
  账户密码。
</ParamField>

<ParamField body="name" type="string">
  可选的显示名称。
</ParamField>

## 响应

<ResponseField name="token" type="string">
  会话 JWT。
</ResponseField>

<ResponseField name="user" type="object">
  新用户档案。
</ResponseField>

## 示例

```bash theme={null}
curl -X POST https://ariacompute.cn/api/auth/register/email \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "password": "...", "name": "Jane"}'
```

```json theme={null}
{
  "token": "eyJhbGciOi...",
  "user": {
    "id": "usr_01H...",
    "email": "you@example.com",
    "name": "Jane",
    "created_at": "2026-09-23T10:00:00Z"
  }
}
```

## 错误

| 状态    | 含义         |
| ----- | ---------- |
| `400` | 邮箱无效或缺失密码。 |
| `409` | 邮箱已注册。     |
