Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,10 @@ partial void ProcessCreateResponseContent(
/// Create a guardrail<br/>
/// Create a new guardrail for the authenticated user. A newly created guardrail enforces nothing until it is assigned to API keys or organization members; `workspace_id` places the guardrail in a workspace but does not apply it to that workspace's traffic. To restrict all traffic in a workspace, update the workspace's default guardrail instead. Set `allowed_data_regions` to enforce [In-Region Routing](/docs/guides/features/in-region-routing#enforcing-in-region-routing-with-guardrails): governed requests must arrive through one of the listed OpenRouter domains and are rejected with a 403 otherwise. [Management key](/docs/guides/overview/auth/management-api-keys) required.
/// </summary>
/// <param name="allowSafetyRetentionGoogle">
/// Whether ZDR requests for Google models may use Safety Retention endpoints, which keep only prompts flagged by safety classifiers. `false` requires strict ZDR for Google. `null` inherits the account setting, which is on by default. A guardrail cannot turn this on for an account that turned it off.<br/>
/// Example: true
/// </param>
/// <param name="allowedDataRegions">
/// Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.<br/>
/// Example: [europe]
Expand Down Expand Up @@ -676,6 +680,7 @@ partial void ProcessCreateResponseContent(
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::OpenRouter.CreateGuardrailResponse> CreateAsync(
string name,
bool? allowSafetyRetentionGoogle = default,
global::System.Collections.Generic.IList<global::OpenRouter.GuardrailDataRegion>? allowedDataRegions = default,
global::System.Collections.Generic.IList<string>? allowedModels = default,
global::System.Collections.Generic.IList<string>? allowedProviders = default,
Expand All @@ -701,6 +706,7 @@ partial void ProcessCreateResponseContent(
{
var __request = new global::OpenRouter.CreateGuardrailRequest
{
AllowSafetyRetentionGoogle = allowSafetyRetentionGoogle,
AllowedDataRegions = allowedDataRegions,
AllowedModels = allowedModels,
AllowedProviders = allowedProviders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,10 @@ partial void ProcessUpdateResponseContent(
/// The unique identifier of the guardrail to update<br/>
/// Example: 550e8400-e29b-41d4-a716-446655440000
/// </param>
/// <param name="allowSafetyRetentionGoogle">
/// Whether ZDR requests for Google models may use Safety Retention endpoints, which keep only prompts flagged by safety classifiers. `false` requires strict ZDR for Google. `null` inherits the account setting, which is on by default. A guardrail cannot turn this on for an account that turned it off.<br/>
/// Example: true
/// </param>
/// <param name="allowedDataRegions">
/// Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.<br/>
/// Example: [europe]
Expand Down Expand Up @@ -765,6 +769,7 @@ partial void ProcessUpdateResponseContent(
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::OpenRouter.UpdateGuardrailResponse> UpdateAsync(
global::System.Guid id,
bool? allowSafetyRetentionGoogle = default,
global::System.Collections.Generic.IList<global::OpenRouter.GuardrailDataRegion>? allowedDataRegions = default,
global::System.Collections.Generic.IList<string>? allowedModels = default,
global::System.Collections.Generic.IList<string>? allowedProviders = default,
Expand All @@ -790,6 +795,7 @@ partial void ProcessUpdateResponseContent(
{
var __request = new global::OpenRouter.UpdateGuardrailRequest
{
AllowSafetyRetentionGoogle = allowSafetyRetentionGoogle,
AllowedDataRegions = allowedDataRegions,
AllowedModels = allowedModels,
AllowedProviders = allowedProviders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public partial interface IGuardrailsClient
/// Create a guardrail<br/>
/// Create a new guardrail for the authenticated user. A newly created guardrail enforces nothing until it is assigned to API keys or organization members; `workspace_id` places the guardrail in a workspace but does not apply it to that workspace's traffic. To restrict all traffic in a workspace, update the workspace's default guardrail instead. Set `allowed_data_regions` to enforce [In-Region Routing](/docs/guides/features/in-region-routing#enforcing-in-region-routing-with-guardrails): governed requests must arrive through one of the listed OpenRouter domains and are rejected with a 403 otherwise. [Management key](/docs/guides/overview/auth/management-api-keys) required.
/// </summary>
/// <param name="allowSafetyRetentionGoogle">
/// Whether ZDR requests for Google models may use Safety Retention endpoints, which keep only prompts flagged by safety classifiers. `false` requires strict ZDR for Google. `null` inherits the account setting, which is on by default. A guardrail cannot turn this on for an account that turned it off.<br/>
/// Example: true
/// </param>
/// <param name="allowedDataRegions">
/// Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.<br/>
/// Example: [europe]
Expand Down Expand Up @@ -125,6 +129,7 @@ public partial interface IGuardrailsClient
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.CreateGuardrailResponse> CreateAsync(
string name,
bool? allowSafetyRetentionGoogle = default,
global::System.Collections.Generic.IList<global::OpenRouter.GuardrailDataRegion>? allowedDataRegions = default,
global::System.Collections.Generic.IList<string>? allowedModels = default,
global::System.Collections.Generic.IList<string>? allowedProviders = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public partial interface IGuardrailsClient
/// The unique identifier of the guardrail to update<br/>
/// Example: 550e8400-e29b-41d4-a716-446655440000
/// </param>
/// <param name="allowSafetyRetentionGoogle">
/// Whether ZDR requests for Google models may use Safety Retention endpoints, which keep only prompts flagged by safety classifiers. `false` requires strict ZDR for Google. `null` inherits the account setting, which is on by default. A guardrail cannot turn this on for an account that turned it off.<br/>
/// Example: true
/// </param>
/// <param name="allowedDataRegions">
/// Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.<br/>
/// Example: [europe]
Expand Down Expand Up @@ -135,6 +139,7 @@ public partial interface IGuardrailsClient
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::OpenRouter.UpdateGuardrailResponse> UpdateAsync(
global::System.Guid id,
bool? allowSafetyRetentionGoogle = default,
global::System.Collections.Generic.IList<global::OpenRouter.GuardrailDataRegion>? allowedDataRegions = default,
global::System.Collections.Generic.IList<string>? allowedModels = default,
global::System.Collections.Generic.IList<string>? allowedProviders = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
namespace OpenRouter
{
/// <summary>
/// Example: {"allowed_models":null,"allowed_providers":["openai","anthropic","deepseek"],"content_filter_builtins":[{"action":"block","slug":"regex-prompt-injection"}],"content_filters":null,"description":"A guardrail for limiting API usage","enforce_zdr_anthropic":true,"enforce_zdr_google":false,"enforce_zdr_openai":true,"enforce_zdr_other":false,"enforce_zdr_xai":false,"ignored_models":null,"ignored_providers":null,"limit_usd":50,"name":"My New Guardrail","reset_interval":"monthly"}
/// Example: {"allow_safety_retention_google":null,"allowed_models":null,"allowed_providers":["openai","anthropic","deepseek"],"content_filter_builtins":[{"action":"block","slug":"regex-prompt-injection"}],"content_filters":null,"description":"A guardrail for limiting API usage","enforce_zdr_anthropic":true,"enforce_zdr_google":false,"enforce_zdr_openai":true,"enforce_zdr_other":false,"enforce_zdr_xai":false,"ignored_models":null,"ignored_providers":null,"limit_usd":50,"name":"My New Guardrail","reset_interval":"monthly"}
/// </summary>
public sealed partial class CreateGuardrailRequest
{
/// <summary>
/// Whether ZDR requests for Google models may use Safety Retention endpoints, which keep only prompts flagged by safety classifiers. `false` requires strict ZDR for Google. `null` inherits the account setting, which is on by default. A guardrail cannot turn this on for an account that turned it off.<br/>
/// Example: true
/// </summary>
/// <example>true</example>
[global::System.Text.Json.Serialization.JsonPropertyName("allow_safety_retention_google")]
public bool? AllowSafetyRetentionGoogle { get; set; }

/// <summary>
/// Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.<br/>
/// Example: [europe]
Expand Down Expand Up @@ -202,6 +210,10 @@ public sealed partial class CreateGuardrailRequest
/// Name for the new guardrail<br/>
/// Example: My New Guardrail
/// </param>
/// <param name="allowSafetyRetentionGoogle">
/// Whether ZDR requests for Google models may use Safety Retention endpoints, which keep only prompts flagged by safety classifiers. `false` requires strict ZDR for Google. `null` inherits the account setting, which is on by default. A guardrail cannot turn this on for an account that turned it off.<br/>
/// Example: true
/// </param>
/// <param name="allowedDataRegions">
/// Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.<br/>
/// Example: [europe]
Expand Down Expand Up @@ -287,6 +299,7 @@ public sealed partial class CreateGuardrailRequest
#endif
public CreateGuardrailRequest(
string name,
bool? allowSafetyRetentionGoogle,
global::System.Collections.Generic.IList<global::OpenRouter.GuardrailDataRegion>? allowedDataRegions,
global::System.Collections.Generic.IList<string>? allowedModels,
global::System.Collections.Generic.IList<string>? allowedProviders,
Expand All @@ -308,6 +321,7 @@ public CreateGuardrailRequest(
global::OpenRouter.GuardrailInterval? resetInterval,
global::System.Guid? workspaceId)
{
this.AllowSafetyRetentionGoogle = allowSafetyRetentionGoogle;
this.AllowedDataRegions = allowedDataRegions;
this.AllowedModels = allowedModels;
this.AllowedProviders = allowedProviders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace OpenRouter
{
/// <summary>
/// Example: {"data":{"allowed_models":null,"allowed_providers":["openai","anthropic","google"],"content_filter_builtins":[{"action":"redact","label":"[EMAIL]","slug":"email"}],"content_filters":null,"created_at":"2025-08-24T10:30:00Z","description":"A guardrail for limiting API usage","enable_free_model_publication":false,"enable_free_model_training":true,"enable_paid_model_training":true,"enforce_zdr":null,"enforce_zdr_anthropic":true,"enforce_zdr_google":false,"enforce_zdr_openai":true,"enforce_zdr_other":false,"enforce_zdr_xai":false,"id":"550e8400-e29b-41d4-a716-446655440000","ignored_models":null,"ignored_providers":null,"include_byok_in_budgets":false,"limit_usd":50,"name":"My New Guardrail","reset_interval":"monthly","updated_at":null,"workspace_id":"0df9e665-d932-5740-b2c7-b52af166bc11"}}
/// Example: {"data":{"allow_safety_retention_google":null,"allowed_models":null,"allowed_providers":["openai","anthropic","google"],"content_filter_builtins":[{"action":"redact","label":"[EMAIL]","slug":"email"}],"content_filters":null,"created_at":"2025-08-24T10:30:00Z","description":"A guardrail for limiting API usage","enable_free_model_publication":false,"enable_free_model_training":true,"enable_paid_model_training":true,"enforce_zdr":null,"enforce_zdr_anthropic":true,"enforce_zdr_google":false,"enforce_zdr_openai":true,"enforce_zdr_other":false,"enforce_zdr_xai":false,"id":"550e8400-e29b-41d4-a716-446655440000","ignored_models":null,"ignored_providers":null,"include_byok_in_budgets":false,"limit_usd":50,"name":"My New Guardrail","reset_interval":"monthly","updated_at":null,"workspace_id":"0df9e665-d932-5740-b2c7-b52af166bc11"}}
/// </summary>
public sealed partial class CreateGuardrailResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace OpenRouter
{
/// <summary>
/// Example: {"data":{"allowed_models":null,"allowed_providers":["openai","anthropic","google"],"content_filter_builtins":[{"action":"redact","label":"[EMAIL]","slug":"email"}],"content_filters":null,"created_at":"2025-08-24T10:30:00Z","description":"Guardrail for production environment","enable_free_model_publication":false,"enable_free_model_training":true,"enable_paid_model_training":true,"enforce_zdr":null,"enforce_zdr_anthropic":true,"enforce_zdr_google":false,"enforce_zdr_openai":true,"enforce_zdr_other":false,"enforce_zdr_xai":false,"id":"550e8400-e29b-41d4-a716-446655440000","ignored_models":null,"ignored_providers":null,"include_byok_in_budgets":false,"limit_usd":100,"name":"Production Guardrail","reset_interval":"monthly","updated_at":"2025-08-24T15:45:00Z","workspace_id":"0df9e665-d932-5740-b2c7-b52af166bc11"}}
/// Example: {"data":{"allow_safety_retention_google":null,"allowed_models":null,"allowed_providers":["openai","anthropic","google"],"content_filter_builtins":[{"action":"redact","label":"[EMAIL]","slug":"email"}],"content_filters":null,"created_at":"2025-08-24T10:30:00Z","description":"Guardrail for production environment","enable_free_model_publication":false,"enable_free_model_training":true,"enable_paid_model_training":true,"enforce_zdr":null,"enforce_zdr_anthropic":true,"enforce_zdr_google":false,"enforce_zdr_openai":true,"enforce_zdr_other":false,"enforce_zdr_xai":false,"id":"550e8400-e29b-41d4-a716-446655440000","ignored_models":null,"ignored_providers":null,"include_byok_in_budgets":false,"limit_usd":100,"name":"Production Guardrail","reset_interval":"monthly","updated_at":"2025-08-24T15:45:00Z","workspace_id":"0df9e665-d932-5740-b2c7-b52af166bc11"}}
/// </summary>
public sealed partial class GetGuardrailResponse
{
Expand Down
Loading
Loading