Skip to content

Introduction

Dhali is an API gateway provider, enabling seamless API monetisation using open, next generation payment technology. API users can generate their own API keys on-demand and independently of API providers. Just like regular API keys, Dhali API keys get embedded into request headers. Unlike regular API keys, Dhali API keys have direct monetary value, enabled by Blockchain technology. This approach enables a world where no registrations or subscriptions are required. Authentication is replaced with a real-time nano-payment, which gets embedded into a request header:

curl_image

Why Dhali?

Everyone benefits:

  • API users:
    1. Get low costs.
    2. Get flexibility, with no need for commitments.
    3. Get access to APIs around the world, independent of their jurisdiction's banking system.
  • API creators:
    1. Increase reach through globally accessible blockchain technology.
    2. Reduce costs (checkout our pricing calculator to understand our costs).
    3. Reduce payment delays. We pay out API earnings to providers every 24 hours, rather than the typical weeks or even months imposed by the traditional financial system.
    4. Reduce payment failures. Our usage of next generation payment technology brings payment failure rates to zero.

How Dhali works?

Dhali uses blockchain payment channels to allow users to pay for APIs. Dhali API keys (often called payment claims) are actually layer-2 blockchain transactions against payment channels. A payment channel is a type of blockchain technology that allows for secure, fast, and low-cost transactions without needing to commit all those transactions individually to the blockchain.

A payment channel is like a locked box of money shared between two friends. Each time one friend wants to pay the other, instead of handing money directly, they exchange a key that permits a certain amount of money to be taken from the box in the future. The locked box only needs to be opened at the end when they're done transacting.

A payment claim is a JSON that is sent to Dhali. In the payment channel analogy above, it is a key to the box. It may represent fractions of a cent in value. Dhali checks its cryptographic validity, ensuring it can be used to pull money from the payment channel in the future. The maximum amount of money that can be taken is determined by the payment claim creator. Every 24 hours we submit the payment claim to the ledger, pulling from the payment channel what is owed to the API owner.

Payment claims are cumulative, meaning that if a user makes an API call costing X, followed by another API call costing Y, the first payment claim must have a value of at least X while the second payment claim must have a value of at least X+Y. Also, the second payment makes the first payment claim obsolete. All requests to Dhali should include the payment-claim header:

Payment-Claim: $PAYMENT_CLAIM_JSON
To understand more about payment claims, see our section on adding the Dhali payment terminal:

How to add the payment terminal