> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.
# Guardrail
## Example Usage
```typescript theme={null}
import { Guardrail } from "@openrouter/sdk/models";
let value: Guardrail = {
createdAt: "2025-08-24T10:30:00Z",
id: "550e8400-e29b-41d4-a716-446655440000",
includeByokInBudgets: false,
name: "Production Guardrail",
workspaceId: "0df9e665-d932-5740-b2c7-b52af166bc11",
};
```
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------- | ------------------------------------------------------------------------------ | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `allowedDataRegions` | [models.GuardrailDataRegion](../models/guardraildataregion.mdx)\[] | :heavy\_minus\_sign: | Data regions through which requests governed by this guardrail must arrive. `global` is [https://openrouter.ai](https://openrouter.ai), `europe` is [https://eu.openrouter.ai](https://eu.openrouter.ai), and `us` is [https://us.openrouter.ai](https://us.openrouter.ai). Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. | \[
"europe"
] |
| `allowedModels` | *string*\[] | :heavy\_minus\_sign: | Array of model canonical\_slugs (immutable identifiers) | \[
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] |
| `allowedProviders` | *string*\[] | :heavy\_minus\_sign: | List of allowed provider IDs | \[
"openai",
"anthropic",
"google"
] |
| `contentFilterBuiltins` | [models.ContentFilterBuiltinEntry](../models/contentfilterbuiltinentry.mdx)\[] | :heavy\_minus\_sign: | Builtin content filters applied to requests. Includes PII detectors and the regex-based prompt injection detector. | \[
\{
"action": "redact",
"label": "\[EMAIL]",
"slug": "email"
}
] |
| `contentFilters` | [models.ContentFilterEntry](../models/contentfilterentry.mdx)\[] | :heavy\_minus\_sign: | Custom regex content filters applied to request messages | \[
\{
"action": "redact",
"label": "\[API\_KEY]",
"pattern": "\b(sk-\[a-zA-Z0-9]\{48})\b"
}
] |
| `createdAt` | *string* | :heavy\_check\_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z |
| `description` | *string* | :heavy\_minus\_sign: | Description of the guardrail | Guardrail for production environment |
| `enableFreeModelPublication` | *boolean* | :heavy\_minus\_sign: | Whether this guardrail allows free endpoints that publish prompts. | false |
| `enableFreeModelTraining` | *boolean* | :heavy\_minus\_sign: | Whether this guardrail allows free endpoints that train on request data. | true |
| `enablePaidModelTraining` | *boolean* | :heavy\_minus\_sign: | Whether this guardrail allows paid endpoints that train on request data. | true |
| ~~`enforceZdr`~~ | *boolean* | :heavy\_minus\_sign: | : warning: \*\* DEPRECATED \*\*: This will be removed in a future release, please migrate away from it as soon as possible.
Deprecated. Use enforce\_zdr\_anthropic, enforce\_zdr\_openai, enforce\_zdr\_google, enforce\_zdr\_xai, and enforce\_zdr\_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false |
| `enforceZdrAnthropic` | *boolean* | :heavy\_minus\_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce\_zdr when not provided. | false |
| `enforceZdrGoogle` | *boolean* | :heavy\_minus\_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce\_zdr when not provided. | false |
| `enforceZdrOpenai` | *boolean* | :heavy\_minus\_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce\_zdr when not provided. | false |
| `enforceZdrOther` | *boolean* | :heavy\_minus\_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce\_zdr when not provided. | false |
| `enforceZdrXai` | *boolean* | :heavy\_minus\_sign: | Whether to enforce zero data retention for xAI models. Falls back to enforce\_zdr when not provided. | false |
| `id` | *string* | :heavy\_check\_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 |
| `ignoredModels` | *string*\[] | :heavy\_minus\_sign: | Array of model canonical\_slugs to exclude from routing | \[
"openai/gpt-4o-mini-2024-07-18"
] |
| `ignoredProviders` | *string*\[] | :heavy\_minus\_sign: | List of provider IDs to exclude from routing | \[
"azure"
] |
| `includeByokInBudgets` | *boolean* | :heavy\_check\_mark: | Whether BYOK (bring-your-own-key) inference spend counts toward this guardrail's limit\_usd, in addition to OpenRouter credit spend. | false |
| `limitUsd` | *number* | :heavy\_minus\_sign: | Spending limit in USD | 100 |
| `name` | *string* | :heavy\_check\_mark: | Name of the guardrail | Production Guardrail |
| `resetInterval` | [models.GuardrailInterval](../models/guardrailinterval.mdx) | :heavy\_minus\_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly |
| `updatedAt` | *string* | :heavy\_minus\_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z |
| `workspaceId` | *string* | :heavy\_check\_mark: | The workspace this guardrail belongs to, or `null` for an unscoped legacy guardrail predating workspaces. Workspace membership organizes the guardrail; it does not apply the guardrail to the workspace's traffic. A `null` value does not mean the default workspace, and does not apply the guardrail across every workspace. | 0df9e665-d932-5740-b2c7-b52af166bc11 |