class Riffer::Providers::OpenRouter
OpenRouter provider (openrouter.ai). Requires the openai gem —OpenRouter exposes an OpenAI-compatible endpoint, so this reuses the OpenAI SDK with a base_url override. api_key falls back to config, then OPENROUTER_API_KEY.
Constants
- BASE_URL
Public Class Methods
Source
# File lib/riffer/providers/open_router.rb, line 15 def initialize(api_key: nil, **options) depends_on "openai" api_key ||= Riffer.config.openrouter.api_key || ENV["OPENROUTER_API_KEY"] @client = ::OpenAI::Client.new(api_key: api_key, base_url: BASE_URL, **options) end