api.cloud

usage()

api.cloud.usage() → Promise<Usage>

Everything the account holds in IaGenify Cloud, in one object: the plan, the three services, each storage with its own ceiling, and the add-ons.

GET /api/cloud/usagefreecomputed on read
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

Nothing here is cached: the sizes are the ones recorded for each storage, and the ceilings are recomputed from the plan and the add-ons at the moment you ask. Two calls either side of a large write give two different answers.

Returns

{
  pack: "go",                              // "free" | "go" | "starter"

  nosql: {
    usedBytes: 8_720_384,
    includedBytes: 1_048_576_000,          // ceiling × how many the plan allows
    quotaBytes: 1_048_576_000,             // included + the add-on pool
    perBaseBytes: 524_288_000,             // the ceiling of ONE storage
    bases: 2,
    maxBases: 2,
    overQuota: false,
    available: true,
    storages: [
      { id: "…", label: "App data",  usedBytes: 8_716_288, quotaBytes: 524_288_000, overQuota: false },
      { id: "…", label: "Reporting", usedBytes: 4_096,     quotaBytes: 524_288_000, overQuota: false }
    ]
  },

  sql:    { /* same shape */ },
  object: { /* same shape */ , hostingBytes: 2_310_144 },

  addons: {
    databaseGb: 0,
    objectGb: 1,
    renewsAt: "2026-11-02T10:14:00.000Z",
    lapsed: false,
    monthlyCredits: 200,
    pricePerGb: { database: 100, object: 200 }
  }
}
{
    "pack": "go",                              # "free" | "go" | "starter"

    "nosql": {
        "usedBytes": 8_720_384,
        "includedBytes": 1_048_576_000,        # ceiling × how many the plan allows
        "quotaBytes": 1_048_576_000,           # included + the add-on pool
        "perBaseBytes": 524_288_000,           # the ceiling of ONE storage
        "bases": 2,
        "maxBases": 2,
        "overQuota": False,
        "available": True,
        "storages": [
            {"id": "…", "label": "App data",  "usedBytes": 8_716_288, "quotaBytes": 524_288_000, "overQuota": False},
            {"id": "…", "label": "Reporting", "usedBytes": 4_096,     "quotaBytes": 524_288_000, "overQuota": False},
        ],
    },

    "sql": {},                                 # same shape as nosql
    "object": {"hostingBytes": 2_310_144},     # same shape as nosql, plus hostingBytes

    "addons": {
        "databaseGb": 0,
        "objectGb": 1,
        "renewsAt": "2026-11-02T10:14:00.000Z",
        "lapsed": False,
        "monthlyCredits": 200,
        "pricePerGb": {"database": 100, "object": 200},
    },
}

A service block, field by field

usedBytesinteger

Everything that service holds. On object it includes hostingBytes.

includedBytesinteger

perBaseBytes × maxBases — what the plan gives before any add-on.

quotaBytesinteger

includedBytes plus the add-on pool available to this service.

perBaseBytesinteger

The ceiling of a single storage. The figure a write is judged against.

basesinteger

How many storages of this service exist.

maxBasesinteger

How many the plan allows. Equal to bases means another one is refused.

overQuotaboolean

True when the total passes quotaBytes or any one storage passes its own ceiling.

availableboolean

Whether the service can be used right now.

storagesarray

One entry per storage: id, label, usedBytes, quotaBytes, overQuota.

Which number to show, and which to act on

quotaBytes is the account; storages[].quotaBytes is the place you write

A progress bar on the service total can sit at 40% while an insert is refused, because one storage is full. Show the per-storage figure wherever the user is about to write, and keep the total for a summary.

function roomFor(usage, storage) {
  const service = usage[storage.service];                       // "nosql" | "sql" | "object"
  const base = service.storages.find((s) => s.id === storage.id);
  return base ? Math.max(0, base.quotaBytes - base.usedBytes) : null;
}
def room_for(usage, storage):
    service = usage[storage.service]                    # "nosql" | "sql" | "object"
    base = next((s for s in service["storages"] if s["id"] == storage.id), None)
    return max(0, base["quotaBytes"] - base["usedBytes"]) if base else None

overQuota has two causes

It is true when the service total passes what the account has, and when a single storage passes its own ceiling — the second being the case a total can never reveal. Reading the per-storage flag tells you which.

hostingBytes, on object only

What the account's hosts keep online. It is taken out of the object ceiling before the per-storage figure is computed, so a deploy visibly reduces the room left for files — one number for everything IaGenify keeps for the account.

The add-on block

databaseGb · objectGbinteger

Gigabytes currently held, per add-on.

renewsAtstring|null

When the period ends. A purchase before then is prorated.

lapsedboolean

The renewal could not be paid: the pool is suspended and the ceilings are back to the plan's.

monthlyCreditsinteger

What the add-ons cost per period, all together.

pricePerGbobject

{ database: 100, object: 200 } — credits per gigabyte per period.

lapsed is worth showing

A suspended add-on takes the ceilings back down, so a storage that was comfortable becomes full without anything being written. The pool is retried, and it comes back as soon as the credits are there.

Two things worth doing with it

// 1. Before creating a storage — is one allowed at all?
const usage = await api.cloud.usage();
if (usage.nosql.bases >= usage.nosql.maxBases) {
  // api.storage.create() would answer cloud_storage_limit
}

// 2. Before a large write — will it fit?
const bytes = Buffer.byteLength(payload);
const left = usage.object.storages[0].quotaBytes - usage.object.storages[0].usedBytes;
if (bytes > left) {
  // Free something, or api.cloud.addons.buy({ service: "object", gb: 1 })
}
# 1. Before creating a storage — is one allowed at all?
usage = api.cloud.usage()
if usage["nosql"]["bases"] >= usage["nosql"]["maxBases"]:
    pass  # api.storage.create() would answer cloud_storage_limit

# 2. Before a large write — will it fit?
size = len(payload)
first = usage["object"]["storages"][0]
if size > first["quotaBytes"] - first["usedBytes"]:
    pass  # Free something, or api.cloud.addons.buy(service="object", gb=1)