> For the complete documentation index, see [llms.txt](https://whitepaper.virtuals.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.virtuals.io/virtuals-bai-pi-shu/guan-yu-virtuals-1/xie-yi/zuo-wei-ke-bian-cheng-qu-zhong-xin-hua-shi-ti-de-virtual-agents/zhi-neng-ti-tui-li-zhi-fu.md).

# 智能体推理支付

了解 Virtuals Protocol 如何通过公开 API、按次推理成本和链上 $VIRTUAL 代币交易来处理 AI 智能体推理支付。

### AI 代理推理支付和 API 使用

Virtuals Protocol 支持 AI 代理 API 使用的链上支付。用户使用 $VIRTUAL 代币为每次 AI 推理付费。

* **无需许可的公共 API 访问：** 所有代理都可通过公共 API 访问。
* **预设的 AI 推理成本：** 每次推理调用都有预设成本。
* **链上 $VIRTUAL 支付机制：**
  * 用户将 $VIRTUAL 代币预先充值到钱包中。
  * 每笔交易都会在链上扣除 $VIRTUAL 代币。

<details>

<summary><em><strong>AI 代理推理支付示例</strong></em></summary>

*Roblox 上的一位地图创作者利用 Virtuals 平台，在其 Roblox 地图中创建作为 NPC 的游戏代理。所有这些游戏代理产生的推理都由地图创作者按次支付。创作者愿意承担推理成本，因为由 VIRTUAL 代理实现的无限内容会带来更高的收入，并吸引更多玩家来到他们的地图。*

</details>

### 链上 AI 代理支付流程

* **AI 代理 API 支付：** 当用户通过 API 调用某个代理时，$VIRTUAL 会从用户的钱包转入该代理的钱包。
* **代理支付用途：** 累积在代理钱包中的支付可用于支持进一步开发或社区激励。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://whitepaper.virtuals.io/virtuals-bai-pi-shu/guan-yu-virtuals-1/xie-yi/zuo-wei-ke-bian-cheng-qu-zhong-xin-hua-shi-ti-de-virtual-agents/zhi-neng-ti-tui-li-zhi-fu.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
