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

# getPolicyUsage

> Reads the current spend usage of a policy for a wallet your app owns or a user's wallet.

## Import

Call this method on a server-side ParaRestClient created with your server secret key.

```ts theme={null}
import { ParaRestClient } from "@getpara/rest-sdk";
```

async

Reads the current spend usage of a policy for a wallet your app owns or a user's wallet.

Copy method signature

### Returns

[`Promise<PermissionsV2PolicyUsage>`](https://docs.getpara.com/v3/references/types/permissions#permissionsv2policyusage)

One meter per metered spend condition.

## Route

`chainId` is required. Use a decimal chain ID such as `"8453"` for EVM, or a network ID such as `solana:mainnet` or `stellar:testnet`. Pass `tokenAddress` when an ERC-20 spend condition names no token. The result reports usage already counted and does not predict whether a new request is allowed.

A policy with no metered spend condition returns an empty `meters` list for a decimal EVM `chainId` the policy covers. For such a policy, a network ID such as `solana:mainnet` fails with 400 `chainId must be a positive EVM chain ID`, whatever the wallet type.

```text theme={null}
GET /v1/permissions-v2/wallets/{walletId}/policies/{policyId}/usage?chainId=...&tokenAddress=...&safeAddress=...
```

With `context.userId`, the method calls `GET /v1/permissions-v2/users/{userId}/policies/{policyId}/usage` with `walletId` in the query instead.

Pass `safeAddress` to add the policy's Safe spend meters for that Safe. Without it, the result has the wallet meters alone.

## Example

Pass the wallet and network to read their spend meters.

```ts theme={null}
const { meters } = await para.getPolicyUsage(policyId, { walletId, chainId: "8453" });
```

## Errors

A non-success response throws `ParaRestError` with the HTTP `status`, the error `code` and a `message`. [Permissions errors](https://docs.getpara.com/v3/references/permissions/errors.md) lists every error code.

An empty path argument throws `ParaRestValidationError` before the request is sent.

| Status | Code | When |
| - | - | - |
| 400 | `INVALID_REQUEST` | `walletId` or `userId` is not a UUID, `chainId` or `tokenAddress` is missing or invalid, the policy's chain selector does not cover this `chainId`, `safeAddress` is not an EVM address, or the policy does not meter spend for the wallet's type. |
| 400 | `INVALID_REQUEST` | Without `userId`, the policy has no metered spend condition and the wallet cannot sign as EVM. The message is `policy usage is available for EVM transaction spend only`. |
| 403 | `FORBIDDEN` | Without `userId`, the wallet is not owned by your app. With `userId`, the wallet has no connection to your app. |
| 404 | `NOT_FOUND` | The policy is not active, or it targets users and `userId` was not sent. |
| 409 | `CONFLICT` | The user's parameter values need confirming, or belong to an earlier policy version. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.