Skip to main content

grok

Function grok 

Source
pub fn grok() -> Result<OpenAiClient, ApiError>
Expand description

Grok (xAI) client — an OpenAiClient pointed at the xAI API.

Reads XAI_API_KEY (or GROK_API_KEY) (required) and optionally GROK_MODEL (defaults to grok-beta).

§Example

use loopctl::provider;

let client = provider::grok()?;

§Errors

Returns ApiError if no API key is found.