---
title: "Login"
method: POST
path: "/console/login"
tags: ["console"]
---

# Login

`POST /console/login`

## Request

- Base URL: `https://api.agent4.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agent4.io/console/login`
- Auth: none declared

用户名+密码 → 控制台会话令牌。

失败**不区分**"用户不存在"与"密码错"——否则等于白送一个用户名枚举接口。

**限流按 (来源IP, 账号) + 来源IP 两个维度**，刻意不按账号单独计：那会变成
"任何知道 ADMIN_USER 的人都能把你永久锁在控制台外面"的 DoS。见 app/auth/ratelimit。

## Request body

- AppApiConsoleAuthLoginIn
  - `username` string, required
  - `password` string, required

## Response `200`

Successful Response

- LoginOut
  - `token` string, required
  - `role` string, required
  - `subject` string, required
  - `tenant_id` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/agent4/apis/chatagent-platform.md) · [All operations](https://skmtc.dev/agent4/apis/chatagent-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/agent4/apis/chatagent-platform/revisions/18e58f082ce3?raw)
