> ## 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.
# CreateGuardrailRequest
## Example Usage
```typescript theme={null}
import { CreateGuardrailRequest } from "@openrouter/sdk/models";
let value: CreateGuardrailRequest = {
name: "My New Guardrail",
};
```
## 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. An empty array is rejected. | \[
"europe"
] |
| `allowedModels` | *string*\[] | :heavy\_minus\_sign: | Array of model identifiers (slug or canonical\_slug accepted) | \[
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] |
| `allowedProviders` | *string*\[] | :heavy\_minus\_sign: | List of allowed provider IDs | \[
"openai",
"anthropic",
"deepseek"
] |
| `contentFilterBuiltins` | [models.ContentFilterBuiltinEntryInput](../models/contentfilterbuiltinentryinput.mdx)\[] | :heavy\_minus\_sign: | Builtin content filters to apply. Every builtin slug supports "block", "redact", and the detect-only "flag" action. | \[
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] |
| `contentFilters` | [models.ContentFilterEntry](../models/contentfilterentry.mdx)\[] | :heavy\_minus\_sign: | Custom regex content filters to apply to request messages | \[
\{
"action": "redact",
"label": "\[API\_KEY]",
"pattern": "\b(sk-\[a-zA-Z0-9]\{48})\b"
}
] |
| `description` | *string* | :heavy\_minus\_sign: | Description of the guardrail | A guardrail for limiting API usage |
| `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 |
| `ignoredModels` | *string*\[] | :heavy\_minus\_sign: | Array of model identifiers to exclude from routing (slug or canonical\_slug accepted) | \[
"openai/gpt-4o-mini"
] |
| `ignoredProviders` | *string*\[] | :heavy\_minus\_sign: | List of provider IDs to exclude from routing | \[
"azure"
] |
| `includeByokInBudgets` | *boolean* | :heavy\_minus\_sign: | Whether BYOK (bring-your-own-key) inference spend counts toward this guardrail's limit\_usd, in addition to OpenRouter credit spend. Defaults to false. | false |
| `limitUsd` | *number* | :heavy\_minus\_sign: | Spending limit in USD. Must be provided together with `reset_interval`: a request that sets only one of the two is rejected with a 400. | 50 |
| `name` | *string* | :heavy\_check\_mark: | Name for the new guardrail | My New Guardrail |
| `resetInterval` | [models.GuardrailInterval](../models/guardrailinterval.mdx) | :heavy\_minus\_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly |
| `workspaceId` | *string* | :heavy\_minus\_sign: | The workspace to create the guardrail in. When omitted, the guardrail is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. This only places the guardrail in the workspace; the created guardrail enforces nothing for that workspace's traffic until it is assigned to API keys or members. To restrict all traffic in a workspace, update the workspace's default guardrail instead. | 0df9e665-d932-5740-b2c7-b52af166bc11 |