> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqwish.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Limits

> What each tier allows, how to reach a higher tier and what a request gets when it goes over a limit.

Your organisation's tier sets most of its limits. A new organisation starts at tier 0, and buying credit
moves it up. Every key and browser session of the organisation shares its limits.

## Tiers

These are the standard tiers, and the credit you buy to reach each:

| Tier (credit bought) | Requests a minute | Input tokens a minute | Operations at once |
| - | - | - | - |
| 0 (\$0) | 30 | 100,000 | 1 |
| 1 (\$10) | 120 | 1,000,000 | 4 |
| 2 (\$100) | 240 | 2,000,000 | 8 |
| 3 (\$1,000) | 480 | 4,000,000 | 16 |
| 4 (\$10,000) | 3,000 | 8,000,000 | 32 |

Each tier also sets how many of your fine-tuned models can answer calls and stay warm at once, and the largest dataset form you can upload:

| Tier | Your models answering | Your models kept warm | Dataset form |
| - | - | - | - |
| 0 | 1 | 0 | 16 MiB |
| 1 | 3 | 0 | 32 MiB |
| 2 | 5 | 1 | 32 MiB |
| 3 | 10 | 3 | 64 MiB |
| 4 | 20 | 5 | 64 MiB |

[Score many texts](https://docs.sqwish.ai/guides/scale.md#know-your-limits) shows what these limits mean for a long run.

## Move up a tier

Your tier comes from all the credit your organisation has bought, before tax. Spending credit, or letting
it expire, never lowers it. Starter and promotional credit don't count towards it, and a refund or a
dispute takes its amount off the total. Each organisation's tier comes from its own purchases.

1. Buy credit in **Billing** in the [console](https://console.sqwish.ai) ([buy credit](https://docs.sqwish.ai/guides/billing.md#buy-credit)).
2. The new tier applies once the payment is verified, from your next request.

`next_tier` on `GET /v1/account` says how much more credit reaches the next tier
([tier and limits](https://docs.sqwish.ai/guides/billing.md#tier-and-limits)). To evaluate OneHot at a higher tier before you buy,
for a one-off large run, or for limits above the top tier, write to [help@sqwish.ai](mailto:help@sqwish.ai).

## Account limits

Read your tier and its limits on `GET /v1/account`:

```python Python theme={null}
from sqwishai import OneHot

with OneHot() as client:
    account = client.account.get()

print(account["tier"], account["effective_limits"])
```

```typescript TypeScript theme={null}
import { OneHot } from "sqwishai";

const client = new OneHot();
const account = await client.account.get();

console.log(account.tier, account.effective_limits);
```

```bash cURL theme={null}
curl --fail-with-body https://api.sqwish.ai/v1/account \
  -H "Authorization: Bearer $SQWISH_API_KEY"
```

`tier` is the tier your organisation is on, and `effective_limits` holds its limits. An inference key
can't read this route ([Access levels](https://docs.sqwish.ai/guides/api-keys.md#access-levels)).

| Field in `effective_limits` | Limit |
| - | - |
| `rpm`, `tpm` | Requests and input tokens a minute. An image counts the tokens the model reads for it, in `usage.image_tokens`. These are the same tokens it bills |
| `concurrency` | Operations running at once |
| `read_rpm` | Reads a minute, including replays of existing operations |
| `write_rpm` | Writes a minute, other than decisions and their estimates |
| `estimate_tokens_per_minute` | Tokens a minute for estimates |
| `stored_objects`, `stored_mib` | Datasets, labelling sources, fine-tunes and labelling jobs the account keeps, and the space they take ([Places and storage](#places-and-storage)) |
| `upload_bytes` | Bytes in one dataset form, its JSONL files together. Higher tiers take more ([Request size](#request-size)) |
| `answering` | Models that answer calls at once ([Switch a family or a model on](https://docs.sqwish.ai/guides/manage-families.md#switch-a-family-or-a-model-on)) |
| `kept_warm` | Models kept warm at once ([Keep a model warm](https://docs.sqwish.ai/guides/keep-warm.md)) |
| `fine_tunes` | Fine-tunes queued, running or cancelling at once ([Fine-tune a model](https://docs.sqwish.ai/guides/fine-tuning.md)) |

The [tiers](#tiers) tables give the limits that grow with your tier. The others are the same at every tier. The console's Account page explains them all.

These are the standard values of the limits that are the same at every tier:

| Limit | Value | Field in `effective_limits` |
| - | - | - |
| Reads a minute | 120 | `read_rpm` |
| Writes a minute, other than decisions and their estimates | 60 | `write_rpm` |
| Input tokens a minute in estimates | 1,000,000 | `estimate_tokens_per_minute` |
| Datasets, labelling sources, labelling jobs and fine-tunes you keep | 200 | `stored_objects` |
| The space they take, in MiB | 2,048 | `stored_mib` |
| Fine-tunes queued, running or cancelling at once | 4 | `fine_tunes` |

## Rate limits

`/v1/account` reports your tier's limits on requests and input tokens a minute, and on operations running at once. An image counts the tokens the model reads for it. Reads and estimate tokens have separate budgets.

Authenticated reads use the read budget. So do replay attempts of existing operations, pending or conflicting ones included. Per-address limits also apply across dynamic routes, before expensive processing.

* Over a limit, a request gets `429` with `Retry-After`. Its message names the limit and when it resets. It names the limit as `effective_limits` does: `rpm`, `tpm` or `concurrency`.
* A request with more input tokens than your account allows in a minute gets `422 too_many_tokens`. No wait would admit it.
* When the rate limiter's storage is unavailable, a request gets `503`.

Revoking a key, or turning automatic top-ups off in the console, never waits for these budgets.

## Input tokens

Every model, fine-tunes included, takes up to 65,536 input tokens a request. Tokens are counted as they are billed, in `usage.input_tokens`, images included. `/v1/models` gives this limit as each model's `max_input_tokens`.

A longer request is refused with `422 context_too_long` before any model reads it. Nothing is charged.

Rarely, a shorter request gets the same error too. Split it.

## Request size

| Body | Limit |
| - | - |
| JSON body | Up to 1 MiB. A decision with images can be up to 48 MiB: only its images may take it past 1 MiB ([images](https://docs.sqwish.ai/guides/images.md#limits)) |
| Dataset JSONL files, in a multipart form | Up to your tier's `upload_bytes` |
| Labelling source | Up to 16 MiB and 2,000 rows |

A body over its limit gets `413`. Send less. A dataset form over `upload_bytes` gets `413 request_too_large`, and its message names the tier that takes it. You can also buy credit to reach that tier.

A compressed body must fit these limits both as sent and decompressed ([Compression](https://docs.sqwish.ai/guides/requests.md#compression)).

## Rows and decisions

| What | Limit |
| - | - |
| Rows in a dataset, across its versions | 1 to 100,000 |
| Training rows in the dataset of a fine-tune that trains every row: a family's first, or one with no model yet | 100 to 100,000 |
| Training rows for a prompt tune, asking its decision | 50 to 1,000 |
| Decisions in a native request | 1 to 128 in the schema. The model you choose may allow fewer. Each model's `max_questions` in `/v1/models` is the most it allows |
| Decisions in the playground | At most 8 |

The row ranges are the `limits` in `/v1/onehot`. Each `*_rows` value is the most, and each `*_min_rows` value is the fewest.

## Places and storage

`places` says how much of `answering` and `kept_warm` the account uses. Each model counts once, however many switches make it answer or keep it warm.

`storage` says how many datasets, labelling sources, fine-tunes and labelling jobs the account keeps, and the bytes they take. Archived ones count, and deleted ones don't. A new one past either allowance is refused with `409 storage_allowance`.

A fine-tune stops counting once you delete its model, or once a rollback discards that model ([Delete a model](https://docs.sqwish.ai/guides/manage-families.md#delete-a-model)).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.