# Gas credit & transactions API

> Read USD gas credit balance and deposit/usage history with your app API key

Use these **read APIs** on the dedicated **Paymaster** host from your backend to show gas credit balance and transaction history in **your** product UI.

They use the **same app API key** as Paymaster JSON-RPC sponsorship — not dashboard JWT login.

## Auth

Pass your dashboard app API key as:

- Query: `?apikey=YOUR_APP_API_KEY`, or
- Header: `x-api-key: YOUR_APP_API_KEY`

Base URL (Paymaster service): `https://paymaster.abstraxn.com`

## Get gas credit balance

```http
GET /api/v2/account/gas-credit?apikey=YOUR_APP_API_KEY
```

```bash
curl "https://paymaster.abstraxn.com/api/v2/account/gas-credit?apikey=YOUR_APP_API_KEY"
```

Returns account-level USD credit for the user who owns the app (available / blocked / total, mainnet + testnet).

Example `result`:

```json
{
  "availableUsd": "12.500000",
  "blockedUsd": "0.120000",
  "totalUsd": "12.620000",
  "availableUsdMainnet": "10.000000",
  "availableUsdTestnet": "2.500000",
  "isSponsorship": true
}
```

## List deposit transactions

```http
GET /api/v2/account/deposit-transactions?apikey=YOUR_APP_API_KEY&page=1&limit=20
```

Optional query params:

| Param | Description |
| --- | --- |
| `page`, `limit` | Pagination |
| `chainId` | Filter by chain |
| `depositType` | `crypto` or `fiat` |

## List usage transactions

```http
GET /api/v2/account/usage-transactions?apikey=YOUR_APP_API_KEY&page=1&limit=20
```

Optional query params:

| Param | Description |
| --- | --- |
| `page`, `limit` | Pagination |
| `chainId` | Filter by chain |
| `source` | `evm` or `solana` |
| `network` | `mainnet`, `testnet`, or `devnet` |
| `s` | Search by tx / UserOp hash |

## Typical app flow

1. User opens your app screen for “Gas credit”.
2. Your backend calls `gas-credit` + deposit/usage lists on the Paymaster host with your API key.
3. You render balance and history in your UI.

Do **not** expose your API key in a public browser bundle. Call these from your server.
