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

# 快速上手

> 通过 API Key 和第一条请求接入 HubTo 网关。

## 开始前准备

在开始之前，请先确认你已经具备以下条件：

* 已获得可用的 API Key
* 可以访问 `https://api.hubto.ai`

## 在线接入

### 第一步：确认接口地址

如果你使用线上站点，推荐把以下地址作为基础地址：

```bash theme={null}
https://api.hubto.ai/v1
```

如果你需要 Gemini 兼容路径，可直接使用：

```bash theme={null}
https://api.hubto.ai/v1beta/models
```

常见接口包括：

* 模型列表：`GET /v1/models`
* 聊天补全：`POST /v1/chat/completions`
* 文本向量：`POST /v1/embeddings`
* 音频能力：`POST /v1/audio/transcriptions`
* Responses：`POST /v1/responses`

### 第二步：验证 API Key

先请求模型列表，确认你的 API Key 可用：

```bash theme={null}
curl https://api.hubto.ai/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY" \
```

### 第三步：发送第一条请求

下面的示例使用 OpenAI 兼容方式发起聊天请求：

```bash theme={null}
curl https://api.hubto.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.4",
    "messages": [
      {
        "role": "user",
        "content": "你好，请介绍一下你自己。"
      }
    ]
  }'
```

### 第四步：切换模型

多数情况下，你只需要修改请求体里的 `model` 字段，而不需要改动整套接入逻辑。

### 使用其他接口格式

如果你的业务使用 Claude Messages、Gemini 或 OpenAI Responses，HubTo 也提供了对应路径。你可以继续沿用已有请求结构，再将地址切到 HubTo。

完整接口清单和示例见 [API reference](/cn/api-reference/introduction)。

## 下一步

完成第一条请求后，建议继续完善以下内容：

1. 将 API Key 放到环境变量，避免在代码里明文写入。
2. 为不同业务选择对应模型，并验证响应质量与耗时。
3. 根据业务路径继续接入 `/v1/responses`、`/v1/embeddings` 等接口。
