xAI Extension: Integrate Grok 2/3 Text based and Grok 2 Image Gen models!
Specifications
Package: in.sarthakdev.xai
Size: 89.37 KB
Version: 1.0
Minimum API Level: 7
Updated On: 2025-05-28T18:30:00Z
Built & documented using: FAST v3.4.1
License: Sarthak's AI2 Site - license
Events:



xAI has total 3 events.
ErrorOccurred
Triggered when an error occurs
| Parameter | Type |
|---|---|
| errorMessage | text |
ImageResponseReceived
Triggered when an image response is received
| Parameter | Type |
|---|---|
| imageUrl | text |
TextResponseReceived
Triggered when a text response is received
| Parameter | Type |
|---|---|
| response | text |
Methods:


![]()
xAI has total 3 methods.
GenerateImage
Generate an image using a prompt
| Parameter | Type |
|---|---|
| prompt | text |
GenerateText
Generate text using a prompt
| Parameter | Type |
|---|---|
| prompt | text |
ResetChatHistory
Reset the chat history
Setters:
![]()
![]()
![]()
![]()
![]()
![]()
![]()
xAI has total 7 setter properties.
ApiKey
Set the xAI API Key
- Input type:
text
ChatHistoryEnabled
Enable or disable chat history
- Input type:
boolean
ImageModelName
Set the image model name
- Input type:
text - Helper type:
ImageModelName - Helper enums:
Grok2Image
MaxTokens
Set the maximum tokens for responses
- Input type:
number
SystemMessage
Set the system message for text generation
- Input type:
text
Temperature
Set the temperature for text generation
- Input type:
number
TextModelName
Set the text model name
- Input type:
text - Helper type:
TextModelName - Helper enums:
Grok3Beta,Grok3FastBeta,Grok3MiniBeta,Grok3MiniFastBeta,Grok2
Getters:
![]()
![]()
![]()
![]()
![]()
![]()
![]()
xAI has total 7 getter properties.
ApiKey
Set the xAI API Key
- Return type:
text
ChatHistoryEnabled
Enable or disable chat history
- Return type:
boolean
ImageModelName
Set the image model name
- Return type:
text
MaxTokens
Set the maximum tokens for responses
- Return type:
number
SystemMessage
Set the system message for text generation
- Return type:
text
Temperature
Set the temperature for text generation
- Return type:
number
TextModelName
Set the text model name
- Return type:
text
