class

Smith::LLM::OpenRouter

Inherits Smith::LLM::Provider < Reference < Object

Constants

DEFAULT_APP_NAME = "smith"
DEFAULT_ENDPOINT = "https://openrouter.ai/api/v1/chat/completions"
DEFAULT_SITE_URL = "https://github.com/webmatze/smith"

Constructors

new(api_key : String = ENV.fetch("OPENROUTER_API_KEY", ""), default_model : String = "qwen/qwen3.8-max", timeouts : Timeouts = Timeouts.default)
Source

Instance methods

api_key
Source
complete(request : Request) : Response
Source
complete_streaming(request : Request, &on_delta : String -> Nil) : Response

Streaming entry point. The default does no streaming at all — it runs complete() and hands the text over in one piece.

That default is what makes deltas universal: callers always see them, whether or not the provider streams, so neither the agent loop nor the renderers need a special case. Providers override this; when streaming is switched off they call super.

Source
default_model
Source
name
Source