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

# CreateGuardrailRequest - TypeScript SDK

> CreateGuardrailRequest type definition

<Warning>
  The TypeScript SDK and docs are currently in beta.
  Report issues on [GitHub](https://github.com/OpenRouterTeam/typescript-sdk/issues).
</Warning>

## Example Usage

```typescript lines theme={null}
import { CreateGuardrailRequest } from "@openrouter/sdk/models";

let value: CreateGuardrailRequest = {
  name: "My New Guardrail",
};
```

## Fields

| Field                   | Type                                                                                                                  | Required             | Description                                                                                                                                                                                                                                                                                                                                                                             | Example                                                                                                           |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `allowedModels`         | *string*\[]                                                                                                           | :heavy\_minus\_sign: | Array of model identifiers (slug or canonical\_slug accepted)                                                                                                                                                                                                                                                                                                                           | \[<br />"openai/gpt-5.2",<br />"anthropic/claude-4.5-opus-20251124",<br />"deepseek/deepseek-r1-0528:free"<br />] |
| `allowedProviders`      | *string*\[]                                                                                                           | :heavy\_minus\_sign: | List of allowed provider IDs                                                                                                                                                                                                                                                                                                                                                            | \[<br />"openai",<br />"anthropic",<br />"deepseek"<br />]                                                        |
| `contentFilterBuiltins` | [models.ContentFilterBuiltinEntryInput](/agent-sdk/typescript/api-reference/models/contentfilterbuiltinentryinput)\[] | :heavy\_minus\_sign: | Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only.                                                                                                                                                                       | \[<br />`{"action": "block","slug": "regex-prompt-injection"}`<br />]                                             |
| `contentFilters`        | [models.ContentFilterEntry](/agent-sdk/typescript/api-reference/models/contentfilterentry)\[]                         | :heavy\_minus\_sign: | Custom regex content filters to apply to request messages                                                                                                                                                                                                                                                                                                                               | \[<br />`{"action": "redact","label": "[API_KEY]","pattern": "\\b(sk-[a-zA-Z0-9]{48}`)\b"<br />}<br />]           |
| `description`           | *string*                                                                                                              | :heavy\_minus\_sign: | Description of the guardrail                                                                                                                                                                                                                                                                                                                                                            | A guardrail for limiting API usage                                                                                |
| ~~`enforceZdr`~~        | *boolean*                                                                                                             | :heavy\_minus\_sign: | : warning: \*\* DEPRECATED \*\*: This will be removed in a future release, please migrate away from it as soon as possible.<br /><br />Deprecated. Use enforce\_zdr\_anthropic, enforce\_zdr\_openai, enforce\_zdr\_google, 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, or Google. 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)                                                                                                                                                                                                                                                                                                   | \[<br />"openai/gpt-4o-mini"<br />]                                                                               |
| `ignoredProviders`      | *string*\[]                                                                                                           | :heavy\_minus\_sign: | List of provider IDs to exclude from routing                                                                                                                                                                                                                                                                                                                                            | \[<br />"azure"<br />]                                                                                            |
| `limitUsd`              | *number*                                                                                                              | :heavy\_minus\_sign: | Spending limit in USD                                                                                                                                                                                                                                                                                                                                                                   | 50                                                                                                                |
| `name`                  | *string*                                                                                                              | :heavy\_check\_mark: | Name for the new guardrail                                                                                                                                                                                                                                                                                                                                                              | My New Guardrail                                                                                                  |
| `resetInterval`         | [models.GuardrailInterval](/agent-sdk/typescript/api-reference/models/guardrailinterval)                              | :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. Defaults to the default workspace if not provided.                                                                                                                                                                                                                                                                                            | 0df9e665-d932-5740-b2c7-b52af166bc11                                                                              |
