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

# 身份认证

> 通过 AIBase-API-Key Header 认证 GEOBase 开发者 API 请求。

GEOBase 开发者 API 使用 API Key 认证每一次请求。还没有凭证时，请前往 [GEOBase 开发者中心](https://geoservice.aibase.com/developer)创建 API Key；配置说明见[获取 API Key](/geobase-api/quickstart/get-api-key)。

<ParamField header="AIBase-API-Key" type="string" required>
  开发者 API Key，例如 `AIBase_xxxxxxxxxxxxxxxx`。用于身份认证、有效期与调用权限校验。
</ParamField>

<ParamField header="Content-Type" type="string" required>
  固定为 `application/json`。
</ParamField>

<ParamField header="AIBase-Request-Id" type="string">
  开发者自定义请求 ID，用于请求追踪；不传时系统自动生成 UUID。
</ParamField>

## Header 示例

```http theme={null}
AIBase-API-Key: AIBase_xxxxxxxxxxxxxxxx
AIBase-Request-Id: req-20260924-001
Content-Type: application/json
```

## 服务端校验顺序

请求到达后，服务端按以下顺序校验，任一环节不通过将返回 `403` 或 `4002`：

<Steps>
  <Step title="Key 是否有效">
    校验 `AIBase-API-Key` 是否存在且有效。
  </Step>

  <Step title="Key 是否过期">
    校验 Key 是否在有效期内。
  </Step>

  <Step title="IP 白名单">
    校验客户端 IP 是否在 Key 的 IP 白名单内；未配置白名单时默认放行。
  </Step>

  <Step title="API 是否存在且启用">
    校验请求体中的 `apiCode` 对应的 API 是否存在且处于启用状态。
  </Step>

  <Step title="调用权限">
    校验该 Key 是否被授予此 API 的调用权限（仅在 Key 开启权限限制时校验）。
  </Step>
</Steps>

<Warning>
  API Key 请仅在服务端保存和调用，不要直接暴露到浏览器前端、移动端 App 或公开代码仓库。
</Warning>

<Card title="继续：组装通用请求" icon="arrow-right" href="/geobase-api/quickstart/request" horizontal>
  了解统一入口的请求体结构与调用逻辑。
</Card>


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