用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/genlayerlabs/genlayer-studio --skill manage-tiers命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | manage-tiers |
| description | Create, list, update, and delete API rate limiting tiers |
| invocation | user |
CRUD operations for API rate limiting tiers on GenLayer Studio deployments.
Before any operation, determine the target environment:
Ask the user which environment they are targeting:
BASE_URL=http://localhost:4000/api, no admin_key neededBASE_URL=https://<domain>/api, requires admin_keyFor hosted deployments, ask the user for the ADMIN_API_KEY (stored in k8s secrets as ADMIN_API_KEY).
Ask the user which operation to perform: Create, List, Update, or Delete.
curl -s -X POST "$BASE_URL" -H "Content-Type: application/json" --data-binary @- <<'EOF' | python3 -m json.tool
{"jsonrpc":"2.0","method":"admin_listTiers","params":{"admin_key":"<ADMIN_KEY>"},"id":1}
EOF
For local dev (no admin_key):
curl -s -X POST "$BASE_URL" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"admin_listTiers","params":{},"id":1}' | python3 -m json.tool
Ask the user for: name, rate_limit_minute, rate_limit_hour, rate_limit_day.
curl -s -X POST "$BASE_URL" -H "Content-Type: application/json" --data-binary @- <<'EOF' | python3 -m json.tool
{"jsonrpc":"2.0","method":"admin_createTier","params":{"name":"<NAME>","rate_limit_minute":<RPM>,"rate_limit_hour":<RPH>,"rate_limit_day":<RPD>,"admin_key":"<ADMIN_KEY>"},"id":1}
EOF
Note: This endpoint may not exist yet. Check by listing tiers first. If admin_updateTier is not available, inform the user it needs to be implemented.
Ask the user for: name (existing tier) and which limits to change.
curl -s -X POST "$BASE_URL" -H "Content-Type: application/json" --data-binary @- <<'EOF' | python3 -m json.tool
{"jsonrpc":"2.0","method":"admin_updateTier","params":{"name":"<NAME>","rate_limit_minute":<RPM>,"rate_limit_hour":<RPH>,"rate_limit_day":<RPD>,"admin_key":"<ADMIN_KEY>"},"id":1}
EOF
Only include the fields that need changing.
Note: This endpoint may not exist yet. If admin_deleteTier is not available, inform the user it needs to be implemented.
Deletion fails if any API keys (active or inactive) reference the tier.
curl -s -X POST "$BASE_URL" -H "Content-Type: application/json" --data-binary @- <<'EOF' | python3 -m json.tool
{"jsonrpc":"2.0","method":"admin_deleteTier","params":{"name":"<NAME>","admin_key":"<ADMIN_KEY>"},"id":1}
EOF
These are created by the Alembic migration:
| Tier | Requests/min | Requests/hr | Requests/day |
|---|---|---|---|
| free | 30 | 500 | 5,000 |
| pro | 120 | 3,000 | 50,000 |
| unlimited | 999,999 | 999,999 | 999,999 |
| Error | Cause |
|---|---|
-32000 "Admin access required" | Missing or invalid admin_key on hosted deployment |
-32602 "Duplicate tier name" | Tier with that name already exists (unique constraint) |
-32602 "Cannot delete tier: N API key(s) still reference it" | Deactivate/delete keys first |
-32001 "Tier not found: X" | Tier name doesn't exist |
--data-binary @- with heredoc (<<'EOF') to avoid shell expansion issues with special characters in the admin key (e.g., +, =).RATE_LIMIT_ENABLED=false), tiers can still be managed but limits are not enforced.backend/database_handler/models.py (ApiTier class)backend/protocol_rpc/endpoints.py (admin_create_tier, admin_list_tiers)backend/database_handler/migration/versions/b1c3e5f7a902_add_api_tiers_and_api_keys.py基于 SOC 职业分类