Skip to main content
GET
/
api
/
v1
/
usage
/
quantity-price
Python SDK
from metrifox_sdk import MetrifoxClient

client = MetrifoxClient(api_key="your_api_key")

# Compute the price of 500 units of a feature for a customer
price = client.usages.quantity_price(
    customer_key="cust-6d11ca90",
    feature_key="feature_interview_booking",
    quantity=500,
)

print(f"{price['data']['price']} {price['data']['unit']}")

# For tiered pricing, inspect the per-tier breakdown
for tier in price['data'].get('applied_tiers', []):
    print(
        f"  Tier {tier['first_unit']}-{tier['last_unit']}: "
        f"{tier['units_consumed']} units -> {tier['tier_price']}"
    )
{
  "message": "Quantity price fetched",
  "data": {
    "customer_key": "cust-6d11ca90",
    "feature_key": "feature_interview_booking",
    "quantity": 500,
    "price": 3000,
    "unit": "USD",
    "applied_tiers": [
      {
        "first_unit": 0,
        "last_unit": 100,
        "pricing_model": "per_unit",
        "unit_price": 10,
        "package_price": null,
        "package_size": null,
        "flat_fee": null,
        "min_price": null,
        "max_price": null,
        "percentage": null,
        "total_unit_quantity": null,
        "units_consumed": 100,
        "tier_price": "1000.0"
      },
      {
        "first_unit": 101,
        "last_unit": 1000,
        "pricing_model": "per_unit",
        "unit_price": 5,
        "package_price": null,
        "package_size": null,
        "flat_fee": null,
        "min_price": null,
        "max_price": null,
        "percentage": null,
        "total_unit_quantity": null,
        "units_consumed": 400,
        "tier_price": "2000.0"
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.metrifox.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Query Parameters

customer_key
string
required

The customer key to compute the price for

feature_key
string
required

The feature key to compute the price for

quantity
number
required

The quantity you want to price

Required range: x >= 0

Response

Quantity price computed

message
string
Example:

"Quantity price fetched"

data
object