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

# Check Organization Credit Balance via Dmand AI API

> GET /api/v1/credits returns the organization's credit balance, total, and used credits for the authenticated API key.

Check your organization's credit balance before submitting large enrichment jobs. This endpoint returns the current balance, total plan credits, and credits already used for the authenticated API key.

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer <your_api_key>`
</ParamField>

<ParamField header="X-API-Key" type="string">
  Optional alternative to the `Authorization: Bearer` header.
</ParamField>

## Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://ext-api.dmand.ai/api/v1/credits" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

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

  response = requests.get(
      "https://ext-api.dmand.ai/api/v1/credits",
      headers={"Authorization": "Bearer YOUR_API_KEY"}
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://ext-api.dmand.ai/api/v1/credits", {
    headers: { "Authorization": "Bearer YOUR_API_KEY" }
  });
  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

## Response

<ResponseField name="balance" type="number" required>
  Credits remaining in the organization's balance.
</ResponseField>

<ResponseField name="total" type="number" required>
  Total credits allocated to the plan.
</ResponseField>

<ResponseField name="used" type="number" required>
  Credits already consumed.
</ResponseField>

### Example response (200 OK)

```json theme={null}
{
  "balance": 850,
  "total": 1000,
  "used": 150
}
```

## Errors

* Missing or invalid API keys are rejected.
* `403`: Revoked or inactive API key.
* `422`: Validation error with `{"detail": [{"loc": [...], "msg": "...", "type": "..."}]}`.
