|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIX - Artificial Intelligence and X Platform Utility |
MiniRobotLanguage (MRL)
AIX - Grok / X - API
Artificial Intelligence and X Platform Utility Overview
Intention
AIX - Grok / X - API: Leveraging AI and X Platform Capabilities
This section introduces the Artificial Intelligence and X Platform Utility (AIX) system, a collection of commands designed to interact with the Grok AI model by xAI and the X platform API.
It provides tools for chat, response generation, embeddings, and platform-specific tasks, accessible through MiniRobotLanguage (MRL).
The AIX system is a set of tools that leverage the Grok AI model and X platform API to perform advanced AI functions, including conversational tasks, response customization, and data embeddings.
It requires an API key for authentication and involves costs based on usage, with commands providing fine-grained control over AI behavior and output.
To use the AIX system, you need an API key from xAI or the X platform (depending on the specific service). Follow these steps:
•Visit the xAI website at https://x.ai/ and sign up for an account if you don’t have one. For X platform access, go to https://developer.x.com/.
•Log in and navigate to the API section (e.g., xAI developer portal or X Developer Platform) to request API access.
•Generate an API key through the developer dashboard, name it for reference, and copy the key. Store it securely, as it will not be shown again.
•Use the AIX.SetKey command in your MRL script to configure the key.
Using the AIX system with the Grok AI model or X platform API incurs costs based on usage. As of March 18, 2025, pricing details are not fully standardized across all xAI services, but approximate costs (per 1 million tokens or equivalent) include:
•Grok (base model): Estimated $1.00-$5.00 (input), $3.00-$15.00 (output) - Varies by context length and features (e.g., 8K or 128K context).
•X API (standard usage): $0.10-$1.00 per 1,000 requests, depending on endpoint and rate limits.
Exact pricing for Grok and X API usage may vary based on the specific model, features, and subscription tier. Check the xAI Pricing Page or X Developer Rate Limits for the latest details and to monitor your usage. A free tier or trial may be available for initial testing.
The following commands are included:
•AIX.SetKey - Set the API key for using Grok API.
•AIX.GetKey - Retrieve the current API key.
•AIX.SaveKey - Save the API key for future use.
•AIX.GetFolder - Retrieve the current folder path.
•AIX.SetFolder - Set the folder path for operations.
•AIX.SetModel - Set the AI model to be used.
•AIX.GetModel - Retrieve the current AI model.
•AIX.SetEndpoint - Set the API endpoint URL.
•AIX.GetEndpoint - Retrieve the current API endpoint URL.
•AIX.SetTemperature - Set the temperature parameter for response randomness.
•AIX.GetTemperature - Retrieve the current temperature setting.
•AIX.SetMaxToken - Set the maximum token limit for responses.
•AIX.GetMaxToken - Retrieve the current maximum token limit.
•AIX.SetTopP - Set the Top-p (nucleus sampling) value.
•AIX.GetTopP - Retrieve the current Top-p value.
•AIX.SetStream - Set the streaming mode for responses.
•AIX.GetStream - Retrieve the current streaming mode setting.
•AIX.SetStop - Set the stop sequence for response generation.
•AIX.GetStop - Retrieve the current stop sequence.
•AIX.SetPresencePenalty - Set the presence penalty to reduce repetition.
•AIX.GetPresencePenalty - Retrieve the current presence penalty value.
•AIX.SetFrequencyPenalty - Set the frequency penalty to control word repetition.
•AIX.GetFrequencyPenalty - Retrieve the current frequency penalty value.
•AIX.SetTools - Set the tools available for the AI to use.
•AIX.GetTools - Retrieve the current tools configuration.
•AIX.SetToolChoice - Set the preferred tool choice for the AI.
•AIX.GetToolChoice - Retrieve the current tool choice setting.
•AIX.SetResponseFormat - Set the format for AI responses (e.g., text, JSON).
•AIX.GetResponseFormat - Retrieve the current response format.
•AIX.SetSeed - Set the seed value for reproducible responses.
•AIX.GetSeed - Retrieve the current seed value.
•AIX.SetUser - Set the user identifier for the session.
•AIX.GetUser - Retrieve the current user identifier.
•AIX.SetClipboardOutput - Set whether output is copied to the clipboard.
•AIX.GetClipboardOutput - Retrieve the current clipboard output setting.
•AIX.Ask - Ask a text-based question to the AI.
•AIX.AskVision - Ask a vision-based question with an image.
•AIX.GetContent - Retrieve the content of the AI’s response.
•AIX.GetWordCount - Retrieve the word count of the AI’s response.
•AIX.GetFinishReason - Retrieve the reason the AI stopped generating.
•AIX.GetTotalTokens - Retrieve the total token count used in the response.
•AIX.GetIsFunctionCall - Check if the response involves a function call.