Resource Quotas

Query subscription tier-based resource quotas. Quotas limit the maximum number of persistent resources (such as compute instances) a customer can provision. Unlike rate limits, quotas have no time window – they represent absolute counts.

Quotas vs Rate Limits

Aspect Resource Quotas Rate Limits
Purpose Cap total resources provisioned Cap request frequency
Scope Per customer account Per customer or IP
Example Max 3 compute instances Max 60 API calls per minute
Enforcement Checked before resource creation Checked on every request
Time dimension None (absolute count) Per time window (minute, hour, day, month)
Error code 403 Forbidden 429 Too Many Requests

Get All Customer Quotas

Retrieve all resource quotas for the authenticated customer organized by service.

Endpoint: GET https://apis.threatwinds.com/api/billing/v1/quotas

Headers

Header Type Required Description
Authorization string Optional* Bearer token for session authentication
api-key string Optional* API key for key-based authentication
api-secret string Optional* API secret for key-based authentication

Note: You must use either Authorization header OR API key/secret combination.

Required Roles

owner, admin, or user

Request

curl -X GET \
  'https://apis.threatwinds.com/api/billing/v1/quotas' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <token>'

Response (200 OK)

{
  "customerId": "550e8400-e29b-41d4-a716-446655440000",
  "tierName": "Pro",
  "quotas": {
    "compute-api": {
      "max_instances": {
        "value": 3,
        "description": "Maximum compute instances"
      }
    }
  }
}

Response Schema

Field Type Description
customerId string (UUID) Customer unique identifier
tierName string Subscription tier name
quotas object Quotas organized by service name
quotas.{service}.{featureKey}.value integer Quota value (-1 for unlimited, 0 for disabled)
quotas.{service}.{featureKey}.description string Human-readable description

Get Service-Specific Quotas

Retrieve resource quotas for a specific service only.

Endpoint: GET https://apis.threatwinds.com/api/billing/v1/quotas/{serviceName}

Path Parameters

Parameter Type Required Description
serviceName string Yes Service identifier

Request

curl -X GET \
  'https://apis.threatwinds.com/api/billing/v1/quotas/compute-api' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <token>'

Response (200 OK)

{
  "customerId": "550e8400-e29b-41d4-a716-446655440000",
  "tierName": "Pro",
  "serviceName": "compute-api",
  "quotas": {
    "max_instances": {
      "value": 3,
      "description": "Maximum compute instances"
    }
  }
}

Get Specific Quota Value

Retrieve a single quota value for a specific service and feature.

Endpoint: GET https://apis.threatwinds.com/api/billing/v1/quotas/{serviceName}/{featureKey}

Path Parameters

Parameter Type Required Description
serviceName string Yes Service identifier
featureKey string Yes Quota key name

Request

curl -X GET \
  'https://apis.threatwinds.com/api/billing/v1/quotas/compute-api/max_instances' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <token>'

Response (200 OK)

{
  "customerId": "550e8400-e29b-41d4-a716-446655440000",
  "tierName": "Pro",
  "serviceName": "compute-api",
  "featureKey": "max_instances",
  "value": 3,
  "description": "Maximum compute instances"
}

Get Aggregated Quota Usage

Retrieve current resource usage compared to quota limits across all services.

Endpoint: GET https://apis.threatwinds.com/api/billing/v1/quotas/usage

Headers

Header Type Required Description
Authorization string Optional* Bearer token for session authentication
api-key string Optional* API key for key-based authentication
api-secret string Optional* API secret for key-based authentication

Note: You must use either Authorization header OR API key/secret combination.

Required Roles

owner, admin, or user

Request

curl -X GET \
  'https://apis.threatwinds.com/api/billing/v1/quotas/usage' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <token>'

Response (200 OK)

{
  "customerId": "550e8400-e29b-41d4-a716-446655440000",
  "services": {
    "compute-api": {
      "serviceName": "compute-api",
      "features": [
        {
          "featureKey": "max_instances",
          "currentUsage": 2,
          "limit": 3,
          "remaining": 1,
          "description": "Maximum compute instances"
        }
      ]
    }
  },
  "totalFeatures": 1,
  "fetchedAt": 1744185600
}

Response Schema

Field Type Description
customerId string (UUID) Customer unique identifier
services.{service}.features[] array Array of quota feature usage details
features[].featureKey string Quota key name
features[].currentUsage integer Current resource count
features[].limit integer Maximum allowed (-1 for unlimited)
features[].remaining integer Remaining quota (-1 for unlimited)
features[].description string Human-readable description
totalFeatures integer Total number of quota features tracked
fetchedAt integer Unix timestamp when usage was fetched

Available Quotas by Service

Compute API (compute-api)

Feature Key Description
max_instances Maximum compute instances

Special Values

Value Meaning
-1 Unlimited (no quota enforced)
0 Feature disabled for this tier
> 0 Numeric quota enforced

Error Codes

Status Code Description Possible Cause
200 OK Request successful
400 Bad Request Invalid or empty parameters
401 Unauthorized Missing or invalid authentication
403 Forbidden Insufficient permissions or quota exceeded
404 Not Found Service or feature not found
500 Internal Server Error Server error