org.llm4s.llmconnect.config.XaiConfig
See theXaiConfig companion object
@Experimental
case class XaiConfig(apiKey: String, model: String, baseUrl: String, contextWindow: Int, reserveCompletion: Int, timeouts: ProviderTimeouts) extends ProviderConfig
Configuration for the xAI (Grok) API.
Prefer XaiConfig.fromValues over the primary constructor; it resolves contextWindow and reserveCompletion from the model registry (provider xai), falling back to xAI's published windows for models the registry does not list.
Value parameters
- apiKey
-
xAI API key; redacted in
toString. - baseUrl
-
API base URL; defaults to XaiConfig.DEFAULT_BASE_URL. Requests go to
<baseUrl>/chat/completions. - contextWindow
-
Model's total token capacity (prompt + completion combined).
- model
-
Model identifier, e.g.
"grok-4.7". - reserveCompletion
-
Tokens held back from prompt history for the completion.
- timeouts
-
how long a request and a stream may take: the section's
timeoutsblock. An absent value keeps the client's own default (ProviderTimeouts)
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ProviderConfigclass Objecttrait Matchableclass Any
Members list
In this article