Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Example Usage

import { UpdateGuardrailRequest } from "@openrouter/sdk/models";

let value: UpdateGuardrailRequest = {};

Fields

FieldTypeRequiredDescriptionExample
allowedModelsstring[]:heavy_minus_sign:Array of model identifiers (slug or canonical_slug accepted)[
“openai/gpt-5.2”
]
allowedProvidersstring[]:heavy_minus_sign:New list of allowed provider IDs[
“openai”,
“anthropic”,
“deepseek”
]
contentFilterBuiltinsmodels.ContentFilterBuiltinEntryInput[]:heavy_minus_sign:Builtin content filters to apply. Set to null to remove. 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.[
{"action": "block","slug": "regex-prompt-injection"}
]
contentFiltersmodels.ContentFilterEntry[]:heavy_minus_sign:Custom regex content filters to apply. Set to null to remove.<nil>
descriptionstring:heavy_minus_sign:New description for the guardrailUpdated description
enforceZdrboolean: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, 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
enforceZdrAnthropicboolean:heavy_minus_sign:Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided.true
enforceZdrGoogleboolean:heavy_minus_sign:Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided.true
enforceZdrOpenaiboolean:heavy_minus_sign:Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided.true
enforceZdrOtherboolean: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.true
ignoredModelsstring[]:heavy_minus_sign:Array of model identifiers to exclude from routing (slug or canonical_slug accepted)[
“openai/gpt-4o-mini”
]
ignoredProvidersstring[]:heavy_minus_sign:List of provider IDs to exclude from routing[
“azure”
]
limitUsdnumber:heavy_minus_sign:New spending limit in USD75
namestring:heavy_minus_sign:New name for the guardrailUpdated Guardrail Name
resetIntervalmodels.GuardrailInterval:heavy_minus_sign:Interval at which the limit resets (daily, weekly, monthly)monthly