> ## 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 /v1/auth/login

> 通过 POST /v1/auth/login 用邮箱密码换取 JWT。返回 token 与用户对象。

用邮箱与密码登录，换取 JWT（`token`）。后续所有业务接口都用 `Authorization: Bearer <token>` 携带它；也可以[创建 API Key](/api-reference/memo/apikeys/create-list) 改用 `X-API-Key`。

## 接口

```http theme={null}
POST /v1/auth/login
```

## 认证

无需认证（公开登录）。

## 请求体

<ParamField body="email" type="string" required>
  账号邮箱。
</ParamField>

<ParamField body="password" type="string" required>
  登录密码。
</ParamField>

## 响应

<ResponseField name="token" type="string">
  JWT，有效期由服务端配置。
</ResponseField>

<ResponseField name="user" type="object">
  当前账号信息。

  <Expandable title="user">
    <ResponseField name="id" type="string">
      用户 id。
    </ResponseField>

    <ResponseField name="email" type="string">
      邮箱。
    </ResponseField>

    <ResponseField name="display_name" type="string">
      显示名。
    </ResponseField>
  </Expandable>
</ResponseField>

## 示例

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://memo.ariacompute.cn/v1/auth/login \
    -H "Content-Type: application/json" \
    -d '{"email":"you@example.com","password":"<pwd>"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "token": "<jwt>",
    "user": {
      "id": "usr_01a2b3c4d5e6",
      "email": "you@example.com",
      "display_name": "You"
    }
  }
  ```
</ResponseExample>


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