Search Results for

    Show / Hide Table of Contents

    Class OpenRouterCompletionRequest

    Request model for OpenRouter's legacy /api/VERSION/completions endpoint.

    Inheritance
    object
    OpenRouterCompletionRequest
    Implements
    IJsonRequest
    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 OpenRouterCompletionRequest : IJsonRequest

    Properties

    | Edit this page View Source

    FrequencyPenalty

    Optional. Frequency penalty. Range: -2.0–2.0.

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

    Instructions

    Optional. The system message to use for the model.

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

    MaxTokens

    Optional. The maximum number of tokens to generate in the completion.

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

    Model

    Required. The AI model to use for the request.

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

    N

    Optional. The number of responses to generate. Defaults to 1.

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

    Prompt

    Required. The text prompt to complete.

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

    ResponseFormat

    Optional. An object specifying the format that the model must output.

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

    Seed

    Optional. Random seed for reproducibility.

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

    Stop

    Optional. List of strings that will stop further generation if generated.

    Declaration
    [JsonProperty("stop")]
    public List<string> Stop { get; set; }
    Property Value
    Type Description
    List<string>
    | Edit this page View Source

    Stream

    Optional. Enable streaming of results. Defaults to false.

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

    StreamOptions

    Optional. Whether to include usage information in the response.

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

    Temperature

    Optional. Sampling temperature. Range: 0.0–1.0.

    Declaration
    [JsonProperty("temperature")]
    public float? Temperature { get; set; }
    Property Value
    Type Description
    float?

    Implements

    IJsonRequest

    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