Skip to main content
GET
Este endpoint requiere autenticacion. Inclui tu API key en el header Authorization: Bearer <API_KEY>. Ver Autenticacion para mas detalles.
Returns the current credit balance of the authenticated organization and whether it can run agent messages right now. Use this endpoint to:
  • Show the remaining credits in your own app
  • Warn the user before the balance runs out (you choose the threshold)
  • Block an action before running it when the organization can no longer run agent messages
canRun and blockReason are computed with the same rules the platform applies before running an agent message, so a canRun: false here means the next message would be rejected. This endpoint is meant to be called from a backend. It does not allow cross-origin browser requests: do not expose your API key in a browser.
canRun: true only means the organization has some balance left. A message is allowed while any balance remains, even a fraction of a credit, and in that case only the remaining balance is charged. It does not guarantee there are enough credits for an expensive action: leave a margin in your own threshold. The balance is also a snapshot: other usage can happen between this call and your action.

Response

string
How the organization is billed. Valid values: credits, legacy.
  • credits: the organization has at least one active credit bucket (plan or purchased credits).
  • legacy: older billing model limited by number of queries. credits is null in this case.
object | null
Credit amounts summed across all active buckets. null when billingModel is legacy. Amounts are rounded to 6 decimals.
boolean
false when the next agent message would be rejected because of the balance or billing status.
string | null
Why the organization cannot run agent messages. null when canRun is true. Valid values, in the order they are checked:

Error Responses