# 使用 API 密钥

## [Buy API (Postman)](https://www.postman.com/tronsave/tronsave/folder/y222ywm/buy-with-apikey)​

有两种方法可以创建API密钥：

[选项1：在Tronsve网站上生成API密钥。](/chinese/developer/get-api-key/on-the-website.md)

[选项2：在Telegram上生成API密钥。](/chinese/developer/get-api-key/on-telegram.md)

您可以使用API密钥进行:

1. [获取内部账户信息](/chinese/developer/buy-resources-v2/use-api-key/get-internal-account-info.md)
2. [获取订单簿](/chinese/developer/buy-resources-v2/use-api-key/get-order-book.md)
3. [获取估算 TRX (Estimate TRX)](/chinese/developer/buy-resources-v2/use-api-key/estimate-trx.md)
4. [购买能源](/chinese/developer/buy-resources-v2/use-api-key/buy-energy.md)
5. [获取单个订单详情](/chinese/developer/buy-resources-v2/use-api-key/get-one-order-details.md)
6. [获取内部账户订单历史](/chinese/developer/buy-resources-v2/use-api-key/get-internal-account-order-history.md)

## 测试用API列表 - Nile 测试网 <a href="#api-list-for-testing-tron-nile-testnet" id="api-list-for-testing-tron-nile-testnet"></a>

{% tabs %}
{% tab title="测试\_API" %}

* 获取估算 TRX: <mark style="color:orange;">`POST`</mark> `https://api-dev.tronsave.io/v2/estimate-buy-resource`
* 购买能源: <mark style="color:orange;">`POST`</mark> `https://api-dev.tronsave.io/v2/buy-resource`
* 获取内部账户信息: <mark style="color:blue;">`GET`</mark> `https://api-dev.tronsave.io/v2/user-info`
* 获取内部账户订单历史: <mark style="color:blue;">`GET`</mark> `https://api-dev.tronsave.io/v2/orders`
* 获取订单详情: <mark style="color:blue;">`GET`</mark> `https://api-dev.tronsave.io/v2/orders/:id`
* 获取订单簿: <mark style="color:blue;">`GET`</mark> `https://api-dev.tronsave.io/v2/order-book`
  {% endtab %}
  {% endtabs %}


---

# 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.tronsave.io/chinese/developer/buy-resources-v2/use-api-key.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.
