The xAI model provides access to xAI’s language models.
ParameterTypeDefaultDescription
idstr"grok-3"The specific model ID used for generating responses.
namestr"xAI"The name identifier for the xAI agent.
providerstr"xAI"The provider of the model, combining "xAI" with the model ID.
api_keyOptional[str]NoneThe API key for authenticating requests to the xAI service. Retrieved from the environment variable XAI_API_KEY.
base_urlstr"https://api.x.ai/v1"The base URL for making API requests to the xAI service.
search_parametersOptional[Dict[str, Any]]NoneParameters for enabling live search capabilities. Supports mode, max_search_results, and return_citations.