class

Cri::APIClients::OpenAICompatibleHTTP

Inherits Reference < Object

OpenAI-compatible HTTP/SSE wire client. The enclosing provider, credentials, and provider identity are supplied by the host registry. It intentionally exposes raw JSON so provider adapters own semantics.

Constructors

new(endpoint : String = ENV["CRI_MODEL_URL"]? || "https://api.openai.com/v1/chat/completions", api_key : String | Nil = ENV["CRI_API_KEY"]?, timeout : Time::Span = 120.seconds, transport : Cri::Transport = Cri::Transports::SSE.new)
Source

Instance methods

api_key
Source
chat(payload : JSON::Any) : JSON::Any
Source
chat_stream(payload : JSON::Any, &block : JSON::Any -> Nil) : Nil
Source
endpoint
Source
list_models
Source
timeout
Source
transport
Source
validate_api_key
Source