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

# credits

> Print the authenticated workspace's remaining credit balance as JSON.

Get the remaining credit balance for the workspace pinned to your API key. Use it to check how many credits are left before running credit-consuming work such as searches or routine runs.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
clay credits
```

## Output

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "balance": 4200,
  "actionExecutionBalance": 1500
}
```

| Field                    | Type                | Description                                                                    |
| ------------------------ | ------------------- | ------------------------------------------------------------------------------ |
| `balance`                | number              | Remaining credits in the workspace.                                            |
| `actionExecutionBalance` | number \| undefined | Remaining action-execution credits, when the workspace tracks them separately. |

## Errors

| Code             | Exit | Notes                                                                                   |
| ---------------- | ---- | --------------------------------------------------------------------------------------- |
| `auth_forbidden` | 3    | The key lacks the `cli:all` scope (or `all`), or you lack read access to the workspace. |

## Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
clay credits
clay credits | jq -r '.balance'
[ "$(clay credits | jq '.balance < 100')" = true ] && echo "running low on credits"
```
