> For the complete documentation index, see [llms.txt](https://minara.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://minara.ai/docs/minara-handbook/zh/jiao-yi/agent-api.md).

# API

Minara Agent API 通过标准 HTTP 接口，让开发者、交易者和市场分析师能够直接访问 Minara 的金融情报和交易执行能力。

<figure><img src="/files/45c3fa9ed964496e7833c5b4f47caa712ea40013" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
需要 **专业版** 订阅套餐。在 Lite 和 Starter 套餐中，你个人资料里的 API 选项卡会显示升级提示，而不是密钥创建界面。通过 x402 按需付费无需套餐要求。
{% endhint %}

### 你可以用 API 做什么

跨加密货币和股票查询实时市场数据：钱包活动、DeFi 指标、链上资金流、alpha 信号。所有响应都经过结构化，便于代理消费。

发送市场上下文查询并获得做多或做空建议，以及可立即执行的预设订单载荷。这缩短了从信号到交易的循环。

用通俗英语描述一笔交易；API 会返回可执行的链上交易载荷，默认兼容 OKX DEX。

查询事件结果的 AI 估计概率分布，适用于预测市场，由市场数据、新闻背景和不确定性区间支持。可用它识别定价偏差的赔率，并在更清晰的风险边界下控制仓位规模。

### 工作原理

两种计费方式：

1. API Key，适用于 Pro 套餐。你可以在 Minara 个人资料中生成密钥，并将其包含在 `Authorization` 标头中。
2. 通过 [x402 协议](https://www.x402.org/)x402 按需付费。每个请求都使用 USDC 等稳定币支付；无需订阅套餐。

### 开始使用

* [身份验证](/docs/minara-handbook/zh/jiao-yi/agent-api/authentication.md)：各计费方式下请求如何进行身份验证。
* [API 密钥](/docs/minara-handbook/zh/jiao-yi/agent-api/api-key.md)：在 Pro 套餐上生成并管理密钥。
* [x402](/docs/minara-handbook/zh/jiao-yi/agent-api/x402.md)：按请求使用稳定币付费。
* [API 参考（API Key）](/docs/minara-handbook/zh/jiao-yi/agent-api/api-reference-api-key.md)：API Key 流程的完整端点规范。
* [API 参考（x402）](/docs/minara-handbook/zh/jiao-yi/agent-api/api-reference-x402.md)：x402 流程的完整端点规范。


---

# 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://minara.ai/docs/minara-handbook/zh/jiao-yi/agent-api.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.
