Most R packages that talk to an LLM API feel translated. The idioms arrive from somewhere else — promise chains where you'd write a plain loop, foreign exception objects where R would raise a condition. The nRouter R SDK (package name nrouter ) is written the other way round, and three choices give it away.
It installs the R way, from R-universe
The package isn't on CRAN. It installs from nRouter's R-universe, with CRAN kept alongside for dependencies:
install . packages ( "nrouter" , repos = c ( nrouterai = "https://nrouterai.r-universe.dev" , CRAN = "https://cloud.r-project.org" ) )
Enter fullscreen mode
Exit fullscreen mode
Prefer source? remotes::install_github("nRouterGateway/nrouter-sdk", subdir = "sdks/r") gets the same package from the SDK repo.
The client takes the key the way R scripts already expect it, out of .Renviron :
library ( nrouter ) client <- nrouter_client ( api_key = Sys .…