API REFERENCE
Get Account Credits
On this page
/api/accounts/{id}/creditsRetrieve the current credit balance for an account. Returns the remaining credits along with the plan-derived monthly total and used count, plus a flag indicating whether the account is on a pro plan (directly or via an organization). Credits refill monthly; the timestamp field reflects the last refill or balance update.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request GET \
--url 'https://api.recoupable.dev/api/accounts/YOUR_ID/credits' \
--header 'x-api-key: YOUR_API_KEY'Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.
Parameters
Path parameters
idstringrequiredThe unique identifier (UUID) of the account. Must be the authenticated account or another accessible via organization membership.
Responses
200Credit balance retrieved successfully+
application/json
account_idstringrequiredThe unique identifier of the account this balance belongs to.
format: uuid
remaining_creditsintegerrequiredCredits still available in the current monthly period. Refills automatically once the period elapses.
minimum: 0
total_creditsintegerrequiredTotal credits granted per monthly period for the account's current plan. Free accounts and pro accounts receive different allotments.
minimum: 0
used_creditsintegerrequiredCredits consumed in the current monthly period. Equal to total_credits - remaining_credits.
minimum: 0
is_probooleanrequiredTrue when the account is on a pro plan, directly via an account subscription or via an organization subscription.
timestampstringrequirednullableISO 8601 timestamp of the last balance update or monthly refill. Null when the account has never spent or refilled credits.
format: date-time
401Unauthorized - invalid or missing authentication+
application/json
errorstringrequiredHuman-readable error message.
{
"error": "Unauthorized"
}403Forbidden - account not accessible to the authenticated account+
application/json
errorstringrequiredHuman-readable error message.
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download accounts.jsonView operation source
{
"description": "Retrieve the current credit balance for an account. Returns the remaining credits along with the plan-derived monthly total and used count, plus a flag indicating whether the account is on a pro plan (directly or via an organization). Credits refill monthly; the `timestamp` field reflects the last refill or balance update.",
"parameters": [
{
"name": "id",
"in": "path",
"description": "The unique identifier (UUID) of the account. Must be the authenticated account or another accessible via organization membership.",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Credit balance retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AccountCreditsResponse"
}
}
}
},
"401": {
"description": "Unauthorized - invalid or missing authentication",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AccountCreditsErrorResponse"
},
"example": {
"error": "Unauthorized"
}
}
}
},
"403": {
"description": "Forbidden - account not accessible to the authenticated account",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AccountCreditsErrorResponse"
}
}
}
}
}
}