# API 参考

通过 HTTP 请求获取对您的 Edgegap 资源管理功能的访问权限。

<a href="https://raw.githubusercontent.com/edgegap/openapi-specification/refs/heads/main/edgegap-v2-openapi.yaml" class="button primary" data-icon="square-down">下载 openapi \[v2]</a> <a href="http://raw.githubusercontent.com/edgegap/openapi-specification/refs/heads/main/edgegap-v1-openapi.yaml" class="button secondary" data-icon="square-down">下载 openapi \[v1]</a>&#x20;

### 身份验证令牌

在以下位置生成（并查看）您的 Edgegap API 密钥令牌 [仪表板 - 用户设置 / 令牌](https://app.edgegap.com/user-settings?tab=tokens).

在每个 API 请求中都添加您的密钥令牌作为 HTTP 头（包含单词 `token`):

`Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62`

{% hint style="danger" %}
**不要将 Edgegap API 端点集成到游戏客户端中，因为您的 API 令牌可为您的账户提供无限访问权限。请参阅** [集成](/zh/docs/api/ji-cheng.md) **以获取面向客户端的安全 API 端点和功能。**
{% endhint %}

{% hint style="success" %}
如果您的密钥令牌遭到泄露，请将其删除，并更新组织成员的密码。
{% endhint %}

### 响应分页

如果响应中包含的项目过多，我们会返回带有分页信息的数据子集：

<pre class="language-json"><code class="lang-json">{
  "total_count": 100,
  "data": ["foo-0", "[...]", "bar-9"],
  "<a data-footnote-ref href="#user-content-fn-1">分页</a>": {
    "number": 1,
    "next_page_number": 2,
    "previous_page_number": null
    "paginator": {
      "num_pages": 10
    },
    "has_next": true,
    "has_previous": false
  }
}
</code></pre>

对于分页响应，请使用参数 `page` 和 `limit`  以获取更多结果：

* 第二页： `https://api.edgegap.com/v1/apps?`**`page=2`**
* 更多结果： `https://api.edgegap.com/v1/apps?`**`limit=20`**
* 组合： `https://api.edgegap.com/v1/apps?`**`page=2&limit=20`**

### 速率限制

为确保平台稳定性并防止意外账单，我们会限制您组织的 API 使用速率：

* [部署](/zh/learn/bian-pai/deployments.md) 每秒 40 次请求，
* [部署](/zh/learn/bian-pai/deployments.md#context-and-status) 每秒 20 次请求。

{% hint style="info" %}
[联系我们](mailto:info@edgegap.com) 设置为 **规划发布、进行压力测试、估算上线流量，并为成功做好准备。**
{% endhint %}

[^1]: 包含分页信息


---

# 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.edgegap.com/zh/docs/api.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.
