Paigo Documentation
  • Paigo Dashboard
  • 🏠Overview
    • Home
    • Getting Started with Paigo
    • Key Concepts
  • 💰SaaS Pricing
    • Pricing Basics
      • Product Items
      • Product Plans
    • Model Pricing Structure
      • Pay-as-you-go (Like EC2)
      • Subscription Tier
      • Custom Unit (Like Snowflake)
      • Seat-based Pricing
      • Top-Up Pricing (like OpenAI)
    • Manage Customer Profile
  • 🧩Usage Metering
    • Meter Usage Data at Scale
    • Usage Measurement Template
    • Manage Measurement
    • Infrastructure-based Method
    • Agent-based Method
    • API-based Method
    • Datastore-based Method
    • Configure IAM Role
  • 💳Invoicing and Payment
    • Issue Invoice
      • Automatic Line Item Formatting
    • Process Payment with Stripe
    • Cloud Marketplace Invoicing
    • Handle Tax and Compliance
  • Business Analytics
    • Business Analytics Overview
    • Usage-based Cost Insights
    • Profit Margin Analytics
    • Product Unit Cost
      • Unit Cost for Data Storage
      • Unit Cost for Kubernetes
    • Enable Business Analytics
  • Other
    • Sandbox
    • Customer Wallet and Credits
  • API
    • API Docs
Powered by GitBook
On this page
  • Overview
  • Data Record Schema
  • Leveraging Metadata

Was this helpful?

  1. Usage Metering

API-based Method

PreviousAgent-based MethodNextDatastore-based Method

Last updated 2 years ago

Was this helpful?

Overview

Usage record can be collected to Paigo by Paigo's public REST API. Among other usage measurement and collection methods, API-based measurement is the most flexible method while requires most maintenance work and taking longest time to deliver value. For comparison with other usage measurement and collection methods, see Usage Metering chapter for full documentation.

Data Record Schema

Paigo's usage record ingestion API /usage is designed with simplicity while allowing extensibility for product of various scale. Each individual usage record must be in JSON format that is compliant with the following schema and requirement:

{
  "timestamp": "string",
  "customerId": "string",
  "dimensionId": "string",
  "recordValue": "0.0",
  "metadata": {}
}

Requirement for each field:

  • timestamp : REQUIRED. The timestamp of usage record in format with a 4-digit year. This is the time the usage occurred, or the end of the usage period. Example: 2021-01-23T01:23:45Z

  • customerId: REQUIRED. The Customer ID of a customer this usage record attributes to, assigned by Paigo during customer creation. Example: e8366954-6f36-47e9-8431-ac95f88b5cc7.

  • dimensionId: REQUIRED. The unique identifier of the dimension this usage record is associated with.

  • recordValue : REQUIRED. The amount of the usage on this record. Numerical values are represented as strings to avoid precision loss.

  • metadata : Key-value pairs used for analytical purpose. Example {"environment": "staging", "purpose": "proof-of-concept", "owner": "John Doe"}

Leveraging Metadata

Additional metadata to be stored on the usage record, such as environment, purpose, owner, developer, contract number, or any arbitrary data to be associated with this usage record. Metadata can be used for analytics purpose in the future.

For detailed information on response, payload, and other API spec, see . To construct a usage record payload for API-based method, use Paigo dashboard to try creating a usage record, and copy code from the Preview section at the end of the page to get started. See for more information.

🧩
RFC3339
API Docs
Ingest Usage Record with Dashboard