Skip to content

Commit 1bc3e3c

Browse files
committed
docs(ai-rate-limiting): use meaningful route IDs in request body
1 parent 2c7dcfb commit 1bc3e3c

2 files changed

Lines changed: 24 additions & 12 deletions

File tree

docs/en/latest/plugins/ai-rate-limiting.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ Create a Route as such and update with your LLM providers, models, API keys, and
8585
<TabItem value="admin-api" label="Admin API">
8686

8787
```shell
88-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
88+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
8989
-H "X-API-KEY: ${admin_key}" \
9090
-d '{
91+
"id": "ai-rate-limiting-route",
9192
"uri": "/anything",
9293
"methods": ["POST"],
9394
"plugins": {
@@ -295,9 +296,10 @@ Create a Route which applies a rate limiting quota of 100 total tokens in a 30-s
295296
<TabItem value="admin-api" label="Admin API">
296297

297298
```shell
298-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
299+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
299300
-H "X-API-KEY: ${admin_key}" \
300301
-d '{
302+
"id": "ai-rate-limiting-route",
301303
"uri": "/anything",
302304
"methods": ["POST"],
303305
"plugins": {
@@ -562,9 +564,10 @@ Create a Route which applies a rate limiting quota of 100 total tokens for all i
562564
<TabItem value="admin-api" label="Admin API">
563565

564566
```shell
565-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
567+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
566568
-H "X-API-KEY: ${admin_key}" \
567569
-d '{
570+
"id": "ai-rate-limiting-route",
568571
"uri": "/anything",
569572
"methods": ["POST"],
570573
"plugins": {
@@ -907,9 +910,10 @@ Create a Route as such to set rate limiting and a higher priority on `openai-ins
907910
<TabItem value="admin-api" label="Admin API">
908911

909912
```shell
910-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
913+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
911914
-H "X-API-KEY: ${admin_key}" \
912915
-d '{
916+
"id": "ai-rate-limiting-route",
913917
"uri": "/anything",
914918
"methods": ["POST"],
915919
"plugins": {
@@ -1313,9 +1317,10 @@ curl "http://127.0.0.1:9180/apisix/admin/consumers/janedoe/credentials" -X PUT \
13131317
Create a Route as such and update with your LLM providers, models, API keys, and endpoints, if applicable:
13141318

13151319
```shell
1316-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
1320+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
13171321
-H "X-API-KEY: ${admin_key}" \
13181322
-d '{
1323+
"id": "ai-rate-limiting-route",
13191324
"uri": "/anything",
13201325
"methods": ["POST"],
13211326
"plugins": {
@@ -1757,9 +1762,10 @@ Create a Route with the `ai-rate-limiting` Plugin that applies different rate li
17571762
<TabItem value="admin-api" label="Admin API">
17581763

17591764
```shell
1760-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
1765+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
17611766
-H "X-API-KEY: ${admin_key}" \
17621767
-d '{
1768+
"id": "ai-rate-limiting-route",
17631769
"uri": "/anything",
17641770
"methods": ["POST"],
17651771
"plugins": {

docs/zh/latest/plugins/ai-rate-limiting.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ admin_key=$(yq '.deployment.admin.admin_key[0].key' conf/config.yaml | sed 's/"/
8585
<TabItem value="admin-api" label="Admin API">
8686

8787
```shell
88-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
88+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
8989
-H "X-API-KEY: ${admin_key}" \
9090
-d '{
91+
"id": "ai-rate-limiting-route",
9192
"uri": "/anything",
9293
"methods": ["POST"],
9394
"plugins": {
@@ -295,9 +296,10 @@ curl "http://127.0.0.1:9080/anything" -X POST \
295296
<TabItem value="admin-api" label="Admin API">
296297

297298
```shell
298-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
299+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
299300
-H "X-API-KEY: ${admin_key}" \
300301
-d '{
302+
"id": "ai-rate-limiting-route",
301303
"uri": "/anything",
302304
"methods": ["POST"],
303305
"plugins": {
@@ -562,9 +564,10 @@ curl "http://127.0.0.1:9080/anything" -X POST \
562564
<TabItem value="admin-api" label="Admin API">
563565

564566
```shell
565-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
567+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
566568
-H "X-API-KEY: ${admin_key}" \
567569
-d '{
570+
"id": "ai-rate-limiting-route",
568571
"uri": "/anything",
569572
"methods": ["POST"],
570573
"plugins": {
@@ -907,9 +910,10 @@ X-AI-RateLimit-Reset-deepseek-instance: 0
907910
<TabItem value="admin-api" label="Admin API">
908911

909912
```shell
910-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
913+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
911914
-H "X-API-KEY: ${admin_key}" \
912915
-d '{
916+
"id": "ai-rate-limiting-route",
913917
"uri": "/anything",
914918
"methods": ["POST"],
915919
"plugins": {
@@ -1313,9 +1317,10 @@ curl "http://127.0.0.1:9180/apisix/admin/consumers/janedoe/credentials" -X PUT \
13131317
创建一个 Route 并更新您的 LLM 提供商、模型、API 密钥和端点(如适用):
13141318

13151319
```shell
1316-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
1320+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
13171321
-H "X-API-KEY: ${admin_key}" \
13181322
-d '{
1323+
"id": "ai-rate-limiting-route",
13191324
"uri": "/anything",
13201325
"methods": ["POST"],
13211326
"plugins": {
@@ -1757,9 +1762,10 @@ curl "http://127.0.0.1:9080/anything" -X POST \
17571762
<TabItem value="admin-api" label="Admin API">
17581763

17591764
```shell
1760-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
1765+
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
17611766
-H "X-API-KEY: ${admin_key}" \
17621767
-d '{
1768+
"id": "ai-rate-limiting-route",
17631769
"uri": "/anything",
17641770
"methods": ["POST"],
17651771
"plugins": {

0 commit comments

Comments
 (0)