% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/providers.R
\name{llm_provider_openai_compat}
\alias{llm_provider_openai_compat}
\title{Create a generic OpenAI-compatible LLM provider}
\usage{
llm_provider_openai_compat(
  api_key,
  model,
  base_url,
  name = "OpenAI-compatible",
  max_retries = 5L
)
}
\arguments{
\item{api_key}{API key string.}

\item{model}{Model identifier.}

\item{base_url}{Full chat-completions endpoint URL.}

\item{name}{Display name used in \code{print()} output and plot labels.}

\item{max_retries}{Maximum request attempts before returning \code{NA}.}
}
\value{
An \code{llm_provider} object.
}
\description{
Suitable for any API that mirrors the OpenAI chat completions wire format.
Used internally by \code{\link[=llm_provider_openai]{llm_provider_openai()}}, \code{\link[=llm_provider_grok]{llm_provider_grok()}},
\code{\link[=llm_provider_gemini]{llm_provider_gemini()}}, and \code{\link[=llm_provider_ollama]{llm_provider_ollama()}}.
}
\examples{
\dontrun{
p <- llm_provider_openai_compat(
  api_key  = Sys.getenv("OPENAI_API_KEY"),
  model    = "gpt-4o-mini",
  base_url = "https://api.openai.com/v1/chat/completions"
)
print(p)
}
}
