Skip to main content
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.
clay credits

Output

{
  "balance": 4200,
  "actionExecutionBalance": 1500
}
FieldTypeDescription
balancenumberRemaining credits in the workspace.
actionExecutionBalancenumber | undefinedRemaining action-execution credits, when the workspace tracks them separately.

Errors

CodeExitNotes
auth_forbidden3The key lacks the cli:all scope (or all), or you lack read access to the workspace.

Examples

clay credits
clay credits | jq -r '.balance'
[ "$(clay credits | jq '.balance < 100')" = true ] && echo "running low on credits"