OpenAIProvider
classin packageklyn.llm
public class OpenAIProvider extends Object implements LLMProvider:
└ OpenAIProvider
All Implemented Interfaces: LLMProvider

OpenAI-compatible HTTP provider.

Despite its name, this class targets the chat-completions style API used by many OpenAI-compatible providers.

Fields
Modifier and Type Member Description
public apiKey
apiKey as String
Bearer API key.
public baseUrl
baseUrl as String
Provider API root.
public httpClient
httpClient as HttpClient
HTTP client used for provider calls.
public model
model as String
Model identifier.
public temperature
temperature as Double
Sampling temperature.
Properties
Modifier and Type Member Description
public readonly property chatCompletionsUrl
chatCompletionsUrl as String:
Returns the final chat-completions endpoint.
public property reasoningEffort
reasoningEffort as String:
Optional reasoning effort level for models that expose that parameter.
Properties inherited from Object: type
Constructors
Modifier and Type Member Description
public OpenAIProvider
OpenAIProvider(baseUrl as String, apiKey as String, model as String, temperature as Double = 0.7):
Creates a configured provider.
Methods
Modifier and Type Member Description
public cancel
cancel() as Void:
Cancels the currently running provider HTTP request, if any.
public override complete
complete(request as LLMRequest) as LLMResponse throws Exception:
Sends one completion request.
Methods inherited from Object: fromJson, toDict, toJson, toString, toXml