# Pay as you Go (PAYG)

With our Pay as you Go pricing, pay for our API based on how much you need. Our Pay as you Go offering is powered by [Dhali](https://dhali.io/docs/getting-started/). Click the link below to access Dhali payment terminal.

{% embed url="<https://pay.dhali.io/?uuids=ee519808-97b7-4288-abb8-17d4a8513ea5>" %}

## PAYG API base URL

Base URL for accessing XRP Ledger mainnet is:

```
https://xrpscan.dhali.io
```

## Full URL

To query ledger index `93957385`, use:

```
https://xrpscan.dhali.io/api/v1/ledger/93957385
```

## How to Pay as you Go

* Log into Dhali Payment Terminal, follow the instructions shown in the app to create a payment channel.
* Click "**Deposit**" to deposit enough `XRP` for your needs.
* Click "**Get payment claim**" to authorize spending your deposit.
* Copy `PAYMENT_CLAIM` value and save it securely. All API requests must use this payment claim to access the API.&#x20;
* Add `PAYMENT_CLAIM` to your request headers:

```
$ PAYMENT_CLAIM='<PAYMENT-CLAIM-VALUE>'
$ curl -H "Payment-Claim: $PAYMENT_CLAIM" https://xrpscan.dhali.io/<API_ENDPOINT>
```

* Monitor your usage via the Payment Terminal. Authorize more funds as needed.

## Example

```
$ PAYMENT_CLAIM='nue9eith1Cai......xi4toh8ohwfQ=='
$ curl -H "Payment-Claim: $PAYMENT_CLAIM" https://xrpscan.dhali.io/api/v1/ping
```

## Dhali documentation

{% embed url="<https://dhali.io/docs/getting-started/>" %}

## Dhali SDKs

{% embed url="<https://www.npmjs.com/package/dhali-js>" %}
dhali-js for Node.js applications
{% endembed %}

{% embed url="<https://pypi.org/project/dhali-py/>" %}
dhali-py for Python applications
{% endembed %}
