API Reference

Get Credit Balance

Return the credit balance for an organization, or for one product when websiteId is set: period credits, organization bank, committed and spendable amounts, per-product balances, and the current cost table. Cache policy: live. Idempotency: none. Auth modes: api_key, mcp_oauth, session_bearer.

POST
/agent/v1/credits/balance

Return the credit balance for an organization, or for one product when websiteId is set: period credits, organization bank, committed and spendable amounts, per-product balances, and the current cost table. Cache policy: live. Idempotency: none. Auth modes: api_key, mcp_oauth, session_bearer.

Authorization

AuthorizationBearer <token>

Rankhog organization API key sent as Authorization: Bearer rhog_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/agent/v1/credits/balance" \  -H "Content-Type: application/json" \  -d '{    "organizationId": "org_2x9rnkhdemo",    "websiteId": "site_2x9rnkhdemo"  }'
{  "available": 212,  "bank": {    "available": 130,    "balance": 130  },  "committed": 4,  "costs": {    "comment": 1,    "draft_regeneration": 1,    "post": 2,    "reply": 1,    "upvote": 0,    "warmup": 50  },  "lowBalanceThreshold": 20,  "monthlyAllotmentPerProduct": 100,  "organizationId": "org_2x9rnkhdemo",  "period": {    "allotment": 100,    "available": 82,    "periodEnd": "2026-07-01T00:00:00.000Z",    "periodStart": "2026-06-01T00:00:00.000Z",    "remaining": 82,    "source": "stripe_subscription"  },  "products": [    {      "available": 212,      "committed": 4,      "displayName": "Example SaaS",      "period": {        "allotment": 100,        "available": 82,        "periodEnd": "2026-07-01T00:00:00.000Z",        "periodStart": "2026-06-01T00:00:00.000Z",        "remaining": 82,        "source": "stripe_subscription"      },      "spendable": 208,      "websiteId": "site_2x9rnkhdemo"    }  ],  "spendable": 208,  "websiteId": "site_2x9rnkhdemo"}
{  "error": {    "code": "agentic_invalid_input",    "details": {      "issues": [        {          "code": "invalid_type",          "message": "Expected string, received undefined.",          "path": [            "organizationId"          ]        }      ]    },    "message": "Request body did not match the agentic capability schema."  }}

{  "error": {    "code": "agentic_unauthorized",    "message": "Authenticate before using Rankhog agentic capabilities."  }}

{  "error": {    "code": "agentic_missing_scope",    "details": {      "missingScopes": [        "rankhog:read"      ]    },    "message": "Missing required OAuth scope: rankhog:read."  }}

{  "error": {    "code": "agentic_website_not_found",    "message": "Website workspace not found."  }}
{  "error": {    "code": "agentic_internal_error",    "message": "Rankhog could not complete this agentic request."  }}