---
document_id: agent.paths.api.authentication
schema_version: 2
parent_document_id: agent.paths.api
section: querying
---

<!-- Generated by scripts.build_agent_guide; do not edit. -->

# API authentication / API 鉴权

## API key / API Key

已有 API Key 的服务端程序可按接口要求发送 Authorization: Bearer。账户、Key 配额与可用权限仍由服务端校验。不要从网页或文档中猜测其他账号的权限。

A server-side program with an API key can send Authorization: Bearer as required by the endpoint. The service validates account access and key limits; a documentation listing does not establish account permission.

## Programmatic OAuth / 程序 OAuth

需要用户交互授权的程序可用 OAuth，按所选区域的公开授权信息完成授权、保存和刷新凭据。读取[程序 OAuth 与四语言完整示例](https://docs.asklear.cn/oauth)，不要将客户端 MCP 配置步骤当作你程序的 OAuth 实现。

Programs needing interactive user authorization can use OAuth. Follow regional authorization metadata, store credentials and refresh them. Read [programmatic OAuth and complete examples](https://docs.asklear.cn/en/oauth), rather than using MCP client configuration as your program implementation.

只想在 Agent 中使用 Asklear 的用户，请去[连接与验证](https://docs.asklear.cn/agent/getting-started)。不需要自己编写 OAuth 程序。

To use Asklear inside an Agent, open [connection and verification](https://docs.asklear.cn/en/agent/getting-started). You do not need to implement an OAuth program.
