> For the complete documentation index, see [llms.txt](https://docs.ggwp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ggwp.com/chinese-simplified/api-wen-dang-liao-tian/biao-zhun-tao-can.md).

# 标准套餐

## 身份验证

GGWP 使用 API 密钥向已授权用户授予对下方列出的所有 API 端点的安全访问权限。所有请求都必须连同已配置的 API 密钥一起提供以下 HTTP 标头：

`x-api-key: <API_KEY>`

每个 API 密钥：

* 唯一标识你的平台/游戏
* 为本文件中列出的所有 API 提供访问权限
* 对每秒可发出的请求数量有特定限制，并且可能还会对按月可发出的请求数量设定配额
* 应妥善保密，不应与任何未授权的游戏/用户共享
* 一旦丢失，就必须重新生成新的密钥

请联系你的 GGWP 客户经理以申请 API 密钥，并为你的游戏设置所需的正确速率限制。

## 如何使用你的 API 密钥

以下是使用有效 API 密钥调用生产环境 API 端点的示例（本示例中已将密钥隐藏）：

```bash
curl --request POST 'https://api.ggwp.com/chat/v3/message' \
--header 'x-api-key: api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
          "session_id": "match_7765",
          "message": "到处都是他妈的弱智",
          "user_id": "user989",
          "username": "nlxdz",
          "timestamp": "2022-06-02 16:49:02"
}'
```

无效的 API 密钥将返回一个 `403` 返回代码。以下是使用无效 API 密钥时的示例响应：

```bash
< HTTP/2 403
< date: Thu, 18 Nov 2021 21:28:27 GMT
< content-type: application/json
< content-length: 23
< x-amzn-requestid: f4361ec6-71bc-478f-98cd-da0fe9df829b
< x-amzn-errortype: ForbiddenException
< x-amz-apigw-id: JBPLRHGjPHcFdbg=
<
* Connection #0 to host api.ggwp.com left intact
{"message":"Forbidden"}* Closing connection 0
```
