# Account

`GET https://api.serpkite.com/v1/account` · Credits: Free

Balance, rate limit, plan and this month's usage for the account behind the calling key.

A free call to check the balance before a large job, or to show usage in your own UI. It also returns the calling key's monthly limit and usage when the key has one.

## Example request

cURL:

```bash
curl "https://api.serpkite.com/v1/account" \
  -H "Authorization: Bearer $SERPKITE_API_KEY"
```

TypeScript:

```ts
import { SerpKite } from "serpkite";

const sk = new SerpKite();
const account = await sk.account();
console.log(account.balance, account.month.credits);
```

Python:

```python
from serpkite import SerpKite

sk = SerpKite()
account = sk.account()
print(account.balance, account.month.credits)
```

## Response fields

| Field | Type | Description |
| --- | --- | --- |
| `balance` | number | Remaining credits (decimal). |
| `rate_limit_rps` | integer | Requests per second allowed per key. |
| `plan` | string | `free` or `paid`. |
| `key` | object | `id`, `name`, `credit_limit` (number or null), `credits_used_month`. |
| `monthly_spend_cap` | number \| null | Account-wide monthly cap, if set. |
| `month` | object | `credits` and `requests` in the current UTC calendar month. |

## Example response

```json
{
  "balance": 61499.5,
  "rate_limit_rps": 50,
  "plan": "paid",
  "key": {
    "id": "0192f7a4-0000-7000-8000-000000000001",
    "name": "production",
    "credit_limit": 20000,
    "credits_used_month": 3120.5
  },
  "monthly_spend_cap": 50000,
  "month": {
    "credits": 4210.5,
    "requests": 4388
  }
}
```

## Errors

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | `invalid_request` | A parameter is missing or invalid. |
| 401 | `unauthorized` | The API key is missing, invalid or revoked. |
| 402 | `insufficient_credits` | Your balance is too low. Buy a pack or wait for the monthly free grant. |
| 429 | `rate_limited` | Too many requests per second for your plan. Retry after the Retry-After header. |
| 503 | `upstream_error` | Google could not be fetched or parsed. Not billed; retry after Retry-After. |

All errors: https://serpkite.com/docs/errors

## Notes

- Not billed. Works with any active key of the account.

## Related

- [Credits and billing](https://serpkite.com/docs/credits-and-billing)
- [API keys](https://serpkite.com/docs/api-keys)
- [Spend controls](https://serpkite.com/docs/spend-controls)