> ## Documentation Index
> Fetch the complete documentation index at: https://docs.privy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Query gas spend

> Query total gas credits charged across wallets for monitoring sponsorship usage

<Warning>
  The following functionality exists for [wallets reconstituted
  server-side](/wallets/wallets/create/create-a-wallet). More on [Privy architecture
  here](/security/wallet-infrastructure/architecture)
</Warning>

Your app can query the total [Privy gas credits](https://dashboard.privy.io/gas-credits) charged across a set of wallets
over a given time range using the `GET /v1/apps/gas_spend` endpoint.

This is useful for tracking gas credit consumption per wallet, reconciling costs, and building internal usage dashboards.

## Request

Send a `GET` request to `https://api.privy.io/v1/apps/gas_spend` with the following query parameters:

<ParamField query="wallet_ids" type="string[]" required>
  Array of wallet IDs to query. Must contain between 1 and 100 IDs.
</ParamField>

<ParamField query="start_timestamp" type="number" required>
  Start of the time range in milliseconds (inclusive).
</ParamField>

<ParamField query="end_timestamp" type="number" required>
  End of the time range in milliseconds (exclusive). The range between `start_timestamp` and
  `end_timestamp` must not exceed 30 days.
</ParamField>

## Response

<ResponseField name="value" type="string">
  Total Privy gas credits charged in USD, as a decimal string (e.g. `"12.345678"`).
</ResponseField>

<ResponseField name="currency" type="string">
  The currency of the value. Always `"usd"`.
</ResponseField>

## Example

```bash theme={"system"}
curl --request GET \
  --url 'https://api.privy.io/v1/apps/gas_spend?wallet_ids=wallet-1&wallet_ids=wallet-2&start_timestamp=1712188800000&end_timestamp=1713398400000' \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'privy-app-id: <privy-app-id>'
```

```json Response theme={"system"}
{
  "value": "12.345678",
  "currency": "usd"
}
```

## Errors

| Status | Description                                                            |
| ------ | ---------------------------------------------------------------------- |
| 400    | Missing or invalid query parameters, or the date range exceeds 30 days |
| 401    | Missing or invalid app secret                                          |
| 404    | One or more wallet IDs do not belong to the app                        |
