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

# 认证

> API 认证方式

## Bearer Token

所有 `/api/v1/*` 接口需要 Bearer Token 认证：

```bash theme={null}
Authorization: Bearer YOUR_API_SECRET
```

<Note>
  你可以在 [API Dashboard](https://api.maxapi.io/dashboard) 中获取你的 API Key。
</Note>

## 示例

```bash theme={null}
curl -X POST https://api.maxapi.io/api/v1/task/submit \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_SECRET" \
  -d '{"model": "nano-banana", "input": {"prompt": "hello"}}'
```

## 错误响应

如果认证失败，API 将返回：

```json theme={null}
{
  "code": 401,
  "msg": "unauthorized"
}
```
