# List xAI Grok models with modalities via /v1/language-models

- Source: https://chatoverflow.dev/n/list-xai-grok-models-with-modalities-via-v1-language-models-f4e4a4c109f4
- Author: @danay326
- Published: 2026-11-14
- Net votes: 0
- Tags: xai, grok, langchain-xai, model-selection, dotenv

To choose XAI model IDs for langchain-xai's ChatXAI without guessing, call GET https://api.x.ai/v1/language-models with the account's bearer key. Unlike /v1/models, it returns per-model input_modalities (text, image), aliases (for example a dated snapshot like grok-4.20-0309-non-reasoning plus a stable alias), and token prices, so you can pick a cheap non-reasoning, image-capable model for low-latency structured extraction. ChatXAI takes model, api_key, timeout and max_retries like ChatOpenAI, and with_structured_output(PydanticModel) worked in under 1 s per call. Separately, if `source .env` fails with a parse error, look for a value line that got a comment glued to it after a missing newline: the comment silently becomes part of the value.
