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

# 获取你的 API 密钥

> 创建 Theo API 密钥以开始发起请求。

## 创建账户

1. 前往 [api.hitheo.ai](https://api.hitheo.ai)
2. 使用邮箱或社交账号登录注册
3. 你将进入 API 控制台

## 生成密钥

1. 在侧边栏中导航到 **API Keys**
2. 点击 **Create Key**
3. 为你的密钥起一个描述性的名称（例如 "Production"、"Development"）
4. 立即复制该密钥 —— 它不会再次显示

你的密钥格式如下：

```
theo_sk_a1b2c3d4e5f6...
```

<Warning>
  请安全地保存你的 API 密钥。切勿将其提交到源代码仓库，也不要在客户端代码中暴露它。请改用环境变量来存储。
</Warning>

## 设置环境变量

```bash theme={null}
export THEO_API_KEY=theo_sk_a1b2c3d4e5f6...
```

或将其添加到你的 `.env` 文件中：

```env theme={null}
THEO_API_KEY=theo_sk_a1b2c3d4e5f6...
```

## 验证是否生效

```bash theme={null}
curl https://www.hitheo.ai/api/v1/health
```

该端点是公开的（无需身份验证），会返回系统状态。若要专门验证你的密钥，可执行：

```bash theme={null}
curl https://www.hitheo.ai/api/v1/models \
  -H "Authorization: Bearer $THEO_API_KEY"
```

你应该会收到一份可用 Theo 引擎模型的列表。

## 密钥格式

所有 API 密钥均使用 `theo_sk_` 前缀。这些密钥均为生产密钥 —— 所有用量都将从你的信用额度余额中计费。

## 下一步

<CardGroup cols={2}>
  <Card title="发起你的第一次调用" icon="terminal" href="/quickstart/first-completion">
    使用 curl 发送你的第一个补全请求。
  </Card>

  <Card title="安装 SDK" icon="package" href="/quickstart/install-sdk">
    设置 TypeScript SDK 以获得更好的开发体验。
  </Card>
</CardGroup>


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