Class OpenRouterCompletionRequest
Request model for OpenRouter's legacy /api/VERSION/completions endpoint.
Implements
Inherited Members
Namespace: Glitch9.AIDevKit.OpenRouter
Assembly: Glitch9.AIDevKit.Provider.OpenRouter.dll
Syntax
public class OpenRouterCompletionRequest : IJsonRequest
Properties
| Edit this page View SourceFrequencyPenalty
Optional. Frequency penalty. Range: -2.0–2.0.
Declaration
[JsonProperty("frequency_penalty")]
public float? FrequencyPenalty { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
Instructions
Optional. The system message to use for the model.
Declaration
[JsonProperty("instructions")]
public string Instructions { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
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? |
Model
Required. The AI model to use for the request.
Declaration
[JsonProperty("model")]
public string Model { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
N
Optional. The number of responses to generate. Defaults to 1.
Declaration
[JsonProperty("n")]
public int? N { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Prompt
Required. The text prompt to complete.
Declaration
[JsonProperty("prompt")]
public string Prompt { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
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 |
Seed
Optional. Random seed for reproducibility.
Declaration
[JsonProperty("seed")]
public uint? Seed { get; set; }
Property Value
| Type | Description |
|---|---|
| uint? |
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> |
Stream
Optional. Enable streaming of results. Defaults to false.
Declaration
[JsonProperty("stream")]
public bool? Stream { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
StreamOptions
Optional. Whether to include usage information in the response.
Declaration
[JsonProperty("stream_options")]
public StreamOptions StreamOptions { get; set; }
Property Value
| Type | Description |
|---|---|
| StreamOptions |
Temperature
Optional. Sampling temperature. Range: 0.0–1.0.
Declaration
[JsonProperty("temperature")]
public float? Temperature { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |