Search Results for

    Show / Hide Table of Contents

    Class OpenRouterOptions.ProviderOptions

    Inheritance
    object
    OpenRouterOptions.ProviderOptions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.OpenRouter
    Assembly: Glitch9.AIDevKit.Provider.OpenRouter.dll
    Syntax
    public class OpenRouterOptions.ProviderOptions

    Properties

    | Edit this page View Source

    AllowFallbacks

    Whether to allow backup providers to serve requests. Optional.

    • true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
    • false: use only the primary/custom provider, and return the upstream error if it's unavailable.
    Declaration
    [JsonProperty("allow_fallbacks")]
    public bool? AllowFallbacks { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    DataCollection

    Data collection setting. Optional. If no available model provider meets the requirement, your request will return an error.

    • "allow": (default) allow providers which store user data non-transiently and may train on it
    • "deny": use only providers which do not collect user data
    Declaration
    [JsonProperty("data_collection")]
    public string DataCollection { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    EnforceDistillableText

    Whether to enforce distillable text format. Optional.

    Declaration
    [JsonProperty("enforce_distillable_text")]
    public bool? EnforceDistillableText { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    Ignore

    List of provider slugs to ignore. Optional. If provided, this list is merged with your account-wide ignored provider settings for this request. See OpenRouter documentation for the full list of supported providers.

    Declaration
    [JsonProperty("ignore")]
    public string[] Ignore { get; set; }
    Property Value
    Type Description
    string[]
    | Edit this page View Source

    MaxLatency

    Maximum latency requirement for the provider. Optional.

    Declaration
    [JsonProperty("max_latency")]
    public double? MaxLatency { get; set; }
    Property Value
    Type Description
    double?
    | Edit this page View Source

    MaxPrice

    The object specifying the maximum price you want to pay for this request. Optional. USD price per million tokens, for prompt and completion.

    Declaration
    [JsonProperty("max_price")]
    public OpenRouterOptions.MaxPrice MaxPrice { get; set; }
    Property Value
    Type Description
    OpenRouterOptions.MaxPrice
    | Edit this page View Source

    MinThroughput

    Minimum throughput requirement for the provider. Optional.

    Declaration
    [JsonProperty("min_throughput")]
    public double? MinThroughput { get; set; }
    Property Value
    Type Description
    double?
    | Edit this page View Source

    Only

    List of provider slugs to allow. Optional. If provided, this list is merged with your account-wide allowed provider settings for this request. See OpenRouter documentation for the full list of supported providers.

    Declaration
    [JsonProperty("only")]
    public string[] Only { get; set; }
    Property Value
    Type Description
    string[]
    | Edit this page View Source

    Order

    An ordered list of provider slugs. Optional. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.

    Declaration
    [JsonProperty("order")]
    public string[] Order { get; set; }
    Property Value
    Type Description
    string[]
    | Edit this page View Source

    PreferredMaxLatency

    Preferred maximum latency for the provider. Optional.

    Declaration
    [JsonProperty("preferred_max_latency")]
    public double? PreferredMaxLatency { get; set; }
    Property Value
    Type Description
    double?
    | Edit this page View Source

    PreferredMinThroughput

    Preferred minimum throughput for the provider. Optional.

    Declaration
    [JsonProperty("preferred_min_throughput")]
    public double? PreferredMinThroughput { get; set; }
    Property Value
    Type Description
    double?
    | Edit this page View Source

    Quantizations

    A list of quantization levels to filter the provider by. Optional. Allowed values: "int4", "int8", "fp4", "fp6", "fp8", "fp16", "bf16", "fp32", "unknown"

    Declaration
    [JsonProperty("quantizations")]
    public string[] Quantizations { get; set; }
    Property Value
    Type Description
    string[]
    | Edit this page View Source

    RequireParameters

    Whether to filter providers to only those that support the parameters you've provided. Optional. If this setting is omitted or set to false, providers will receive only the parameters they support and ignore the rest.

    Declaration
    [JsonProperty("require_parameters")]
    public bool? RequireParameters { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    Sort

    The sorting strategy to use for this request, if "order" is not specified. Optional. When set, no load balancing is performed.

    Declaration
    [JsonProperty("sort")]
    public OpenRouterOptions.Sort Sort { get; set; }
    Property Value
    Type Description
    OpenRouterOptions.Sort
    | Edit this page View Source

    Zdr

    Zero data retention flag. Optional.

    Declaration
    [JsonProperty("zdr")]
    public bool? Zdr { get; set; }
    Property Value
    Type Description
    bool?

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation