AIX. - Grok / X - API

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIX. - Grok / X - API > !Model and Endpoint Configuration >

AIX. - Grok / X - API

AIX.GetModel

Previous Top Next


MiniRobotLanguage (MRL)

 

AIX.Get Model
Retrieve the Current AI Model

 

Intention

 

GetModel Command: Checking the Active Model
 
The Get Model command retrieves the current value of the AIX_Model global variable, indicating which AI model Grok is using for response generation. This helps users confirm the model selected via AIX.Set Model, along with its associated capabilities and costs. It’s part of the AIX - Grok / X - API suite.

 

What is the GetModel Command?

 

The Get Model command returns the current value of AIX_Model, a string identifying the active Grok model. Available models as of March 2025 include:

**grok-1**: General-purpose, cost-effective at $0.0001 per token, suitable for basic queries.

**grok-2**: Enhanced reasoning, priced at $0.00015 per token, ideal for analytical tasks.

**grok-pro**: Premium option at $0.0002 per token, with discounts for high volume, best for complex applications.

The default model is "grok-1" unless changed. Pricing reflects xAI’s public API rates and may include tiered plans; check https://x.ai/pricing for updates.

 

Why Do You Need It?

 

Retrieving the current model is useful for:

Verification: Ensure the correct model is active for cost or performance tracking.

Debugging: Identify model-specific issues in response quality or behavior.

Logging: Record the model used for auditing or billing reconciliation.

 

How to Use the GetModel Command?

 

Call the command with an optional variable to store the current model name.

If no variable is provided, the value remains in AIX_Model for direct access. This setting persists until changed by AIX.Set Model.

 

Example Usage

 

AIX.Set Model|"grok-pro"

AIX.Get Model|$$MOD

DBP.Current Model: $$MOD

AIX.Ask|Predict market trends|0

DBP.Prediction: $$AIX_GrokContent

 

Sets "grok-pro", retrieves it into $$MOD, and generates a response at $0.0002 per token.

 

AIX.Set Model|"grok-1"

AIX.Get Model

DBP.Default Access: Check AIX_Model

AIX.Ask|Simple question|0

DBP.Response: $$AIX_GrokContent

 

Switches to "grok-1", accessed via AIX_Model, at $0.0001 per token.

 

Illustration

 

┌───────────────┐

│ AIX_Model     │

├───────────────┤

│ "grok-pro"    │

└───────────────┘

Retrieving the current model set to grok-pro.

 

Syntax

 

AIX.GetModel[|P1]

AIX.Get Model[|P1]

 

Parameter Explanation

 

P1 - (Optional) The variable (e.g., $$MOD) to store the retrieved model name. If omitted, the value remains in AIX_Model.

 

Example

 

AIX.Set Model|"grok-2"

AIX.Get Model|$$MODEL

DBP.Active Model: $$MODEL

ENR.

 

Remarks

 

- Default is "grok-1" unless set by AIX.Set Model.

- Model selection impacts performance, cost, and response quality; refer to https://x.ai/docs for detailed specifications.

 

Limitations

 

- Only retrieves the current model; does not validate its availability or performance.

- Costs accrue based on token usage; monitor via xAI’s API dashboard.

 

See also:

 

AIX.Set Model

AIX.Ask

AIX.Set Temperature

AIX.Get Content