CreateGuardrailRequest - TypeScript SDK

CreateGuardrailRequest type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Example Usage

1import { CreateGuardrailRequest } from "@openrouter/sdk/models";
2
3let value: CreateGuardrailRequest = {
4 name: "My New Guardrail",
5};

Fields

FieldTypeRequiredDescriptionExample
allowedModelsstring[]Array of model identifiers (slug or canonical_slug accepted)[
“openai/gpt-5.2”,
“anthropic/claude-4.5-opus-20251124”,
“deepseek/deepseek-r1-0528:free”
]
allowedProvidersstring[]List of allowed provider IDs[
“openai”,
“anthropic”,
“deepseek”
]
descriptionstringDescription of the guardrailA guardrail for limiting API usage
enforceZdrbooleanWhether to enforce zero data retentionfalse
ignoredModelsstring[]Array of model identifiers to exclude from routing (slug or canonical_slug accepted)[
“openai/gpt-4o-mini”
]
ignoredProvidersstring[]List of provider IDs to exclude from routing[
“azure”
]
limitUsdnumberSpending limit in USD50
namestring✔️Name for the new guardrailMy New Guardrail
resetIntervalmodels.GuardrailIntervalInterval at which the limit resets (daily, weekly, monthly)monthly
workspaceIdstringThe workspace to create the guardrail in. Defaults to the default workspace if not provided.0df9e665-d932-5740-b2c7-b52af166bc11