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

# Guardrails

> Control which models your team can call, how much each member can spend and how fast they call: create a guardrail, then attach it to roles, members or keys.

**Guardrails**

Control which models your team can call, how much each member can spend and how fast they call: create a guardrail, then attach it to roles, members or keys.

A **guardrail** is a reusable usage policy. It sets:

* **Model access**: which providers, LLMs and [Expert Models](https://www.edenai.co/docs/v3/expert-models/listing-models.md) can be called.
* **Member budget**: how much each member can spend per day, week or month.
* **Rate limit**: how many requests each member can make per second, minute, hour or day.

Create a guardrail once, then attach it to a **role**, a **member** or an **API key**, or make it the **organisation default** for everyone else.

> [!NOTE]
>
> Guardrails are part of the advanced organisation features. See [plans and pricing](https://www.edenai.co/pricing) for availability.

## Create a guardrail

**1. Open Guardrails**

In the [Eden AI dashboard](https://app.edenai.run/), go to **Settings**, select **Guardrails**, then click **Create Guardrail**.

**2. Basics**

Give the guardrail a **Name** and, optionally, a **Description**. Under **Assignment**, pick the roles, members and API keys it applies to. You can also assign it later from **Members** or **Roles**.

**3. Budget & rate limit**

Set a [member budget](#member-budget) and a [rate limit](#rate-limit), or leave them empty for no limit.

**4. Model access**

Choose which providers and models can be called. See [Model access](#model-access).

**5. Save**

Click **Create guardrail**. You can change any part of it later from the guardrail's page.

## Model access

![The Model access section: the Only allow mode, a Providers card, a Models card and the Current eligibility preview](https://mintcdn.com/edenai/89Ko2ad2-h9YLYkV/images/guardrails/model-access-light.png?fit=max\&auto=format\&n=89Ko2ad2-h9YLYkV\&q=85\&s=18846749fb5d075f32eb38a0892bd258)

Pick a **restriction mode**, then list providers and models:

| Mode | What it does |
| - | - |
| **Allow all except…** | Everything is allowed except what you list. New providers and models are allowed automatically. |
| **Only allow…** | Only what you list is allowed. New providers and models are blocked automatically. |
| **Custom rules** | Shown for a guardrail whose rules were set outside the editor (see [Custom rules](#custom-rules)). Picking another mode replaces them when you save. |

* **Providers**: a provider covers everything it serves, its LLMs and its Expert Models. Block OpenAI here and no OpenAI model can be called.
* **Models**: click **Add models**, then switch between **LLMs** and **Expert models**.
  * **LLMs** lists the models behind every OpenAI-compatible endpoint: chat, embeddings, images, speech, transcriptions and moderations. Use the **Region** filter to allow a model in one region only, for example the EU.
  * **Expert models** are grouped by task. Tick a provider to cover all its models for that task, or tick single models.

![The Add models picker on Expert models, grouped by task](https://mintcdn.com/edenai/89Ko2ad2-h9YLYkV/images/guardrails/model-picker-light.png?fit=max\&auto=format\&n=89Ko2ad2-h9YLYkV\&q=85\&s=62dab5d4e0fa1b44edd54b0692c19de5)

**Current eligibility**, under the lists, shows what the guardrail allows today, by provider and by model, before you save.

### What a request is checked against

* **LLM** choices apply to LLM calls: chat completions, Responses, Messages, and the OpenAI-compatible `/v3/embeddings`, `/v3/images`, `/v3/audio` and `/v3/moderations` endpoints.
* **Expert model** choices apply to Expert Model calls on `/v3/universal-ai`, and to the `web_search` hook on LLM calls, which searches through a `web/search` provider such as Linkup. A call that names no model is checked as the provider's default model.
* A request the guardrail doesn't allow gets HTTP 403. The error names the refused model's id, such as `openai/gpt-5.5` or `audio/tts/google/chirp3-hd`.

### Custom rules

A guardrail can also hold ordered rules that mix allow and block. The editor shows them under **Custom rules** and keeps them as they are. Each rule is a pattern on the model id: the first rule that matches decides, and the default applies when none does.

| Pattern | Matches |
| - | - |
| `anthropic/*` | Every model from that provider, LLMs and Expert Models |
| `openai/gpt-5.5` | One LLM, or an alias of it |
| `openai/gpt-5.5@eu` | That LLM, in the EU only |
| `audio/tts/google` | Every Google model for one Expert Model task, here text to speech |
| `audio/tts/google/chirp3-hd` | One Expert Model |

A `*` also matches `/`: `*/gpt-4o` matches `openai/gpt-4o` and any Expert Model id ending in `/gpt-4o`.

## Member budget

![The Budget and rate limit section: a monthly member budget with an alert at 80% and a rate limit of 60 requests per minute](https://mintcdn.com/edenai/89Ko2ad2-h9YLYkV/images/guardrails/budget-light.png?fit=max\&auto=format\&n=89Ko2ad2-h9YLYkV\&q=85\&s=e17555fa5b1e939462da7c47a53487b2)

Under **Budget & rate limit**, set an **Amount** in USD and a period: daily, weekly or monthly. Turn on **Budget alert** and set **Alert at (%)** (1 to 100) to email the member, with a copy to the organization owner, when their spend reaches that share of the budget. It is sent at most once per period.

* **Per member, not shared.** Each member the guardrail applies to gets their own budget, across all their API keys. It is not a shared pool for the team.
* **Resets each period.** Spend resets at the start of each day, week or month (UTC).
* **Soft cap.** The check happens before each request, so a request already running can take spend past the cap. The next request is the one that gets refused.
* **Real usage only.** [Sandbox](https://www.edenai.co/docs/v3/general/sandbox.md) calls and calls made with your own provider keys ([BYOK](https://www.edenai.co/docs/v3/general/byok.md)) don't count. Refunds credit it back.

> [!NOTE]
>
> The budget applies only when the guardrail is attached to a **role** or a **member**, or is the **organisation default**. On a guardrail attached to an **API key** it is ignored: use a [token budget](https://www.edenai.co/docs/v3/general/custom-api-keys.md) to cap a single key.

## Rate limit

Set the number of **Requests** and a window: second, minute, hour or day. Requests over the limit are refused until the window passes. The limit applies to each member and replaces your plan's rate limit, which it can't exceed. Leave it empty to inherit the limit from the next level up.

## Assigning a guardrail

A guardrail does nothing until it is attached. Attach it under **Assignment** on the guardrail's page, or:

* **A role**: from **Settings → Roles & Permissions**, so everyone with that role inherits the policy.
* **A member**: from **Settings → Members**, to apply it to one person.
* **An API key**: to constrain a single key, for example a shared or CI key.
* **The organisation default**: from the **Default guardrail** card in **Settings → Guardrails**. It applies to members with no guardrail of their own or from their role. Without a default, they have no limits: every model, your plan's rate limit, no budget.

Each role, member and API key holds one guardrail. When a request comes in, Eden AI resolves each limit on its own, the most specific level first:

```
API key  →  member  →  role  →  organisation default
```

Model access and the rate limit each come from the most specific level that sets them, so a key can override the model access and still inherit its role's rate limit. The member budget skips the API key level: it comes from the member, the role or the organisation default, amount and period together, never mixed across levels.

> [!NOTE]
>
> Guardrails can be configured from the dashboard or programmatically through the [Management API](https://www.edenai.co/docs/v3/organization/management-api.md) (`/v3/manage/guardrails`), including assigning them to a key, a member, a role or as the organisation default.

## Pausing a guardrail

In **Settings → Guardrails**, each guardrail has an on/off switch. Turn it off to pause the guardrail: it stays assigned, but requests skip it and take each limit from the next level instead (`API key → member → role → organisation default`), and it sends no budget alerts. A paused organisation default applies to nobody. Turn it back on to apply it again.

## Related

* [Users & Organisation](https://www.edenai.co/docs/v3/organization/users-organisation.md): roles, permissions, and members.
* [Custom API Keys](https://www.edenai.co/docs/v3/general/custom-api-keys.md): per-key budgets, which cap a single key rather than a member.


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