Example Usage
import { UpdateGuardrailRequest } from "@openrouter/sdk/models";
let value: UpdateGuardrailRequest = {};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
allowedDataRegions | models.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. An empty array is rejected. | [ “europe” ] |
allowedModels | string[] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [ “openai/gpt-5.2” ] |
allowedProviders | string[] | :heavy_minus_sign: | New list of allowed provider IDs | [ “openai”, “anthropic”, “deepseek” ] |
contentFilterBuiltins | models.ContentFilterBuiltinEntryInput[] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. Every builtin slug supports “block”, “redact”, and the detect-only “flag” action. | [ { “action”: “block”, “slug”: “regex-prompt-injection” } ] |
contentFilters | models.ContentFilterEntry[] | :heavy_minus_sign: | Custom regex content filters to apply. Set to null to remove. | null |
description | string | :heavy_minus_sign: | New description for the guardrail | Updated description |
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. | true |
enforceZdrAnthropic | boolean | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | true |
enforceZdrGoogle | boolean | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | true |
enforceZdrOpenai | boolean | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | true |
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. | true |
enforceZdrXai | boolean | :heavy_minus_sign: | Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. | true |
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. Omit to leave unchanged. | true |
limitUsd | number | :heavy_minus_sign: | New spending limit in USD | 75 |
name | string | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name |
resetInterval | models.GuardrailInterval | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly |