Create a Product
The product catalogue is a core concept in Credyt. Before sending usage, you’ll need to add your products, which can be priced in multiple ways:
- Event Type - what product event or outcome are you billing for?
- Currency or asset - do you want to price in fiat or a custom asset such as tokens or minutes?
- Usage type - are you charging per occurrence (unit) or volume (e.g. workload size)?
- Billing Dimensions - do you price differently based on characteristics of the usage such as the AI model used?
To get familiar with Credyt you can create products directly using our Create Product API. This lets you validate your integration and usage flow before building out your full product catalogue.
Start by defining a basic product with a default rate plan. This product will serve as the reference for sending usage events and testing wallet deductions.
Unit-based pricing
Use unit-based pricing to charge per occurrence of a particular event or outcome. In this example, we charge $0.50 per video that is promoted via the Glitch Marketplace:
{
"name": "Glitch Video",
"code": "glitch_video_std",
"prices": [
{
"name": "Video Promotion",
"type": "usage_based",
"billing_model": {
"type": "real_time"
},
"usage_calculation": {
"event_type": "video_promoted",
"usage_type": "unit",
"source_reference_field": "video_id"
},
"pricing": [
{
"asset": "USD",
"values": [
{
"unit_price": 0.5
}
]
}
]
}
],
"publish": true
}
Response
{
"id": "prp_4e28n8kk41931f5yt5em49ecw7",
"code": "glitch_video_std",
"version": 1,
"status": "published",
"is_default": true
}
Products are automatically versioned so you can safely make changes to your pricing without impacting existing customers.