Sending Data to Revenium's Metering API
Prerequisites
Authentication
Submitting API Metering Data
curl -X POST https://api.revenium.io/meter/v1/api/meter \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"api": "3c2c3d64-2f59-4642-9406-17d7fb5e2d5c",
"method": "GET",
"url": "https://api.example.com/v1/resource",
"responseCode": 200,
"requestHeaders": ["Content-Type", "Authorization"],
"responseHeaders": ["Content-Type"],
"elements": [
{
"name": "input-tokens",
"value": "1928913"
},
{
"name": "output-tokens",
"value": "391029302"
}
],
"monetized": true
}'Saving an API Event
Submitting an API Request Event
Submitting an API Request Response
Submitting Rating Events
Ingesting Raw JSON Metering Data
Validating a Subscription and Subscriber Credential
Checking if a Subscription is Valid
Checking if a Subscription Credential is Valid
Error Handling
Last updated
Was this helpful?