Table of Contents

Class CompletionRequest

Namespace
Glitch9.AIDevKit

Legacy completion request for models that do not support chat-based interactions.

public class CompletionRequest : IJsonRequest
Inheritance
object
CompletionRequest

Properties

FrequencyPenalty

Optional. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
Range: -2.0–2.0

public FrequencyPenalty FrequencyPenalty { get; set; }

Property Value

FrequencyPenalty

Instructions

Optional. The system message to use for the model.

public string Instructions { get; set; }

Property Value

string

MaxTokens

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

public int? MaxTokens { get; set; }

Property Value

int?

Model

The AI model to use for the request.

public string Model { get; set; }

Property Value

string

N

The number of responses to generate. Defaults to 1.

public int? N { get; set; }

Property Value

int?

Prompt

The text prompt to complete.

Required for:

  • OpenAI legacy models
  • OpenRouter completion requests
public string Prompt { get; set; }

Property Value

string

ResponseFormat

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

Setting to { "type": "json_schema", "json_schema": { ...} }
enables Structured Outputs which ensures the model will match your supplied JSON schema.Learn more in the Structured Outputs guide.

Setting to { "type": "json_object" } enables the older JSON mode, which ensures the message the model generates is valid JSON.Using json_schema is preferred for models that support it.

public ResponseFormat ResponseFormat { get; set; }

Property Value

ResponseFormat

Seed

Optional. Random seed for reproducibility. Set to the same value for deterministic output.

public uint? Seed { get; set; }

Property Value

uint?

Stop

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

public List<string> Stop { get; set; }

Property Value

List<string>

Stream

Optional. Enable streaming of results.
Defaults to false

public bool? Stream { get; set; }

Property Value

bool?

StreamOptions

Optional. Whether to include usage information in the response

public StreamOptions StreamOptions { get; set; }

Property Value

StreamOptions

Temperature

Optional. Sampling temperature: controls randomness in output.

  • Lower = deterministic
  • Higher = creative
Range: 0.0–2.0 (typical: 0.7–1.0).
public Temperature Temperature { get; set; }

Property Value

Temperature