> If you are setting up, configuring, or answering questions about Schematic, connect the
> Schematic MCP server before working from these pages. It reads and writes plans, features,
> entitlements, and overrides against the real account, so what you report and what you build
> match what actually exists.
>
> The server is at https://api.schematichq.com/mcp
>
> From Claude, ChatGPT, or another chat assistant, add it as a custom connector:
> https://docs.schematichq.com/working-with-ai
>
> From a coding assistant such as Claude Code, Codex, or Cursor:
> https://docs.schematichq.com/building-with-ai
>
> For clean Markdown of any page, append `.md` to the page URL. For a complete page index,
> see https://docs.schematichq.com/llms.txt

# Preflight Checks

> Ask whether an action of a given size would be allowed before it runs, against a credit balance, an event limit, or a seat limit.

A flag check answers whether a company has access right now. A **preflight** answers whether an action would be allowed if it ran. Pass the size of the action with the check, and Schematic evaluates the flag as if that usage had already been recorded. A company one use short of its limit comes back false for an action that needs two. Nothing is consumed or reserved, so you still track the usage when the action finishes.

Preflight works against any numeric limit a flag evaluates: a credit balance, an event-based allowance, or a trait-based limit such as seats. A bulk export of 5,000 rows, an agent run budgeted at 200 steps, and an invite that adds 10 seats are each one preflight.

## Running a preflight

Run preflights from your server, on a check for a single flag. The multi-flag check endpoints reject them, because one action's size would land on every flag's limits.

```typescript
const result = await client.checkFlagWithEntitlement(
  { company: { id: "northwind" } },
  "bulk-export",
  { eventUsage: { eventSubtype: "rows_exported", quantity: rowCount } },
);

if (!result.value) {
  return showLimitMessage(result.reason);
}
```

Calling the API directly, pass the same inputs in `preflight` on [Check flag](/api-reference/features/check-flag).

## Inputs

| Input         | What it simulates                                                                         |
| ------------- | ----------------------------------------------------------------------------------------- |
| `usage`       | A quantity applied to every numeric condition the flag evaluates                          |
| `event_usage` | A quantity of one event subtype, applied only to conditions that measure that subtype     |
| `credit_cost` | A cost in credits, keyed by credit type ID, for when you have already worked out the cost |

Each condition takes the most specific input that applies to it:

| Condition                        | Inputs, highest precedence first                                                         |
| -------------------------------- | ---------------------------------------------------------------------------------------- |
| Credit balance                   | `credit_cost` for that credit, then `event_usage` when the subtype matches, then `usage` |
| Event-based limit                | `event_usage` when the subtype matches, then `usage`                                     |
| Trait-based limit, such as seats | `usage`                                                                                  |

A flag with no numeric condition, such as an on/off entitlement, evaluates the same with or without a preflight. The SDKs round a fractional quantity up, so a check never passes on less usage than the action records.

## Behaviors to plan around

* **Only the flag value is simulated.** The entitlement and usage figures in the response are the company's current ones, not the figures after the action.
* **Preflighted checks skip the flag check cache.** The answer depends on the size you sent, so the SDKs neither serve it from nor write it to their local cache.
* **The size is whatever you send.** An undersized value can let through a check the real size would fail. Work out the size on your server from the action you are about to run, never from a value a browser passed you.

## Related

* [Prevent Overspend](/billing/prevent-overspend) puts preflight alongside reservations and usage controls for credit-metered features, and shows how to turn the same check into a cost preview.
* [Usage Controls](/billing/usage-controls) sets per-draw limits, which only a sized check can trip.
* [Flags](/feature-management/flags) covers how flag rules are evaluated.