gRPC API
Models
xai_api.Models
An API service that let users get details of available models on the platform.
Methods: xai_api.Models
ListLanguageModelsunaryLists all language models available to your team (based on the API key).
ListEmbeddingModelsunaryLists all embedding models available to your team (based on the API key).
ListImageGenerationModelsunaryLists all image generation models available to your team (based on the API key).
GetLanguageModelunaryGet details of a specific language model by model name.
GetEmbeddingModelunaryGet details of a specific embedding model by model name.
GetImageGenerationModelunaryGet details of a specific image generation model by model name.
List available models
import os
import xai_sdk
client = xai_sdk.Client(api_key=os.getenv("XAI_API_KEY"))
# List language models
for model in client.models.list_language_models():
print(f"{model.name} (aliases: {', '.join(model.aliases)})")
# List image generation models
for model in client.models.list_image_generation_models():
print(f"{model.name}")
Last updated:September 2, 2026