Price objects are the core of the Sulu monetization experience. They are dynamic objects which set the price of each request that passes through the Sulu infrastructure. In this page, you will learn everything about how to create, manage, and use prices to earn from your APIs.

Prices and Requests

Every request in Sulu has a price, even if that price is 0 (what we usually call free 😎). Prices are associated to each request on a per call, per endpoint basis. All the requests made to an endpoint share the same price object, but this does not mean that each request’s price is the same.

This is because prices can be dynamic. For example, in Volume Variable Pricing, the price of a request is affected by how many requests have been done previously within a specified time period, ie. the previous volume of usage.

Price Types

Sulu currently supports 2 types of pricing (more are in the works).

Fixed Price

The price of every request is fixed. Ex. a fixed price of $0.0001 for endpoint GET sample/endpoint means that every request made to GET sample/endpoint has a price of $0.0001 .

Volume Variable Price

The price of each request depends on the volume of calls made previously to an endpoint or group of endpoints, as decribed by a price function. In this case, price is a function of request volume.

Supported Price Functions

Linear Discount

Price decreases linearly as a function of volume, clamped to a minimum price. Parameters include:

  • Default Price: this is the maximum price applied to a request, ex. when no requests have been made yet.
  • Minimum Price: the minimum price a request can have.
  • Calls to reach Minimum Price: the number of calls it takes for a user to reach the minimum price over the defined period.
  • Period: The time period over which requests count towards the price calculation. This is a sliding time window, it is always calculated backwards from the moment the request is made.

Price Lifecycle

Create a Price

Prices can be created from the Pricing section of the Producer Dashboard.

Simply click on the Create New Price button to create a named price of any type described above.

Prices can also be created on the fly when an API is being onboarded.

Edit a Price

Once created, Prices can be edited from the same Pricing dashboard by clicking on the pen icon to the right of each price entry.

Changes to prices will apply to any API that is currently using the price.

Apply a Price

Prices can be applied either when an API is being onboarded, or to an already existing API.

To change the price of an existing API endpoint, refer to the Listings page.