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
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
name | string | :heavy_check_mark: | Name for the new guardrail | My New Guardrail |
description | string | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage |
limitUsd | number | :heavy_minus_sign: | Spending limit in USD | 50 |
resetInterval | operations.CreateGuardrailResetIntervalRequest | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly |
allowedProviders | string[] | :heavy_minus_sign: | List of allowed provider IDs | [ “openai”, “anthropic”, “deepseek” ] |
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” ] |
enforceZdr | boolean | :heavy_minus_sign: | Whether to enforce zero data retention | false |