# Account

> The account behind the key or token.


## The account behind the key or token, and the connection itself

<a id="account"></a>`account`

`GET /account`

Scope: `account:read`

### Responses

- `200` The account. ([`Account`](https://imgsearch.com/developers/reference/schemas.md#Account))
- `default` Error envelope ([`Error`](https://imgsearch.com/developers/reference/schemas.md#Error))

### Examples

**curl**

```bash
# The account behind the key, and the key itself.
# Needs IMGSEARCH_API_KEY.
curl -sS \
  "${IMGSEARCH_API_BASE:-https://imgsearch.com/api/v2}/account" \
  -H "Authorization: Bearer $IMGSEARCH_API_KEY"
```

**Python**

```python
# The account behind the key, and the key itself.
# Needs IMGSEARCH_API_KEY.
import json
import os

import httpx

base = os.environ.get("IMGSEARCH_API_BASE", "https://imgsearch.com/api/v2")
headers = {"Authorization": f"Bearer {os.environ['IMGSEARCH_API_KEY']}"}

r = httpx.get(f"{base}/account", headers=headers, timeout=60)
print(r.status_code)
print(json.dumps(r.json(), indent=2))
```

**JavaScript**

```js
// The account behind the key, and the key itself.
// Needs IMGSEARCH_API_KEY.
const base = process.env.IMGSEARCH_API_BASE ?? "https://imgsearch.com/api/v2";

const r = await fetch(`${base}/account`, { headers: { Authorization: `Bearer ${process.env.IMGSEARCH_API_KEY}` } });
console.log(r.status);
console.log(JSON.stringify(await r.json(), null, 2));
```

**Response 200**

```json
{
    "object": "account",
    "id": "usr_7004e9fd785c5cf2",
    "email": "you@example.com",
    "email_verified": true,
    "plan": {
        "key": "infinite",
        "name": "Complimentary"
    },
    "adult_confirmed": true,
    "can_generate": true,
    "generate_blocked_reason": null,
    "connection": {
        "type": "api_key",
        "name": "Examples replay",
        "scopes": [
            "search",
            "download",
            "generations:read",
            "generations:write",
            "account:read",
            "webhooks",
            "generate"
        ],
        "created_at": "2026-11-26T09:45:23Z",
        "expires_at": "2026-12-26T09:45:23Z",
        "spending_enabled": true,
        "monthly_cap_usd": 2,
        "spent_this_month_usd": 0.182,
        "resets_at": "2026-12-01T00:00:00Z"
    }
}
```

## The AI balance in US dollars, by source and lot

<a id="account.balance"></a>`account.balance`

`GET /account/balance`

Scope: `account:read`

Reading it settles lots that are due (expiries and yearly instalments), as the account page does.

### Responses

- `200` The balance. ([`Balance`](https://imgsearch.com/developers/reference/schemas.md#Balance))
- `default` Error envelope ([`Error`](https://imgsearch.com/developers/reference/schemas.md#Error))

### Examples

**curl**

```bash
# The AI balance in US dollars, by source and lot.
# Needs IMGSEARCH_API_KEY.
curl -sS \
  "${IMGSEARCH_API_BASE:-https://imgsearch.com/api/v2}/account/balance" \
  -H "Authorization: Bearer $IMGSEARCH_API_KEY"
```

**Python**

```python
# The AI balance in US dollars, by source and lot.
# Needs IMGSEARCH_API_KEY.
import json
import os

import httpx

base = os.environ.get("IMGSEARCH_API_BASE", "https://imgsearch.com/api/v2")
headers = {"Authorization": f"Bearer {os.environ['IMGSEARCH_API_KEY']}"}

r = httpx.get(f"{base}/account/balance", headers=headers, timeout=60)
print(r.status_code)
print(json.dumps(r.json(), indent=2))
```

**JavaScript**

```js
// The AI balance in US dollars, by source and lot.
// Needs IMGSEARCH_API_KEY.
const base = process.env.IMGSEARCH_API_BASE ?? "https://imgsearch.com/api/v2";

const r = await fetch(`${base}/account/balance`, { headers: { Authorization: `Bearer ${process.env.IMGSEARCH_API_KEY}` } });
console.log(r.status);
console.log(JSON.stringify(await r.json(), null, 2));
```

**Response 200**

```json
{
    "object": "balance",
    "available_usd": 0.604,
    "held_usd": 0,
    "held_reason": null,
    "by_source_usd": {
        "plan": 0,
        "gift": 0,
        "top_up": 0.604
    },
    "lots": [
        {
            "source": "top_up",
            "amount_usd": 0.604,
            "available_at": "2026-11-08T16:02:16Z",
            "expires_at": "2028-11-08T16:02:16Z",
            "on_hold": false
        }
    ],
    "next_grant": null
}
```

## The AI balance's ledger in US dollars, newest first

<a id="account.transactions"></a>`account.transactions`

`GET /account/balance/transactions`

Scope: `account:read`

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `direction` | query | string | No | One of: credit, debit. |
| `limit` | query | integer | No | Items per page. |
| `cursor` | query | string | No | The next_cursor of the previous page, as it came. It works only for the same list, filter and account. |

### Responses

- `200` One page of the ledger. ([`List`](https://imgsearch.com/developers/reference/schemas.md#List))
- `default` Error envelope ([`Error`](https://imgsearch.com/developers/reference/schemas.md#Error))

### Examples

**curl**

```bash
# The last five debits of the AI balance ledger.
# Needs IMGSEARCH_API_KEY.
curl -sS \
  "${IMGSEARCH_API_BASE:-https://imgsearch.com/api/v2}/account/balance/transactions?direction=debit&limit=5" \
  -H "Authorization: Bearer $IMGSEARCH_API_KEY"
```

**Python**

```python
# The last five debits of the AI balance ledger.
# Needs IMGSEARCH_API_KEY.
import json
import os

import httpx

base = os.environ.get("IMGSEARCH_API_BASE", "https://imgsearch.com/api/v2")
headers = {"Authorization": f"Bearer {os.environ['IMGSEARCH_API_KEY']}"}

r = httpx.get(
    f"{base}/account/balance/transactions",
    headers=headers,
    params={"direction": "debit", "limit": 5},
    timeout=60,
)
print(r.status_code)
print(json.dumps(r.json(), indent=2))
```

**JavaScript**

```js
// The last five debits of the AI balance ledger.
// Needs IMGSEARCH_API_KEY.
const base = process.env.IMGSEARCH_API_BASE ?? "https://imgsearch.com/api/v2";

const r = await fetch(`${base}/account/balance/transactions?direction=debit&limit=5`, {
  headers: { Authorization: `Bearer ${process.env.IMGSEARCH_API_KEY}` },
});
console.log(r.status);
console.log(JSON.stringify(await r.json(), null, 2));
```

**Response 200**

```json
{
    "object": "list",
    "data": [
        {
            "object": "balance_transaction",
            "id": "ctx_d66c5ca1206947be",
            "direction": "debit",
            "amount_usd": 0.01,
            "balance_after_usd": 0.594,
            "reason": "AI Generator: Image",
            "source": "generation",
            "refunded": true,
            "refund_of": null,
            "created_at": "2026-11-26T11:45:29Z",
            "job": {
                "type": "generation",
                "id": "01m8bkxvdyfespxd9sbk178hkr"
            }
        },
        {
            "object": "balance_transaction",
            "id": "ctx_b696eda286414952",
            "direction": "debit",
            "amount_usd": 0.01,
            "balance_after_usd": 0.604,
            "reason": "AI Generator: Image",
            "source": "generation",
            "refunded": false,
            "refund_of": null,
            "created_at": "2026-11-26T11:45:29Z",
            "job": {
                "type": "generation",
                "id": "01m8bkxtwgssxsn1ed6e65jnza"
            }
        },
        {
            "object": "balance_transaction",
            "id": "ctx_ced81b22e73d7a89",
            "direction": "debit",
            "amount_usd": 0.006,
            "balance_after_usd": 0.608,
            "reason": "AI Generator: Image",
            "source": "generation",
            "refunded": true,
            "refund_of": null,
            "created_at": "2026-11-26T11:45:28Z",
            "job": {
                "type": "generation",
                "id": "01m8bkxt07eds5vxbad257azj0"
            }
        },
        {
            "object": "balance_transaction",
            "id": "ctx_370722fa702fb1fd",
            "direction": "debit",
            "amount_usd": 0.01,
            "balance_after_usd": 0.614,
            "reason": "AI Generator: Image",
            "source": "generation",
            "refunded": false,
            "refund_of": null,
            "created_at": "2026-11-26T11:45:27Z",
            "job": {
                "type": "generation",
                "id": "01m8bkxs9212pmc6h2hzwnys3s"
            }
        },
        {
            "object": "balance_transaction",
            "id": "ctx_eff8dde049fb20e5",
            "direction": "debit",
            "amount_usd": 0.1,
            "balance_after_usd": 0.624,
            "reason": "AI Generator: 3D model",
            "source": "generation",
            "refunded": false,
            "refund_of": null,
            "created_at": "2026-11-26T11:45:23Z",
            "job": {
                "type": "generation",
                "id": "01m8bkxnmvbtztw64v4jc0b3jb"
            }
        }
    ],
    "has_more": true,
    "next_cursor": "EXAMPLE-CURSOR"
}
```

## How the account stands against its limits right now

<a id="account.limits"></a>`account.limits`

`GET /account/limits`

Scope: `account:read`

Statuses only, no ceilings: search and downloads read limited only while an enforced limit is full, with the seconds until it opens again.

### Responses

- `200` The limits. ([`Limits`](https://imgsearch.com/developers/reference/schemas.md#Limits))
- `default` Error envelope ([`Error`](https://imgsearch.com/developers/reference/schemas.md#Error))

### Examples

**curl**

```bash
# How the account stands against its limits right now.
# Needs IMGSEARCH_API_KEY.
curl -sS \
  "${IMGSEARCH_API_BASE:-https://imgsearch.com/api/v2}/account/limits" \
  -H "Authorization: Bearer $IMGSEARCH_API_KEY"
```

**Python**

```python
# How the account stands against its limits right now.
# Needs IMGSEARCH_API_KEY.
import json
import os

import httpx

base = os.environ.get("IMGSEARCH_API_BASE", "https://imgsearch.com/api/v2")
headers = {"Authorization": f"Bearer {os.environ['IMGSEARCH_API_KEY']}"}

r = httpx.get(f"{base}/account/limits", headers=headers, timeout=60)
print(r.status_code)
print(json.dumps(r.json(), indent=2))
```

**JavaScript**

```js
// How the account stands against its limits right now.
// Needs IMGSEARCH_API_KEY.
const base = process.env.IMGSEARCH_API_BASE ?? "https://imgsearch.com/api/v2";

const r = await fetch(`${base}/account/limits`, { headers: { Authorization: `Bearer ${process.env.IMGSEARCH_API_KEY}` } });
console.log(r.status);
console.log(JSON.stringify(await r.json(), null, 2));
```

**Response 200**

```json
{
    "object": "limits",
    "requests": {
        "limit": 600,
        "remaining": 549,
        "reset_seconds": 42
    },
    "search": {
        "status": "ok",
        "retry_after_seconds": null
    },
    "downloads": {
        "status": "ok",
        "retry_after_seconds": null
    },
    "fair_use": {
        "status": "ok",
        "videos_status": "ok",
        "resets_at": "2026-12-07T14:57:00Z"
    },
    "generations": {
        "active": 0,
        "max_active": 4,
        "running_max": 2
    }
}
```

## What this account's agents reused instead of generating

<a id="account.savings"></a>`account.savings`

`GET /account/savings`

Scope: `account:read`

What this account's agents reused instead of generating in one calendar month (UTC). A result counts when an API search showed it and the same account then downloaded it through the API or a connector within 24 hours, once per item a day. The estimate is the default model's price for that kind at the time of the search, one output; it covers only reuses the account could have paid for (a paid plan or bought AI balance) and never changes the balance. Brands and sound effects never count. Website downloads never count.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `month` | query | string | No | A calendar month in UTC, this one or an earlier one; this month when left out. |

### Responses

- `200` The month's savings. ([`Savings`](https://imgsearch.com/developers/reference/schemas.md#Savings))
- `default` Error envelope ([`Error`](https://imgsearch.com/developers/reference/schemas.md#Error))

### Examples

**curl**

```bash
# What this account's agents reused this month instead of generating.
# Needs IMGSEARCH_API_KEY.
curl -sS \
  "${IMGSEARCH_API_BASE:-https://imgsearch.com/api/v2}/account/savings" \
  -H "Authorization: Bearer $IMGSEARCH_API_KEY"
```

**Python**

```python
# What this account's agents reused this month instead of generating.
# Needs IMGSEARCH_API_KEY.
import json
import os

import httpx

base = os.environ.get("IMGSEARCH_API_BASE", "https://imgsearch.com/api/v2")
headers = {"Authorization": f"Bearer {os.environ['IMGSEARCH_API_KEY']}"}

r = httpx.get(f"{base}/account/savings", headers=headers, timeout=60)
print(r.status_code)
print(json.dumps(r.json(), indent=2))
```

**JavaScript**

```js
// What this account's agents reused this month instead of generating.
// Needs IMGSEARCH_API_KEY.
const base = process.env.IMGSEARCH_API_BASE ?? "https://imgsearch.com/api/v2";

const r = await fetch(`${base}/account/savings`, { headers: { Authorization: `Bearer ${process.env.IMGSEARCH_API_KEY}` } });
console.log(r.status);
console.log(JSON.stringify(await r.json(), null, 2));
```

**Response 200**

```json
{
    "object": "savings",
    "month": "2026-11",
    "starts_at": "2026-11-01T00:00:00Z",
    "ends_at": "2026-12-01T00:00:00Z",
    "recording": false,
    "reuses": 0,
    "estimated_reuses": 0,
    "estimated_usd": null,
    "by_source": {
        "photo": {
            "reuses": 0,
            "estimated_usd": null
        },
        "video": {
            "reuses": 0,
            "estimated_usd": null
        },
        "svg": {
            "reuses": 0,
            "estimated_usd": null
        },
        "svg_pack": {
            "reuses": 0,
            "estimated_usd": null
        },
        "3d_model": {
            "reuses": 0,
            "estimated_usd": null
        },
        "3d_kit": {
            "reuses": 0,
            "estimated_usd": null
        },
        "generation": {
            "reuses": 0,
            "estimated_usd": null
        }
    }
}
```
