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

# 获取 API Key

> 创建开放平台接口调用凭证

API Key 用来调用 AiToEarn 开放平台接口。后续所有 API 请求都需要在请求头中携带：

```http theme={null}
X-Api-Key: 你的 API Key
```

<Warning>
  API Key 等同于接口访问凭证。不要把它提交到公开仓库、前端源码、截图、聊天记录或客户端安装包中。生产环境建议由你的服务端保存并调用 AiToEarn API。
</Warning>

## 选择站点

国内站和国际站的 API Key 不通用，请先根据要发布的平台选择站点。

| 使用场景 | 站点 | 适合的平台 |
| - | - | - |
| 中国地区社交平台 | [https://aitoearn.cn](https://aitoearn.cn) | 抖音、快手、B 站、小红书、微信视频号、微信公众号 |
| 国际社交平台 | [https://aitoearn.ai](https://aitoearn.ai) | YouTube、TikTok、Twitter、Instagram、Threads、Pinterest、LinkedIn |

## 创建 API Key

1. 打开对应站点并登录 AiToEarn。
2. 在左侧边栏点击 `API Keys`，进入 API Key 管理页面。

<img src="https://mintcdn.com/aitoearn/pY62Y-DX5g2UwMNe/assets/use/api-key/01.png?fit=max&auto=format&n=pY62Y-DX5g2UwMNe&q=85&s=3f151eaf1174ad340e9f5eff0c880d4b" alt="从侧边栏进入 API Keys" width="1706" height="917" data-path="assets/use/api-key/01.png" />

3. 点击 `Create API Key` 创建新的 API Key。

<img src="https://mintcdn.com/aitoearn/pY62Y-DX5g2UwMNe/assets/use/api-key/02.png?fit=max&auto=format&n=pY62Y-DX5g2UwMNe&q=85&s=a752acbeabaa5629a7a50028221f6451" alt="点击 Create API Key" width="1897" height="918" data-path="assets/use/api-key/02.png" />

4. 输入一个便于识别的名称，例如 `publish-demo`，然后点击 `Create API Key`。

<img src="https://mintcdn.com/aitoearn/pY62Y-DX5g2UwMNe/assets/use/api-key/03.png?fit=max&auto=format&n=pY62Y-DX5g2UwMNe&q=85&s=890d3914254c239624119d78688336bd" alt="输入名称并创建 API Key" width="1893" height="904" data-path="assets/use/api-key/03.png" />

创建成功后，密钥只会完整展示一次。请立即复制并保存到安全位置，后续接口请求会使用它完成鉴权。

## 下一步

拿到 API Key 后，继续阅读 [发布流程](../publish-flow)，用它完成账号授权、素材上传和发布流程创建。


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