Skip to main content
GET
Get account balance

Overview

Use this endpoint to inspect the account behind your API key: its identity (email, user ID, name) and a balance summary in US dollars.
Use available_balance to decide whether to issue new requests. It already accounts for amounts reserved by in-flight generation requests (frozen_balance), so no manual subtraction is needed.

Endpoint

  • GET https://api.siray.ai/v1/account/balance
Headers
  • Authorization: Bearer <SIRAY_API_TOKEN>

Response structure

Fields

  • request_uuid: Identifier of this API call, useful for support and log correlation.
  • code / message: Service-level indicators for the request outcome (200 / OK on success).
  • data.user_id: ID of the account that owns the API key.
  • data.user_name: Name of that account.
  • data.email: Email of that account.
  • data.balance: Account balance in USD.
  • data.coupon_balance: Remaining coupon balance in USD (expired coupons excluded).
  • data.available_balance: Balance you can actually spend, in USD: available_balance = balance + coupon_balance − frozen_balance.
  • data.frozen_balance: Total amount currently reserved by in-flight requests, in USD. It is 0 when no amount is frozen.
All amounts are in USD, rounded to two decimal places.

Usage example

frozen_balance is reserved by in-flight generation requests and is released automatically once they settle or expire; available_balance recovers accordingly without any action on your side.

Errors

The endpoint returns the standard response envelope. Non-200 code values indicate failure and come with a message and no data.

Authorizations

Authorization
string
header
required

API token passed as a Bearer token in the Authorization header.

Response

Account identity and balance summary

Account identity and balance summary response.

request_uuid
string
required

Identifier of this API call, useful for support and log correlation.

code
integer
required

Service-level status code (200 on success).

Example:

200

message
string
required

Additional information about the request result.

Example:

"OK"

data
object
required

Account identity and balance summary. All amounts are USD rounded to two decimal places.