Commet
  • Pricing
Log InTry out
Check usage availability POSTTrack usage event POST
DocumentationKnowledge BaseBuild with AIAPI ReferenceWebhooks

Check usage availability

Check if a customer can consume a feature before actual consumption. Returns availability and cost estimates based on the plan's consumption model.

List subscriptions GET

List all subscriptions. Filter by customer ID, external ID, or status.

Track usage event POST

Track a usage event for a metered feature. Deducts from balance/credits if applicable.

POST
/usage/check

Authorization

ApiKeyAuth
x-api-key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

customerId*string
1 <= length <= 200
featureCode*string
^[a-z0-9_]+$
1 <= length <= 100
quantity?integer
1
0 < value
Length
Match
Length
Default
Range

Response Body

application/json

curl -X POST "https://commet.co/api/usage/check" \  -H "Content-Type: application/json" \  -d '{    "customerId": "string",    "featureCode": "string"  }'

application/json

application/json

application/json

application/json

Check if a customer can consume a feature before actual consumption. Returns availability and cost estimates based on the plan's consumption model.

{
  "success": true,
  "data": {
    "allowed": true,
    "consumptionModel": "metered",
    "feature": "string",
    "quantity": 0,
    "current": 0,
    "remaining": 0,
    "unlimited": true,
    "included"















{
  "success": false,
  "code": "string",
  "message": "string",
  "details": null
}
{
  "success": false,
  "code": "string",
  "message": "string",
  "details": null
}
{
  "success": false,
  "code": "string",
  "message": "string",
  "details": null
}
{
  "success": false,
  "code": "string",
  "message": "string",
  "details": null
}
:
0
,
"overageEnabled": true,
"overageUnitPrice": 0,
"creditsPerUnit": 0,
"estimatedCredits": 0,
"planCredits": 0,
"purchasedCredits": 0,
"totalCredits": 0,
"unitPrice": 0,
"estimatedAmount": 0,
"currentBalance": 0,
"blockOnExhaustion": true,
"currency": "string",
"reason": "string",
"message": "string"
}
}