v1
latestOpenAPI 3.1.02026-08-042453938.9 KBPricing Plans
Create a pricing plan
Create a new pricing plan for a usage type.
Requires a secret key (sk_*) with the ADMIN role. Public keys and lower-role secret keys will receive 403 Forbidden.
Each unitType can only have one active pricing plan. If you need to change prices, update the existing plan or deactivate it first.
Example unit types:
- api_call - Per API request
- token - Per token processed
- compute_second - Per second of compute
- gb_storage - Per GB stored
post/v1/pricing-plans
Request body
Example request
{
"name": "API Calls",
"unitType": "api_call",
"unitPriceUsd": 0.001,
"unitPrice": 0.0037,
"currency": "USD",
"isActive": true,
"pricingModel": "FLAT",
"creditsPerUnit": 10,
"productCategoryId": "cat_core",
"productCategoryKey": "core_api"
}Response
Pricing plan created
Example response
{
"id": "plan_abc123def456",
"businessId": "biz_789xyz",
"name": "API Calls",
"unitType": "api_call",
"unitPriceUsd": "0.001000",
"unitPrice": "0.000920",
"currency": "USD",
"pricingModel": "FLAT",
"tiers": [
{
"minQuantity": "0",
"maxQuantity": "1000",
"unitPriceUsd": "0.001000",
"unitPrice": "0.000920",
"packageSize": 1000
}
],
"creditsPerUnit": "10",
"productCategoryId": "cat_core",
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}