Example Usage
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
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[] | :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. | [{"action": "block","slug": "regex-prompt-injection"}] |
contentFilters | models.ContentFilterEntry[] | :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 |
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, 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) | [ “openai/gpt-4o-mini” ] |
ignoredProviders | string[] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [ “azure” ] |
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 | :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 |