# AI 网关集成

AI 网关可作为各种 AI 应用的**集中式中间后端**使用。

与其让应用直接连接各个独立的 AI 提供方，AI 网关作为统一的访问层，用于路由请求、执行使用策略并提供可观测性能力。

通过这种方式，组织可以在不同工具和环境中，以一致的方式管理 AI 的使用。

## 前置条件

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

* 一个已激活的 [**AI 网关实例**](/welcome/cn/ai-gateway/create-an-ai-gateway.md)
* 一个 AI 网关 **API 密钥**
* 可访问 [**API 文档**](https://docs.console.zenlayer.com/api-reference/compute/aig)
* （可选）Postman 或其他 API 测试工具

### 身份认证

所有发送至 AI 网关的请求都需要使用 API 密钥进行身份认证。

请在请求头中包含你的 API 密钥：

```
Authorization: Bearer YOUR_API_KEY
```

### 统一 API Endpoint

AI 网关为所有受支持的模型提供统一的 API Endpoint。

```
POST https://gateway.theturbo.ai
```

## 支持的应用类型

AI 网关可与多种支持自定义 API Endpoint 和 API 密钥的第三方应用进行集成，包括但不限于：

### **AI 聊天应用**

面向终端用户的聊天界面，用于与大语言模型进行交互。

* ChatGPT-web-midjourney-proxy
* NextChat
* Lobe Chat
* ChatGPT Friend（uTools 插件）
* Chatbox
* Cherry Studio
* ChatWise

### **AI 驱动的 IDE**

内置 AI 能力、用于代码辅助开发的集成开发环境。

* Cursor

### **AI 编程助手**

专为代码理解、生成和重构而设计的独立 AI 工具。

* Claude Code
* Continue
* OpenAI Codex
* OpenCode

### **AI 命令行工具**

基于 CLI 的工具，使开发者可以直接在终端中与 AI 模型交互。

* Gemini CLI

### **内部工具与自定义应用**

需要通过统一 API 后端获取 AI 能力的内部工具或自研应用。

大多数此类应用只需要进行最少的配置——例如设置 API Base URL 和 API Key——即可将所有 AI 请求统一路由至 AI 网关。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/cn/ai-gateway/ai-gateway-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
