# Quotas and plans

Canonical URL: https://developers.iagenify.com/sdk/ref/cloud/quotas/
Language: en

What each plan includes, how the ceilings are counted, and which refusal you get when one is reached. Read it before writing code that creates storages for other people.

Status: 4 plans · per storage, not pooled · read it at runtime

Four plans, three services, and one rule that explains every refusal: **the ceiling belongs to a storage, not to the service**. Everything below follows from that.

## What a plan includes {#table}

| Plan | NoSQL Database | SQL Database | Object Storage |
| --- | --- | --- | --- |
| Free | 50 MB × 1 | 50 MB × 1 | 100 MB × 1 |
| Go | 500 MB × 2 | 500 MB × 2 | 1 GB × 1 |
| Starter | 1 GB × 2 | 1 GB × 2 | 2 GB × 1 |
| Enterprise | 5 GB × 2 | 5 GB × 2 | 10 GB × 1 |

`500 MB × 2` means two storages, each with its own 500 MB. The plan total is a gigabyte; the guarantee is 500 MB twice, and a write is judged against the second number.

## One object storage, and it already exists {#object-one}

> **Asking for a second is a plan limit, not a fault**
>
> Every account is created with its own Object Storage, and that one is the one the plan allows. api.storage.create({ service: "object" }) therefore answers cloud_storage_limit — the storage you were about to make is the one you already have.

## Hosting is counted here too {#hosting}

What a host keeps online is charged to the account's Object Storage: the same bytes against the same ceiling, reported as `usage().object.hostingBytes`. There is no separate hosting allowance to track.

| Plan | Hosts |
| --- | --- |
| Free | none — `host.create()` answers `hosting_not_in_plan` |
| Go | 1 |
| Starter | up to 3 |
| Enterprise | up to 10 |

## Add-ons, and what they do to the ceilings {#addons}

| Add-on | Covers | Credits per GB per period | Held at most |
| --- | --- | --- | --- |
| `database` | NoSQL and SQL, as one pool | 100 | 100 GB |
| `object` | Object Storage | 200 | 100 GB |

A period is 30 days. An add-on raises `quotaBytes`, never `perBaseBytes`: it is drawn on by whichever storage has passed its own ceiling, so it adds room where room is missing instead of moving a guarantee.

## The three refusals, and what each one means {#refusals}

| Code | Status | Means | Way out |
| --- | --- | --- | --- |
| cloud_storage_limit | 403 | The plan's count for that service is used up. | Delete one, or change plan. |
| quota_exceeded | 403 | This write would pass a ceiling. | Free space, or buy an add-on. |
| hosting_not_in_plan | 403 | The plan has no hosting. | Change plan. |

All three are refused **before** anything is written or charged, and all three name the plan in their message — so the text can be shown as it is.

## Read the numbers, do not copy them {#read-at-runtime}

> **A copied table drifts; a read one cannot**
>
> Every figure on this page is in usage(): perBaseBytes, maxBases, quotaBytes, pricePerGb. Code that reads them keeps working when a plan changes, and an interface that shows them is never out of date.

```javascript
const usage = await api.cloud.usage();

// What this plan gives, without a table of your own
for (const service of ["nosql", "sql", "object"]) {
  const s = usage[service];
  console.log(service, `${s.bases}/${s.maxBases} storages`, `${s.perBaseBytes} bytes each`);
}

// What a gigabyte would cost
console.log(usage.addons.pricePerGb);          // { database: 100, object: 200 }
```

## Past a ceiling, reading and deleting still work {#full}

Only writing is refused. A full storage can be listed, read and emptied — which is the only way back under the ceiling that does not involve paying.

- [usage()](/sdk/ref/cloud/usage): The whole report, field by field.
- [addons.buy()](/sdk/ref/cloud/addons-buy): Buying the space, and the proration.
- [create()](/sdk/ref/storage/create): Creating a storage, and its refusals.

```python
usage = api.cloud.usage()

# What this plan gives, without a table of your own
for service in ("nosql", "sql", "object"):
    s = usage[service]
    print(service, f"{s['bases']}/{s['maxBases']} storages", f"{s['perBaseBytes']} bytes each")

# What a gigabyte would cost
print(usage["addons"]["pricePerGb"])   # {"database": 100, "object": 200}
```
