Values

GROK_2_IMAGE

GROK_2_IMAGE: Str "grok-2-image-1212"

GROK_2_VISION

GROK_2_VISION: Str "grok-2-vision-1212"

GROK_3

GROK_3: Str "grok-3"

GROK_3_MINI

GROK_3_MINI: Str "grok-3-mini"

GROK_4_0709

GROK_4_0709: Str "grok-4-0709"

GROK_4_1_FAST_NON_REASONING

GROK_4_1_FAST_NON_REASONING: Str "grok-4-1-fast-non-reasoning"

GROK_4_1_FAST_REASONING

GROK_4_1_FAST_REASONING: Str "grok-4-1-fast-reasoning"

GROK_4_FAST_NON_REASONING

GROK_4_FAST_NON_REASONING: Str "grok-4-fast-non-reasoning"

GROK_4_FAST_REASONING

GROK_4_FAST_REASONING: Str "grok-4-fast-reasoning"

GROK_CODE_FAST_1

GROK_CODE_FAST_1: Str "grok-code-fast-1"

GROK_IMAGINE_IMAGE

GROK_IMAGINE_IMAGE: Str "grok-imagine-image"

GROK_IMAGINE_VIDEO

GROK_IMAGINE_VIDEO: Str "grok-imagine-video"

Functions

get

fn (model-id: Str): Model | ::xai::api/HttpError

Retrieve details about a specific model by its ID.

Returns a Model with id, object, created, and owned_by fields.

Example

model get("grok-3-mini")
model.id // => "grok-3-mini"
model.object // => "model"

list

fn (): ModelsListResponse | ::xai::api/HttpError

List available models from the xAI API.

Returns a ModelsListResponse containing a Vec of Model objects.

Example

models list()
models.data // => [{id: "grok-3", object: "model", ...}, ...]

first-model first(models.data)
first-model.id // => "grok-3"

Types

Model

Model type {
    id: Str,
    object: Str,
    created: Int?,
    owned_by: Str?
}

ModelsListResponse

ModelsListResponse type {
    object: Str,
    data: Vec
}