# API Credits

Return the current credit balance and expiration date for the API key.

**Cost:** free (does not consume credits).

Use for monitoring, dashboards, pre-flight checks, and recovering from 402 (insufficient credits) or 403 (expired credits) on paid endpoints.

---

## Endpoint

**GET** `/available-credit`

Base URL: `https://api.withoutbg.com`

## Authentication

Provide your API key in the request header:

```
X-API-Key: <your_api_key>
```

## Response

**Success Content-Type:** `application/json`

### Body fields

- `credit` *(integer, required)* — Credits available to spend right now.
- `expiration_date` *(string, required)* — When credits expire, as `YYYY-MM-DD HH:MM:SS`.

## Errors

| Status | Description |
|--------|-------------|
| 401 | Invalid API Key |
| 429 | {"error":"Too Many Requests","status":429,"message":"Rate limit exceeded. Please try again later"} |
| 500 | Internal Server Error. Please contact support: contact@withoutbg.com |

## Example (cURL)

```bash
curl -sS \
  -H "X-API-Key: $WITHOUTBG_API_KEY" \
  "https://api.withoutbg.com/available-credit"
```

---

Source of truth: [OpenAPI](https://api.withoutbg.com/openapi.json) · Docs: [/docs/pro-model/credits](/docs/pro-model/credits)
