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

Example Usage

import { CreateGuardrailRequest } from "@openrouter/sdk/models/operations";

let value: CreateGuardrailRequest = {
  name: "My New Guardrail",
};

Fields

FieldTypeRequiredDescriptionExample
namestring:heavy_check_mark:Name for the new guardrailMy New Guardrail
descriptionstring:heavy_minus_sign:Description of the guardrailA guardrail for limiting API usage
limitUsdnumber:heavy_minus_sign:Spending limit in USD50
resetIntervaloperations.CreateGuardrailResetIntervalRequest:heavy_minus_sign:Interval at which the limit resets (daily, weekly, monthly)monthly
allowedProvidersstring[]:heavy_minus_sign:List of allowed provider IDs[
“openai”,
“anthropic”,
“deepseek”
]
allowedModelsstring[]: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”
]
enforceZdrboolean:heavy_minus_sign:Whether to enforce zero data retentionfalse