---
title: Size and usage
description: Change an application's size and sleep setting, read its usage and limits, and understand which operations stop at a limit.
slug: /guides/plan-and-usage
order: 30
visibility: public
redirects_from: [/guides/size-and-usage]
---

# Size and usage

Prompt:

> Give this app more memory. How much have we used this month?

Also works:

- "What limits apply to this app?"
- "Why is my app answering 429?"
- "Let production sleep when nobody is using it."

**If your app needs more capacity.** Read its status and find out which resource is limiting it. Use [Choose a size](#1-choose-a-size) for a server that needs more memory or CPU. Use [Choose a dedicated database](/cloud/guides/choose-a-dedicated-database/) if production needs its own PostgreSQL server. A serverless app has [its own limits](/cloud/concepts/serverless-applications-and-servers/#how-functions-run) and keeps its kind.

A server application's [size](/cloud/concepts/glossary/#size) sets its production compute capacity. Your AI assistant calls `tzcloud_read_plan_quotas` to read limits ([step 1](#1-choose-a-size)). It calls `tzcloud_set_app_size` to change the size, production's sleep setting, or whether development uses production's size ([step 2](#2-change-the-size)). Over HTTP, the action names drop the `tzcloud_` prefix.

Read [Balance and usage](https://dev.turnzero.ai/turnzero/guides/balance-and-usage/) for the account's cost, balance, warnings and pause. For an application's quantities and limits, your AI assistant reads `tzcloud_read_usage` ([step 3](#3-read-the-usage)).

Sleeping when idle stops the running copy, not the database or storage service. Database records, files in storage areas, secrets and settings stay. Data held only in memory or written to the copy's own disk is lost ([What survives an idle stop](/cloud/concepts/how-the-plans-differ-technically/#start-after-idle-and-response-time)).

<div id="what-your-ai-tool-does"></div>

## What your AI does

- Reads the `cost-review` [skill](/cloud/concepts/glossary/#skill) (`read_context`, id `skill:cost-review`) and follows it.
- Takes the application's identifier and current `size` from `list_applications`.
- Calls `read_plan_quotas` for limits and `tzcloud_read_usage` for quantities. It reads rates through `read_rate_card` or the [pricing page](https://dev.turnzero.ai/pricing).
- Waits with `read_status` for any returned `applying.version`. After a size change, it restarts each database-backed [running copy](/cloud/concepts/glossary/#running-copy) that the change did not re-create. This refreshes the copy's connection setting.
- Changes a server's size, production sleep or development's size setting only when you ask. For a usage or limits question, it reads and reports.
- Asks which setting you want if your request leaves the choice open, before calling `set_app_size`.

## What you need

- For a new server, choose Shared 0.5 GB or Shared 1 GB. To move an existing production server on an unbilled account, you can also choose Dedicated 4 GB or Dedicated 8 GB. For a shared server's sleep setting, say whether production should sleep when idle. To change development's size setting on a shared server, say whether it should match production.

## Before your AI starts

**For the AI assistant:** Check these prerequisites before changing a server's size or reading its usage.

- A connected, signed-in AI assistant ([Connect your AI assistant](/cloud/getting-started/connect-your-tool/)).
- The application's identifier, which `list_applications` returns.

## Steps

For the prompt above, read usage in step 3. For a server application, ask which size the person wants before changing it in step 2. If the size call returns `applying`, read that version's outcome and the setting in `read_status` before reporting success.

<div id="1-choose-a-plan"></div>

### 1. Choose a size

When you call `create_application` for a server, pass `size` explicitly. Choose `shared-0.5gb` or `shared-1gb`. Use `set_app_size` to change it later. If the task gives no size and there is nobody to ask, pass `shared-0.5gb`. Report the size, that nobody was available, its awake-time charge and the option to request Shared 1 GB for more memory or CPU.

Every account gets [Free Allowance](/cloud/concepts/glossary/#free-allowance), drawn first across its applications and paid options. There is no free hosting plan to select and no monthly hosting plan fee. For a server, Shared 0.5 GB with its default sleep setting can reduce costs.

Small projects may fit within your Free Allowance. The **Static website** and **Small app** examples in the [calculator](https://dev.turnzero.ai/pricing#estimate) fit without the introduction bonus. A server that stays awake all month can exceed the Free Allowance. Other apps and paid options share the same Free Allowance.

A static website has no server, per-request or file storage charge; its data transfer still counts against the account's Free Allowance. Open the [pricing calculator](https://dev.turnzero.ai/pricing?example=static#estimate) for **Static website**. It compares a fixed example's full month with Free Allowance and, while its box is ticked, the introduction bonus. A custom domain, where available, is a separate monthly item.

The account's `account-application-limit` applies until it holds prepaid credit. Unbilled accounts are exempt.

At creation, Shared 0.5 GB uses shared compute and sleeps when idle by default. Shared 1 GB uses its own container and keeps running. For an existing shared server, read `production_sleep` in `read_status` to see whether production sleeps when idle. You can change that setting.

Development always sleeps when idle and is billed separately for time awake. Its default rate is Shared 0.5 GB. If production uses a shared size, the app owner can set development to use that size and pay its rate.

Usage draws the account's balance at the rates on the [pricing page](https://dev.turnzero.ai/pricing) or in `read_rate_card`. A development environment's use is charged too ([Test in development, then promote](/cloud/guides/turn-on-development-and-promote/)).

Every application can [attach a custom domain](/cloud/guides/attach-your-own-domain/) and [send email](/cloud/guides/send-email-from-your-application/). A custom domain is a monthly item. Each email recipient is charged, including an emailed sign-in code. Read `email-recipients-per-hour` and `email-recipients-per-day` for the send limits.

A shared database has one monthly rate for both environments. The daily billing run counts it while the application holds a shared database, even while its servers sleep. The first `database-shared` day charge can follow manifest submission if it creates the development database before the app's first hosted deploy. The `custom-domain` charge starts with the first run after the domain has served.

The daily billing run charges one day’s share for each UTC day it finds the item held. A day’s share is the monthly rate divided by the number of days in that UTC month. Removing an item stops new charges from the next run. Charges already made stay on the account. For an unbilled account, the run records the charge without drawing from the balance. Charges for a paused account are written off.

The daily billing run records measured use, such as shared server awake time, for the previous UTC day. It records monthly items held at the time of the run for the UTC day the run takes place. Turning on `logs-extended` or `tztrack-ai-passes` can post that day's share at once, and the run counts the same item and day only once. A storage line can be missing if the run could not take a fresh reading.

Read limits with `read_plan_quotas`; [Size limits](#size-limits) explains the rows. An application has no monthly AI allowance. The platform's AI calls draw the account's balance at the provider's published price plus the pricing page's markup. Calls on your own stored key have no markup and deduct nothing from that balance.

<div id="2-change-the-plan"></div>

### 2. Change the size

For a server application, pass `application` to `set_app_size` with one or more of `size`, `production_sleep` and `development_at_size`. For shared compute, use `shared-0.5gb` or `shared-1gb` as `size`. For dedicated compute, see [Dedicated sizes](#dedicated-sizes). The other two settings are booleans. Development always sleeps when idle. A serverless application has neither a size nor a sleep setting. This call is refused with `serverless_unsupported` for that kind.

```json
{ "application": "<application id>", "size": "shared-1gb" }
```

Where `changed` names a member, the call recorded that value and `application` holds it. A repeat naming values already in effect writes nothing.

When production uses a shared size, the owner can pass `development_at_size: true` on its own. Development uses that size's CPU and memory limits and pays its rate for awake time. Use `false` to restore the default limits and the Shared 0.5 GB rate.

On Shared 0.5 GB, matching leaves the awake-time rate and a development container’s limits unchanged. A development pod’s CPU limit falls from 1 vCPU to 0.25 vCPU on Shared 0.5 GB or 0.5 vCPU on Shared 1 GB. Its memory limit is 0.5 GiB on Shared 0.5 GB or 1 GiB on Shared 1 GB. Development continues sleeping when idle and keeps its existing placement type.

If development is deployed, a change can re-create its running copy. If development is off or has yet to be deployed, the first deployment uses the recorded setting. Read `application.development_at_size` in `read_status` to check the setting.

To move to another size while matching is on, turn matching off first and wait for the change. Move the size in a separate call and wait for it to take effect. If production serves at a shared size after the move, you can turn matching on again.

When `applying` is present, it names one redeploy. If both a sleep change and a `development_at_size` change start redeploys, `applying` names production's version only. Call `read_status` with `wait_seconds` until `settled` is `true`, then check each environment's outcome and the recorded settings. A setting whose redeploy is pending keeps its previous recorded value until the replacement takes traffic. Other settings may already be recorded and appear in `changed`. A failed redeploy keeps the earlier value for the setting it was applying.

A deploy, promote, rollback or restart in flight on production refuses any `set_app_size` call with `deploy_in_flight`, even for values already standing. A version in flight on development also refuses a change to `development_at_size`. The call records nothing. Wait for that version to end in its environment, then repeat the call.

<div id="what-a-move-does-to-the-running-application"></div>

#### How production takes the change

For a server application, Shared 0.5 GB runs on shared compute. Shared 1 GB runs in its own container ([How the sizes differ technically](/cloud/concepts/how-the-plans-differ-technically/)). Read the call's answer to learn how production takes a size or sleep-setting change.

When the call reports that production is being re-created, the replacement has one cold start. The new copy takes traffic after its health check. The old copy serves until then, so no request waits for that cold start.

If a change would re-create halted production, the call returns `target_environment_halted`. Resume production with `halt_environment` and `resume: true`, then repeat the call. Read the [refusal reference](/cloud/reference/refusals/) if a capacity or provider refusal prevents a change.

During a re-creation, `applying.size` names a requested size where one moves; `applying.production_sleep` names a requested sleep setting where one moves. Read the members returned by the call.

`application` keeps reporting the previous values until the new compute takes traffic. If re-creation fails, production keeps serving its earlier compute and the previous values remain recorded. Read the failure through `read_status`; the same call is the retry.

The shared sizes run at most one copy. Compare CPU and memory in [How the sizes differ technically](/cloud/concepts/how-the-plans-differ-technically/), and quantity rows with `read_plan_quotas`.

Read `database-connection-limit` for the limit per process. After a size change, a running database environment that was not re-created reads its connection setting only at its next restart, deploy or promote.

Restart that environment after the size change to refresh its connection setting. A production copy re-created by the change reads the setting at startup. The size act's answer does not list environments needing a restart.

If a server's size changed without re-creating production, `restart_application` takes the form below. Name `development` instead for a running development copy with a database.

```json
{ "application": "<application id>", "environment": "production" }
```

[The connection limit](/cloud/guides/add-a-database/#the-connection-limit) explains the pool setting and when a running process reads it.

A size change made in place recomputes the usage states before the call answers. Where production is re-created, the states follow at the next router report or daily check. Read usage again to see the recorded state; the size call carries no recomputation `detail`.

Email and custom domains remain available at shared and dedicated sizes.

On a server application's page, use **Change size** to choose a size or change production's sleep setting. The control reads the sizes from `read_plan_quotas` ([Use the signed-in site](https://dev.turnzero.ai/turnzero/guides/your-account#3-use-the-signed-in-site)).

#### Dedicated sizes

Dedicated 4 GB and Dedicated 8 GB reserve CPU and memory for production on a machine shared with other customers' dedicated servers. Dedicated 4 GB reserves 1 CPU and 4 GiB of memory. Dedicated 8 GB reserves 2 CPUs and 8 GiB of memory. Dedicated sizes are open to unbilled accounts now. Billed accounts can choose them when they go on sale.

Production stays awake on a dedicated size. It can restart if its machine is reimaged during the weekly maintenance window. Development stays on shared compute and always sleeps when idle.

A move to a dedicated size, a change between dedicated sizes, or a move back to shared starts a new production copy. The production address and any custom domain stay the same. The old copy keeps serving until the new copy passes its health check and takes traffic.

A move or a later deployment on a dedicated size can wait for a machine. While `deploy.step` is `waiting_for_node`, tell the owner Turn Zero is starting a server and use `deploy.step_started_at` to report how long the wait has lasted. If the new copy still has no machine after 15 minutes, it fails with `node_unavailable`. Production keeps its previous settings and any version already serving.

In one development test, a move that needed a new machine took about 1 minute 52 seconds. The next move had room on an existing machine and took about 13 seconds. The move back to shared also took about 13 seconds.

To move back, choose a shared size with `set_app_size` and wait for the move to finish. On the new shared size you can change the sleep setting or turn development matching back on. See [Choose a dedicated server](/cloud/guides/choose-a-dedicated-server/) for the full steps.

### 3. Read the usage

For quantities and limits, call `tzcloud_read_usage`.

`tzcloud_read_usage` takes an optional `application` identifier. Without it, the call returns usage for every live application of the account. A token bound to one application must name that application.

```json
{ "application": "<application id>" }
```

Each application in the response has seven measures:

| Measure | What it counts |
| --- | --- |
| `backend_actions` | Requests the router forwards to your backend, [scheduled runs](/cloud/concepts/glossary/#scheduled-run-and-due-instant) included, plus the messages clients send on WebSocket connections, end-user sign-ins, and session verifications, one each |
| `data_transfer_bytes` | Bytes sent to clients, downloaded from the storage areas, and sent by the backend through the gateway or the tunnel, this month. A download that ends early because the caller closed the connection counts the bytes sent. A download that the platform itself cuts short does not count. |
| `stored_data_bytes` | The live database and the stored files, a deploy's zips among them, as one pool. The daily check reads it, so what is stored after the check counts at the next one. |
| `ai_allowance_usd_micros` | The application's [AI spend](/cloud/concepts/glossary/#ai-calls) this month, in micro-dollars. The key keeps its name; the application has no included AI allowance. |
| `push_messages` | Push deliveries the push service accepted this UTC month, one per device a send accepted, against the size's `push-messages-capacity` quantity |
| `email_recipients` | Recipients the email service's accepted sends addressed this UTC month, `to` and `cc` together. The month's `quota` is null. Its `hour` and `day` members count against `email-recipients-per-hour` and `email-recipients-per-day`, each with its own `resets_at`. |
| `function_calls` | Serverless function calls recorded this UTC month. The response gives a router cutoff and an environment split. Its `quota` is null and its state is `unset`. |

Every environment counts toward the application's one size. On an application with one environment, `tzcloud_read_usage` also shows what [local runs](/cloud/concepts/glossary/#local-run) drew, in a `local_runs` line that Expected result describes. The [`tzcloud_read_usage` reference](/cloud/reference/actions/read-usage/) describes every member of the response.

An application's own [issue-tracking space](/cloud/concepts/glossary/#issue-tracking-space) counts toward neither the account's space limit nor its open-issue limit. tzTrack AI reviews remains a paid option for each space, an application's own space included ([Space limits and tzTrack AI reviews](https://dev.turnzero.ai/tztrack/concepts/free-and-paid-tiers/)).

#### Compare usage with the quota

Compare a measure's `month_total` with its `quota` where a quantity is set. A null `quota` means no limit is set for that measure. It does not mean zero. `includes_before` gives the source timestamps for the total, and `freshness` explains what recent activity may still be missing.

The two traffic totals include the month's router counts. If the most recent daily check falls within the response's `period`, the totals also include the activity it recorded. The check adds sign-ins and session verifications to backend actions, and outbound request bytes and storage downloads to data transfer. Stored data is the size from its last check, even if that check was in an earlier month.

For a quantity question, compare stored data with `stored-data-capacity` and accepted push deliveries with `push-messages-capacity`. Stored data is a ceiling against abuse, not an allowance.

The traffic measures have null `quota` and state `ok`. AI spend and the email month have null `quota` and state `unset`. They never read `over`. Read cost and balance through `read_balance`.

Report shorter periods separately. These are `egress_limits.bytes_today` against `bytes_per_day`, `deploys-per-day` over the last 24 hours, `signin-code-sends-per-hour`, and email's `hour` and `day` windows. They do not describe use for the UTC month.

#### Check which activity is counted

Each measure's `includes_before` is null when its `month_total` is null. Otherwise, it contains only the sources included in that figure; no source key has a null value:

| Measure | Members of `includes_before` |
| --- | --- |
| `backend_actions`, `data_transfer_bytes` | `router`, two minutes before the read or the application's `created_at`, whichever is later. Also `daily_check`, the application's `checked_at`, only when that check falls in the response's `period` |
| `stored_data_bytes` | `daily_check` whenever a check has run, even in an earlier month |
| `function_calls` | `router` for the function call count |
| `ai_allowance_usd_micros`, `push_messages`, `email_recipients` | `read`, the time of this read, when a count was read |

Before the first check, or after a check in an earlier month, the two traffic measures have `router` alone. Stored data before its first check has `includes_before: null`. A read-at-call measure also has `includes_before: null` if no count was read.

`created_at` is the creation time returned by `create_application` and `list_applications`; deploying or changing size does not move it.

For traffic, `includes_before.router` is the lower timestamp. Requests there or earlier are counted unless a report was lost. `excludes_after.router` is when the router's latest report was added to the month's count. Between those times, a request may or may not be counted. A null upper timestamp does not establish whether recent traffic was counted.

If `backend_actions.month_total` is zero just after a request, compare the request’s end time with `includes_before.router` for that measure. If the timestamp has yet to reach the request, read usage again after it catches up. You can pass `wait_seconds` from 1 to 45 to delay the usage read and get a later cutoff. The reply's `waited_ms` says how long it waited. A second waiting read for the same account, or a read when the process has no room for another wait, can return immediately. The wait does not start a daily usage check. Read `read_balance` for charges and remaining credit.

In `read_status`, `server_errors.counted_through` stays two minutes before the read ([Read logs and counters](/cloud/guides/read-logs-and-counters/#the-failing-paths-in-the-status)).

Sign-ins and session verifications enter `backend_actions` at the daily check; outbound request bytes and storage downloads enter `data_transfer_bytes` at that check. Activity in these daily-check terms after `checked_at` waits for the next check.

Stored data is the amount stored at the latest daily check: the sum of each environment's newest database size sample and file bytes in the application's bound storage areas. It does not reset with the month. Its `daily_check` timestamp marks that check. The database size samples it used may be older.

The response's `freshness` sentence explains what may be missing. Router counts normally take about two minutes to arrive. The next daily check adds sign-ins, verifications, outbound request bytes, storage downloads and stored data.

#### How the measures are counted

On `backend_actions`, units count one per request the [serving router](/cloud/concepts/glossary/#serving-router) forwards to your backend, a scheduled run among them, and one per data message a client sends on a WebSocket. Each end-user sign-in and each session verification the accounts service performs also counts one. A request the router verifies itself counts once. The router's count reaches `month_total` and `by_environment` up to a minute after a request is answered. A WebSocket message takes up to two minutes, because the router meters it once a minute first. Sign-ins and verifications reach the measure at the daily check.

On a WebSocket connection, the upgrade counts one unit, and each data message the client sends counts one more; [Limits and metering](/cloud/guides/use-websockets/#limits-and-metering) says what else a connection counts and gives its own limits.

The router sends its counts once a minute, so a read soon after a request may not count it yet, and the request can show in the router's per-minute log records first. A count the router cannot send, on a failed send or a router stopped abruptly, is never added. [When records arrive, and in what order](/cloud/concepts/how-log-records-arrive/#when-records-arrive-and-in-what-order) says when the log records arrive.

On the two traffic measures and `function_calls`, `by_environment` splits the router's count between `development` and `production`, and is null until the router names environments.

Stored data's `month_total` is the amount stored at the latest daily check, as the `daily_check` timestamp describes above. Before the first check it is null: the size has not yet been sampled. A deploy or upload since `checked_at` shows at the next check.

For AI spend, push and email, `month_total` is this month's micro-dollars, accepted deliveries or recipients, read at the call. The push state is computed at each read.

When accepted push deliveries first pass the `warning_fraction` of `push-messages-capacity`, the send writes a `usage warning` event into each environment's log stream. Email has no month quantity for a size, so it fires no month warning.

#### Other usage limits

Beside its measures, each application has `egress-connections-per-minute` and `egress-bytes-per-day` limits. [Outbound limits](/cloud/concepts/egress-firewall-and-request-limits/#outbound-limits) explains what counts and what happens at a limit.

Other limits include `deploys-per-day` and retained-log quantities for each environment. Read the application's `size` from `list_applications`, then pass that value as `plan` to `read_plan_quotas` for the size's current limits. For schedules, read `schedule-count-limit` and `schedule-minimum-interval`. Use each row's returned `unit` when interpreting its quantity.

`egress_limits.state` reads `ok`, `capped` or `unset` for the daily byte limit. `bytes_today` counts both environments and both outbound routes. Its `resets_at` is the next UTC day's start. Check `connections_per_minute` separately for the per-minute connection limit.

The amount of log data you can store is a byte limit. How long it stays is a separate setting. The byte limit applies separately to your entries and the runtime harness's entries, or the function pool's entries for a serverless application. At the limit, new entries are refused and the platform writes its own warning into the stream ([Read logs and counters](/cloud/guides/read-logs-and-counters/#9-stay-under-the-retained-bytes-limit)).

Call `set_log_retention` with `days: 30` to turn extended retention on, or `days: 7` to turn it off. Turning on extended retention charges that UTC day’s share unless the same application already incurred that charge that day. The daily billing run charges each later day it finds the option on. Turning it off stops new charges from the next run. Charges already made stay on the account. The call can be refused `balance_short` (402) or `rates_unread` (503).

Read its rate on the [pricing page](https://dev.turnzero.ai/pricing). Turning it off makes the next retention run delete entries older than the standard period; turning it on again does not restore them.

### 4. Read a measure's state

The response's `warning_fraction` is the warning point for a measure with a quantity, read from `low-capacity-warning`. It is separate from the account's balance warnings. Stored data and push can have these states:

- `ok`, below the warning point;
- `warning`, at the warning point or above, but below the quota;
- `over`, at or above the quota;
- `unknown`, where no state is recorded and the figure is missing or has reached the warning point.

The traffic measures have state `ok` and no quantity. AI spend and the email month have state `unset` and no quantity. A size includes email, so its email measure never reads `not_on_plan`.

Stored data changes at a check, at a size change made in place, or when platform staff change `stored-data-capacity`. Push is read when usage is read.

Until a check succeeds, `checked_at` and stored data's `month_total` are null, and the stored-data state is `unknown`. After each successful deploy, the platform attempts a usage check if no successful check is recorded. The platform waits up to two minutes for that attempt, including time waiting behind another check. A check already started can finish later. The daily check also runs once a day.

Read `tzcloud_read_usage` again about two minutes after `tzcloud_read_status` answers `settled: true` with `state` set to `deployed` ([Read the status](/cloud/getting-started/deploy-an-application/#5-read-the-status)). If `checked_at` is still null, no successful check is recorded yet; report stored data as unknown. The next daily check runs within a day. Reading usage starts no check.

For stored data or push with no recorded state, a missing figure or one at the warning point or above reads `unknown`. A figure below the warning point reads `ok`.

Until the first check succeeds, the application's entry includes `note`: the daily check has not run yet, or it failed at the time given. A first-deploy attempt does not change this note while it waits or runs, or if it fails or never starts. The note cannot distinguish those outcomes.

The response's `detail` also explains the missing check. The two traffic measures still answer `month_total`, with `includes_before.router` and no `daily_check`. The application's own `state` reads `unknown` until a state is recorded, which is not a fault.

A measure's `quota` shows the size's current quantity, or null where it holds none. The comparison uses the whole `month_total`; the quantity is not prorated. A change to a quota recomputes the affected measure.

A size change made in place recomputes states before it answers. Where production is re-created, the states follow at the next router report or daily check. Read usage again for the recorded state. `set_app_size` carries no `detail` about recomputation.

No response member dates an individual measure's state. `checked_at` dates the daily check, and `includes_before` describes which activity the total includes, as [step 3](#check-which-activity-is-counted) explains. `state_since` dates the first check or the latest change to the application's overall state. None identifies which quota an individual state was measured against.

### 5. What an `over` state stops

An `over` measure stops its own operations. Reads and size changes continue. Stored data and push are the only measures that can read `over` for a customer application.

- **Stored data over.** The platform refuses file puts on the application's storage areas, a new deploy's upload, and `tzcloud_deploy_files` calls carrying file contents or a stored entry with 429 `usage_over_quota`. It also refuses requests to save a new Image Gen picture in storage bound to that application. You can still save pictures in your account. File gets, lists and deletes continue. Store less; the next daily check reads the reduced size.
- **Push quantity reached.** A send that would pass `push-messages-capacity` is refused 429 `usage_over_quota` whole ([Send push notifications](/cloud/guides/send-push-notifications/)). This stops the application's sends alone and does not change its overall `state`. Wait until the next UTC month; `resets_at` names its first instant.
- **Email hour or day limit reached.** A send that would pass `email-recipients-per-hour` or `email-recipients-per-day` is refused 429 `email_limit_reached` whole. The refusal names the period and its end in `resets_at`. Wait for that reset. For more sends, use your own provider on a declared egress upstream.

A measure's `refuses` is `file_puts` for stored data over and `push_sends` for push over. It is null for a measure that is not `over`. Stored data has null `resets_at`: it has no monthly reset. A deploy's answer includes a `usage_notice` while stored data is over.

Stored data changes at a daily check, a size change made in place, or a staff change to `stored-data-capacity`. A monthly count starts again at the first instant of the next UTC month. Email's hour and day counts reset at their next UTC boundary.

<div id="what-a-plan-includes"></div>

### Size limits

Call `read_plan_quotas` for the sizes' quantities. Read rates through `read_rate_card` or the [pricing page](https://dev.turnzero.ai/pricing); the quota response has no `prices` or `subscriptions` list.

Filter by `plan`, `measure`, or both. The `plan` argument takes a size ID. Use `shared-0.5gb`, `shared-1gb`, `dedicated-4gb` or `dedicated-8gb`. Use a quantity name such as `schedule-count-limit` for the measure. To read a dedicated size's rows, name it explicitly. Without `plan`, the response lists the two shared sizes.

Each row gives its quantity and unit. An unset quantity reads null. With `stamps: true`, a row also carries its `set_at` and `set_by`. Any signed-in credential can read the rows, a token bound to one application included.

The response's `application_limit_exemption` names an exemption where one applies. Unbilled accounts are exempt from `account-application-limit`; that limit is not a quota row.

Every application can have a development environment; `create_environment` turns it on. Development always sleeps after the `free-idle-stop` period without a request. Production does so only when its sleep setting is on. [Start after idle and response time](/cloud/concepts/how-the-plans-differ-technically/#start-after-idle-and-response-time) explains the next request's wait.

### Current application limits

| Limit | Entry or read |
| --- | --- |
| Live applications | `account-application-limit`; this is not a quota row |
| Stored data | `stored-data-capacity`, shared by database records and files across environments, including deploy zips |
| Idle stop | `free-idle-stop`, where sleeping is on |
| Production CPU and memory | `production-replica-size`; see [How the sizes differ technically](/cloud/concepts/how-the-plans-differ-technically/) |
| Push messages | `push-messages-capacity`, accepted deliveries this UTC month |
| Database connections | `database-connection-limit`, per process |
| Schedules | `schedule-count-limit` |
| Shortest schedule interval | `schedule-minimum-interval` |
| Deploys | `deploys-per-day` |
| Log retention | `log-retention-days`; this is not a quota row. The log option is set with `set_log_retention` |
| Retained log size | `log-retained-capacity`, replaced by the extended option's limit where that option is on; separate limits for your entries and the runtime harness's entries, or the function pool's entries for a serverless application |
| Open WebSocket connections | `websocket-connections-per-replica`, per environment on each serving router replica |
| Outbound connections | `egress-connections-per-minute`, per application on each tunnel proxy replica |
| Outbound data | `egress-bytes-per-day`, per application |
| Emailed sign-in codes | `signin-code-sends-per-hour` |
| Email recipients | `email-recipients-per-hour` and `email-recipients-per-day` |
| Custom domains | See [Attach your own domain](/cloud/guides/attach-your-own-domain/) |

Read current quantities with `read_plan_quotas`, and rates through `read_rate_card` or the [pricing page](https://dev.turnzero.ai/pricing). The `limits` list in `tzcloud_read_usage` covers selected quantities, including deploys and retained log bytes. A row can have `count: null` when the service holds no count for it or the count read failed. A rolling window, such as the last 24 hours of deploys, has `resets_at: null`. Use `read_plan_quotas` for quantities outside the list.

## Expected result

`set_app_size` answers with the application ID, its settings, `changed`, and `compute`. It carries no `warm_floor`, `connection_limit`, `detail` or `next`. If the call returns `applying`, wait for the version to finish through `read_status`. Read the current size, `production_sleep` and `development_at_size` there.

`compute` names each environment checked for a setting change. Its outcomes are `unchanged`, `no_compute`, `floor_written` and `redeploy_started`. It is empty when a size moves.

The answer lists no environments needing a connection-setting refresh. After a size change, restart running database environments that the change did not re-create, as [step 2](#2-change-the-size) says.

`tzcloud_read_usage` returns the `period` as `YYYY-MM`, a `freshness` sentence, the `warning_fraction`, and an `applications` array. Each measure's `includes_before` gives its source timestamps, as [step 3](#3-read-the-usage) explains.

Each entry contains the application's `id`, `label`, `size`, `checked_at`, overall `state`, and `state_since`, the time of the first check or latest change to the overall state.

It contains the seven measures, each with `month_total`, `quota`, `includes_before`, `state`, `resets_at` and `refuses`. The two traffic measures and `function_calls` have `by_environment`. The traffic measures can also return `excludes_after.router`. Email has `hour` and `day` windows. `egress_limits` and `limits` give the other limits ([`tzcloud_read_usage` reference](/cloud/reference/actions/read-usage/)).

On an application with one environment, an entry also has `local_runs` when local runs stored or used anything in development this month. These figures show the development share of the usage above and count toward the application's usage charges.

The `tzcloud_read_usage` response also includes `page`, the address of this page, and a short `detail`. Compare `month_total` with a non-null `quota`; `refuses` names the operation an `over` measure stops. `resets_at` gives its end where one is set.

Reads and size changes continue while a measure is over. The separate `freshness` member explains how soon activity reaches the figures. Stored data has no monthly reset; [step 5](#5-what-an-over-state-stops) explains when each restriction ends.

`tzcloud_read_plan_quotas` returns the named size's rows in `quotas`, or the shared sizes' rows when you omit `plan`. That argument takes a size name. Each row gives the measure, quantity and unit; requested stamps add its writer and time.

The response has no `prices` or `subscriptions`. [Size limits](#size-limits) explains the separate account limit and the exemption member.

## Refusals

See the [refusals reference](/cloud/reference/refusals/) for other platform errors.

If `set_app_size` returns `entitlement_apply_failed`, the previous settings remain recorded. The same call is the retry. Report a repeated failure with its reference and detail.

| Refusal | Status | Cause | Remedy |
| --- | --- | --- | --- |
| `account_application_limit` | 409 | `create_application` found the account's counted application limit reached; nothing was created. | Read `list_applications` and report the account's limit. |
| `account_paused` | 409 | An operation would start or restart a version while the account's balance is used up. | Try again when the pause ends. You can still run `check_deploy`. |
| `balance_short` | 402 | The remaining Free Allowance plus available credit is at or below the option’s charge for the remaining UTC days of the month, including today. | The option stays off; report the refused charge. |
| `rates_unread` | 503 | A new option charge needs rate rows or a switch instant that could not be read. Nothing was charged. | Try again shortly. |
| `invalid_request` | 400 | A setting is invalid or missing, an app with no server size requests `development_at_size`, or `read_plan_quotas` named an unknown size or measure. | For a quota read, pass `shared-0.5gb`, `shared-1gb`, `dedicated-4gb`, or `dedicated-8gb` for the size, or use a measure from an unfiltered quota read. For an application setting, pass a boolean for an app that supports it. |
| `size_not_open` | 403 | The account is billed and the dedicated size is unavailable to it. | Use a shared size. |
| `dedicated_capacity` | 503 | The cell has no room for the requested dedicated size. | Try again later or use a shared size. |
| `no_such_application` | 404 | A call named no application of the acting account, or one deleted during the call. | Use the identifier `list_applications` returns. |
| `application_other_account` | 403 | `application` names an application that another account holds, not the account the call is signed in as. The `detail` names the account the call acted as and nothing of the other one. | Compare `turnzero whoami --origin https://dev.turnzero.ai` with `read_account` over your AI assistant's connection. Make the call from the one signed in to the account that holds the application. |
| `serverless_unsupported` | 403 | The application is serverless and has no size or sleep setting. | To read usage, call `tzcloud_read_usage`. Use `set_app_size` for a server application. |
| `plan_quantity_unset` | 409 | A required quantity for the target size is unset. | Read its row with `read_plan_quotas` and wait for platform staff to set it. |
| `plan_schedule_conflict` | 409 | The declared schedules do not fit the target size's limits. | Resubmit the manifest within the limits, then repeat the size call. |
| `deploy_in_flight` | 409 | Production has a deploy, promote, rollback or restart in flight. Development has a version in flight when the call changes its size setting. Nothing was recorded. | Use `read_status` with `wait_seconds` in the environment named by the refusal. Wait for that version to end, then repeat `set_app_size`. |
| `development_at_size_set` | 409 | A size change requires matching off both before and during the call. Nothing was recorded. | Turn `development_at_size` off and wait. Change the size in a separate call. Matching can be turned on again after a move to a shared size. |
| `target_environment_halted` | 409 | The change would re-create halted production. | Call `halt_environment` with `environment: "production"` and `resume: true`, then repeat `set_app_size`. |
| `group_full` | 409 | The shared-compute group needed by the target size is full. | Repeat `set_app_size` later; platform staff must add capacity. |
| `cell_unavailable` | 503 | Placement found no room for production's own container. | Repeat `set_app_size` later. If it persists, report the detail. |
| `entitlement_apply_failed` | 502 | A compute or connection-limit write failed and the previous settings remain recorded. | Repeat the same `set_app_size` call. Report a repeated failure with its reference and detail. |
| `deletion_in_progress` | 409 | The application, or one of its environments, is being deleted. | Wait for the deletion to finish; `read_approval_status` returns its outcome. |
| `token_scope_refused` | 403 | A token bound to one application left out `application` or named another application. | Name the token's application, or use your signed-in session or an account-wide token. |
| `app_credential_not_admitted` | 403 | The call used an application's platform credential on a management action that does not admit it. The credential can call `read_account`. Storage, logging, egress, push, email, and end-user verification admit the credential on their runtime routes. | Use your signed-in session or a minted token. |
| `fresh_authentication_required` | 403 | A size change from the dashboard came after the browser sign-in's freshness window. | Follow **Sign in again to change size**, then repeat the change. |
| `usage_over_quota` | 429 | Stored data or accepted push deliveries reached the application's limit. | Store less, then let the daily check read it; for push, wait for the next UTC month. [The refusal reference](/cloud/reference/refusals/) gives the operation's remedy. |

## Related

- [Your account](https://dev.turnzero.ai/turnzero/guides/your-account) shows the account itself, its [standing](/cloud/concepts/glossary/#standing), and the signed-in site.
- [Choose a dedicated server](/cloud/guides/choose-a-dedicated-server/) explains what to expect during a move to dedicated or back to shared.
- [Deploy from your computer](/cloud/getting-started/deploy-an-application/) covers the size at `create_application`.
- [Add a database](/cloud/guides/add-a-database/#the-connection-limit) covers the connection limit each process receives.
- [Stay inside the Free Allowance](/cloud/guides/stay-inside-the-monthly-free-usage/) estimates whether a database app fits the account's remaining amount.
- [Read logs and counters](/cloud/guides/read-logs-and-counters/) covers the retained-log quantity and `purge_logs`.
- [AI Generation](/cloud/backend-packages/ai-generation/) describes the published package's calls.
- [Egress firewall and request limits](/cloud/concepts/egress-firewall-and-request-limits/#outbound-limits) covers the outbound limits.
- [Send email from your application](/cloud/guides/send-email-from-your-application/) covers email sends and the counts that bound them.
- The [action reference](/cloud/reference/action-catalog/) gives each action's arguments, result and refusals, including `set_app_size`, `tzcloud_read_usage` and `read_plan_quotas`.
