# REST API rate limits

The per-store rate limit and how to stay within it.

import { Aside } from '@astrojs/starlight/components';
import DocUpdated from '~/components/DocUpdated.astro';

Requests to Assemblified's REST API are rate-limited **per store**, using the same token bucket as AI / Agent access — REST calls and agent calls draw from one shared budget:

- Bucket capacity: **60** (burst ceiling)
- Refill: **1 token per second** (sustained ~1 request/second)
- Each REST request consumes **1 token**

When the bucket is empty, the API returns `429 RATE_LIMITED` with a `Retry-After` header (seconds) and `retryAfterMs` in the [error body](/features/rest-api/errors/).

## Staying within the limit

- **Don't parallelise against one store.** The data store is single-threaded per store — concurrent requests don't complete faster and burn tokens. Issue calls sequentially.
- **Page efficiently.** Use a large `pageSize` and step through `page` rather than many small pages.
- **Batch inventory writes.** One `PATCH …/inventory` call can update many locations in one request — one token, not one per location.
- **Back off on 429.** Wait the `Retry-After` interval and retry the same request.

<Aside type="note">
Because the bucket is shared with [AI / Agent access](/features/agent-access/overview/), a chatty assistant session and a REST integration running at the same time compete for the same 60-token budget. The per-store limit protects the store's data store; it is independent of any edge-level (per-IP) protection.
</Aside>

<DocUpdated date="2026-11-19" />