Plans
Optional templates that bundle a credit limit, refill, overage, and pricing. Assign one to a consumer to inherit its credits.
/plan/createBearerCreate plan
Plans are optional, project-level credit templates. Assign a plan to a consumer and its credits are inherited at creation time.
planNamestringrequiredName of the plan.
creditsobjectrequiredCredit configuration.
limitnumberTotal credit limit.
shadowLimitnumberWarning threshold — fires alerts before the hard limit.
refillobjectAuto-refill: { interval: "hour"|"day"|"week"|"month", amount }.
overageobjectOverage: { enabled, limit }.
expiresAtnumberCredit expiration timestamp (ms).
pricingobjectPricing, e.g. { "monthly": 99.99, "annual": 999 }.
statusstringPlan status. Default "active".
curl -X POST "https://api.reqkey.com/plan/create" \
-H "Authorization: Bearer reqkey_xxx..." \
-H "Content-Type: application/json" \
-d '{
"planName": "Enterprise",
"credits": {
"limit": 100000,
"shadowLimit": 10000,
"refill": {
"interval": "month",
"amount": 50000
},
"overage": {
"enabled": true,
"limit": 5000
}
},
"pricing": {
"monthly": 299.99,
"annual": 2999.99
},
"status": "active"
}'{
"planId": "plan_A1B2C3D4",
"planName": "Enterprise",
"credits": {
"limit": 100000,
"shadowLimit": 10000,
"refill": {
"interval": "month",
"amount": 50000
},
"overage": {
"enabled": true,
"limit": 5000
}
},
"pricing": {
"monthly": 299.99,
"annual": 2999.99
},
"status": "active",
"projectKey": "reqkey_xxx...",
"createdAt": "2026-01-30T12:34:56Z"
}/plan/detailsBearerGet plan details
Fetch a single plan.
planIdstringrequiredPlan ID to retrieve.
curl -X POST "https://api.reqkey.com/plan/details" \
-H "Authorization: Bearer reqkey_xxx..." \
-H "Content-Type: application/json" \
-d '{
"planId": "plan_A1B2C3D4"
}'{
"planId": "plan_A1B2C3D4",
"planName": "Enterprise",
"credits": {
"limit": 100000,
"shadowLimit": 10000,
"refill": {
"interval": "month",
"amount": 50000
},
"overage": {
"enabled": true,
"limit": 5000
}
},
"pricing": {
"monthly": 299.99,
"annual": 2999.99
},
"status": "active",
"projectKey": "reqkey_xxx...",
"createdAt": "2026-01-30T12:34:56Z",
"updatedAt": "2026-01-30T12:34:56Z"
}/plan/listBearerList plans
List all plans in the project.
curl -X POST "https://api.reqkey.com/plan/list" \
-H "Authorization: Bearer reqkey_xxx..."{
"total": 2,
"plans": [
{
"planId": "plan_A1B2C3D4",
"planName": "Enterprise",
"credits": {
"limit": 100000
},
"pricing": {
"monthly": 299.99
},
"status": "active",
"createdAt": "2026-01-30T12:34:56Z"
},
{
"planId": "plan_E5F6G7H8",
"planName": "Starter",
"credits": {
"limit": 1000
},
"pricing": {
"monthly": 9.99
},
"status": "active",
"createdAt": "2026-01-29T10:00:00Z"
}
]
}/plan/updateBearerUpdate plan
Change a plan’s credits, pricing, name, or status.
planIdstringrequiredPlan ID to update.
planNamestringNew plan name.
creditsobjectNew credit configuration.
pricingobjectNew pricing configuration.
statusstringNew status.
curl -X POST "https://api.reqkey.com/plan/update" \
-H "Authorization: Bearer reqkey_xxx..." \
-H "Content-Type: application/json" \
-d '{
"planId": "plan_A1B2C3D4",
"credits": {
"limit": 150000
},
"pricing": {
"monthly": 349.99,
"annual": 3499.99
}
}'{
"planId": "plan_A1B2C3D4",
"planName": "Enterprise",
"credits": {
"limit": 150000
},
"pricing": {
"monthly": 349.99,
"annual": 3499.99
},
"status": "active",
"updatedAt": "2026-01-30T14:00:00Z"
}- Updating a plan does not retroactively change credits on existing consumers — only new consumers inherit the change.
/plan/deleteBearerDelete plan
Soft or hard delete a plan.
planIdstringrequiredPlan ID to delete.
permanentbooleanfalse = soft delete (default), true = hard delete.
curl -X POST "https://api.reqkey.com/plan/delete" \
-H "Authorization: Bearer reqkey_xxx..." \
-H "Content-Type: application/json" \
-d '{
"planId": "plan_A1B2C3D4",
"permanent": false
}'{
"planId": "plan_A1B2C3D4",
"deleted": true,
"permanent": false,
"deletedAt": "2026-01-30T12:34:56Z",
"message": "Plan soft deleted."
}- Existing consumers referencing this plan are not affected by the delete.