> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.alephant.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.alephant.io/_mcp/server.

# 智能体网关

> 了解 Alephant 如何将 AI 网关路由扩展为智能体活动治理

Alephant 是面向生产环境 AI 智能体和工作流的 Agentic Finance Gateway。Agent Gateway 模型说明 Alephant 如何在单个 LLM 请求之外治理智能体活动。

传统 AI 网关负责路由模型请求。它们回答诸如哪个提供商处理了请求、使用了多少 token、请求是否失败以及模型调用成本是多少等问题。

生产环境中的智能体需要更广泛的控制层。单个任务可包含模型调用、工具调用、工作流步骤、重试、策略检查、支付事件和收入归属。主要单位不再只是请求，而是智能体运行。

## AI Gateway 与 Agent Gateway 对比

| 层级   | AI Gateway                    | Alephant Agent Gateway                               |
| ---- | ----------------------------- | ---------------------------------------------------- |
| 主要对象 | 模型请求                          | 智能体或工作流活动                                            |
| 主要职责 | 路由 LLM 调用                     | 治理智能体可执行的操作                                          |
| 身份   | API key 或 provider key        | Agent、member、workflow、Virtual Key 和 workspace        |
| 策略范围 | Provider、model、key、rate limit | Budget、tool、workflow、endpoint、member、payment 和 route |
| 可观测性 | Token 与请求日志                   | Run、session、tool、policy、cost、payment 和 workflow 追踪   |
| 财务视图 | 请求成本                          | 成本、收入、外部支出和利润率                                       |

## 核心流程

Alephant 从团队已熟悉的开发者入口开始：通过 Virtual Key 路由模型，通常使用兼容 OpenAI SDK 的请求。

在此基础上，Alephant 会添加智能体上下文：

1. 创建或识别 Agent、member、workflow 或集成。
2. 将流量绑定到 Virtual Key。
3. 通过 Alephant Gateway 路由模型调用。
4. 在可用时将请求活动关联到 run 或 session。
5. 在高成本或高风险操作继续前评估策略。
6. 记录模型成本、工具成本、策略决策、延迟、错误和审计事件。
7. 将成本、收入和利润率归属到负责的智能体或工作流。

## Alephant 可控制的范围

Alephant 可以治理以下方面的活动：

* LLM provider 和 model 访问
* Virtual Key 和 provider key
* Agent、member、department 和 workspace 预算
* Rate limit、token limit、并发量和时间窗口
* Tool、workflow 和 endpoint 权限
* Prompt template 和路由决策
* 付费 endpoint 访问和感知支付的执行

## 何时使用这一思维模型

需要回答以下问题时，请使用 Agent Gateway 模型：

* 哪个智能体或工作流产生了这笔成本？
* 哪个运行导致了用量激增？
* 哪个工具或模型调用触发了策略决策？
* 该操作在执行前是否被允许？
* 一个付费 endpoint 的收入是否足以覆盖其模型和工具成本？
* 接下来应阻止、限流、升级处理或优化什么？

## 相关页面

* [Gateway Integration](/docs/overview/core-concepts/gateway-integration)
* [Agents & Routing](/docs/overview/core-concepts/agents-routing)
* [Agent Run Tracing](/docs/overview/core-concepts/agent-run-tracing)
* [Policies & Rules](/docs/overview/security-compliance/policies-rules)
* [Agent Finance](/docs/overview/fin-ops-budget/agent-finance)