Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
AllowedDataRegions | optionalnullable.OptionalNullable[[]components.GuardrailDataRegion] | :heavy_minus_sign: | Data regions through which requests governed by this guardrail must arrive. global is https://openrouter.ai, europe is https://eu.openrouter.ai, and us is 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 | optionalnullable.OptionalNullable[[]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 | optionalnullable.OptionalNullable[[]string] | :heavy_minus_sign: | List of allowed provider IDs | [ “openai”, “anthropic”, “google” ] |
ContentFilterBuiltins | optionalnullable.OptionalNullable[[]components.ContentFilterBuiltinEntry] | :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 | optionalnullable.OptionalNullable[[]components.ContentFilterEntry] | :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 | optionalnullable.OptionalNullable[string] | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment |
EnableFreeModelPublication | optionalnullable.OptionalNullable[bool] | :heavy_minus_sign: | Whether this guardrail allows free endpoints that publish prompts. | false |
EnableFreeModelTraining | optionalnullable.OptionalNullable[bool] | :heavy_minus_sign: | Whether this guardrail allows free endpoints that train on request data. | true |
EnablePaidModelTraining | optionalnullable.OptionalNullable[bool] | :heavy_minus_sign: | Whether this guardrail allows paid endpoints that train on request data. | true |
EnforceZdr | optionalnullable.OptionalNullable[bool] | :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 | optionalnullable.OptionalNullable[bool] | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | false |
EnforceZdrGoogle | optionalnullable.OptionalNullable[bool] | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | false |
EnforceZdrOpenai | optionalnullable.OptionalNullable[bool] | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | false |
EnforceZdrOther | optionalnullable.OptionalNullable[bool] | :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 | optionalnullable.OptionalNullable[bool] | :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 | optionalnullable.OptionalNullable[[]string] | :heavy_minus_sign: | Array of model canonical_slugs to exclude from routing | [ “openai/gpt-4o-mini-2024-07-18” ] |
IgnoredProviders | optionalnullable.OptionalNullable[[]string] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [ “azure” ] |
IncludeBYOKInBudgets | bool | :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 | optionalnullable.OptionalNullable[float64] | :heavy_minus_sign: | Spending limit in USD | 100 |
Name | string | :heavy_check_mark: | Name of the guardrail | Production Guardrail |
ResetInterval | optionalnullable.OptionalNullable[components.GuardrailInterval] | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly |
UpdatedAt | optionalnullable.OptionalNullable[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 |