From sadlay-skills
Use when managing a live New API instance through management REST APIs, especially model management, user and token administration, usage statistics, logs, channels, vendors, groups, pricing options, and health audits.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sadlay-skills:new-api-management-skillThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill to operate a running New API instance through management REST APIs. Do not modify source code unless the user explicitly asks for source changes.
Use this skill to operate a running New API instance through management REST APIs. Do not modify source code unless the user explicitly asks for source changes.
Before any live operation, require:
export NEWAPI_BASE_URL="https://your-new-api.example.com"
export NEWAPI_ACCESS_TOKEN="..."
Optional:
export NEWAPI_USER_ID="1" # default root/admin user id
export NEWAPI_INSECURE_TLS="1" # use curl -k for internal/self-signed HTTPS
If NEWAPI_BASE_URL or NEWAPI_ACCESS_TOKEN is missing, stop and ask the user to set it. Never print the token. If the environment still uses historical NEW_API_* names, map them to NEWAPI_* before calling APIs.
Use direct REST calls. Prefer curl plus jq for inspection and small updates:
curl ${NEWAPI_INSECURE_TLS:+-k} -sS \
-H "Authorization: Bearer $NEWAPI_ACCESS_TOKEN" \
-H "New-Api-User: ${NEWAPI_USER_ID:-1}" \
"$NEWAPI_BASE_URL/api/pricing" | jq .
For updates, fetch current state first, merge only the intended keys, write back, then verify through a fresh GET. Do not replace whole JSON option maps from memory.
The reference layout follows the official management-interface grouping. Load only the file needed for the user’s task:
Official New API docs entrypoint: https://docs.newapi.pro/zh/docs/api, especially the "管理接口" section. When source and docs differ, prefer source for the deployed project behavior and mention the discrepancy.
sk-* API keys only for relay/model-call APIs.Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub sadlay/agent-skills --plugin sadlay-skills