Menu

Core Concepts

ApiCharge introduces several key concepts that form the foundation of its monetization system. Understanding these concepts is essential for effectively configuring and utilizing the platform.

ApiCharge Subscriptions

An ApiCharge Subscription is a time-bound grant of access to a specific API route with clearly defined quality of service parameters. The key differentiator is that the subscription is for a specific quality of service, guaranteed by the network component, and can be for minutes or months. This allows for flexible pricing control where service level design and pricing can be changed without impacting existing customers. Furthermore, this integration between the network service provision and pricing strategy itself allows for new types of flexibility, such as going from a monthly access to pay-per-use at a whim.

Key characteristics of ApiCharge Subscriptions include:

ApiCharge Subscription Model
Client → Quote Request → Route Selection → Purchase Token → Access Service with QoS

Quotes

A quote is a digitally signed offer for access to a specific route with defined quality of service parameters at a specified price. Quotes are generated by the ApiCharge server and have a limited validity period.

Quote properties include:

Clients can request quotes from the server, select the desired quote based on their needs, and then proceed with the purchase process.

Access Tokens

After purchasing an ApiCharge Subscription, the client receives an access token. This token is a signed credential that grants the bearer access to the specified route with the agreed quality of service parameters.

Access token components:

The access token is presented with each request to the protected service, typically in an HTTP header or cookie. ApiCharge validates the token and enforces the specified rate limits in real-time.

Rate Limiters

Rate limiters are the mechanisms that enforce quality of service parameters for ApiCharge Subscriptions. They define exactly what a client is allowed to do during their access period.

ApiCharge supports several types of rate limiters:

Rate limiters can be combined to create sophisticated service tiers with precisely defined parameters. For example, a "Basic" tier might have lower call counts and data limits than a "Premium" tier.

Routes

Routes in ApiCharge define the mapping between client requests and backend services. Each route represents a specific API or service that can be monetized.

Routes are configured with:

Routes are defined in the ApiCharge configuration and are used to generate quotes for clients.

Stellar Integration

ApiCharge uses the Stellar blockchain and Soroban smart contracts to handle the payment and verification aspects of ApiCharge Subscriptions. This integration provides:

The Stellar integration happens behind the scenes but is a fundamental part of how ApiCharge secures the monetization process.

Protocol Flow

The complete ApiCharge workflow combines these concepts into a coherent protocol:

  1. Quote Request: Client requests service quotes from the ApiCharge server
  2. Quote Selection: Client selects a route with desired quality of service
  3. Purchase Instruction: Client requests purchase instructions for the selected quote
  4. Payment: Client authorises the payment
  5. ApiCharge Subscription Issuance: Server verifies payment and issues an access token
  6. Service Access: Client uses the token to access the service with agreed QoS parameters

This protocol flow ensures secure, verifiable transactions while providing flexible monetization options for API providers.

Next Steps

Now that you understand the core concepts behind ApiCharge, you can explore: