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

# Check Credits

> Read the remaining credit balance on your account.

Returns the number of try-on credits left. Each generation [`POST /try-on`](/tryon-api/endpoints/create-try-on) consumes **1 credit** on success. Out-of-credits requests come back as [`402 INSUFFICIENT_CREDITS`](/tryon-api/errors).

Use this endpoint to surface balance in your own dashboards, or to fail fast in a worker before queueing a generation.

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.genlook.app/tryon/v1/account/credits" \
    -H "x-api-key: gk_your_api_key"
  ```

  ```python Python theme={null}
  import requests

  r = requests.get(
    "https://api.genlook.app/tryon/v1/account/credits",
    headers={"x-api-key": API_KEY},
  )
  r.raise_for_status()
  print(r.json()["creditBalance"])
  ```

  ```javascript JavaScript theme={null}
  const { creditBalance } = await fetch(
    "https://api.genlook.app/tryon/v1/account/credits",
    { headers: { "x-api-key": API_KEY } },
  ).then((r) => r.json());
  ```

  ```ts Node SDK theme={null}
  import { Genlook } from "@genlook/api";

  const client = new Genlook({ apiKey: process.env.GENLOOK_API_KEY! });

  const { creditBalance } = await client.account.credits();
  if (creditBalance < 1) throw new Error("Out of credits — top up the dashboard.");
  ```
</RequestExample>

## Response

<ResponseField name="creditBalance" type="integer" required>
  Number of credits remaining on the account.
</ResponseField>

<ResponseExample>
  ```json Success theme={null}
  {
    "creditBalance": 422
  }
  ```
</ResponseExample>

## Top-ups

Top up and view transaction history from the Genlook dashboard. The public API doesn't expose a programmatic top-up endpoint — credit purchases go through the dashboard checkout.

## See also

* [Errors → `INSUFFICIENT_CREDITS`](/tryon-api/errors) — what `/try-on` returns when the balance hits zero.
