Answer: Install aider with pip and aider-install, set your XAI_API_KEY, then run aider with a model flag such as --model xai/grok-3-beta for Grok 3. Other options include xai/grok-3-fast-beta, xai/grok-3-mini-beta, and xai/grok-3-mini-fast-beta. Status: Confirmed Entry: tool/aider/install-and-setup/setup-xai-api-key Revision: 1 Digest: sha256:739ca50077ac4fe0 (changes whenever the content changes) Timeline: Created: 2026-11-13T02:56:33Z Last changed: 2026-11-13T02:56:33Z Last verified: 2026-11-20T11:43:22Z Next check: 2026-11-21T11:43:22Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Grok 3 model flag | xai/grok-3-beta | [1] | 2026-11-20 API key env var | XAI_API_KEY | [1] | 2026-11-20 Install command | python -m pip install aider-install | [1] | 2026-11-20 Grok 3 fast model flag | xai/grok-3-fast-beta | [1] | 2026-11-20 Grok 3 Mini model flag | xai/grok-3-mini-beta | [1] | 2026-11-20 Grok 3 Mini fast model flag | xai/grok-3-mini-fast-beta | [1] | 2026-11-20 List models command | aider --list-models xai/ | [1] | 2026-11-20 Sources: [1] Aider. "aider.chat/docs/llms/xai.html". https://aider.chat/docs/llms/xai.html Role: primary. Accessed: 2026-11-20T11:43:22Z Quote: "aider --model xai/grok-3-beta" (Supports: Grok 3 model flag) Quote: "export XAI_API_KEY = " (Supports: API key env var) Quote: "python -m pip install aider-install" (Supports: Install command) Quote: "aider --model xai/grok-3-fast-beta" (Supports: Grok 3 fast model flag) Quote: "aider --model xai/grok-3-mini-beta" (Supports: Grok 3 Mini model flag) Quote: "aider --model xai/grok-3-mini-fast-beta" (Supports: Grok 3 Mini fast model flag) Quote: "aider --list-models xai/" (Supports: List models command) Published: 2026-04-25T16:45:23Z Snapshot SHA-256: 895a80554cd85ec839833ab5bc4842a0361d5f1a0a196103bec25e9d77bc06fe (captured 2026-11-13T02:56:33Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T02:56:33Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T11:43:22Z. No independent second source is configured for this entry Last successful check: 2026-11-20T11:43:22Z Last attempt: 2026-11-20T11:43:22Z Notes and limitations: Extracted automatically from a single official source (section "xAI"). Related: https://latestn.com/tool/aider/install-and-setup/vertex-ai-prerequisites What do I need to install and log in with before using Vertex AI in Aider? https://latestn.com/tool/aider/integrations/configure-openai-compatible-endpoint How do I configure Aider to use a local or self-hosted OpenAI-compatible endpoint? https://latestn.com/tool/aider/integrations/configure-openrouter How do I configure Aider to use OpenRouter? https://latestn.com/tool/aider/install-and-setup/set-openai-api-key How do I set the OPENAI_API_KEY before running Aider in the browser? https://latestn.com/tool/aider/install-and-setup/setup-api-key How do I set up an API key for Aider? https://latestn.com/tool/aider/install-and-setup/setup-gemini How do I set up Aider to use Gemini models? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T02:56:33Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/aider/install-and-setup/setup-xai-api-key/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/aider/install-and-setup/setup-xai-api-key POST: https://latestn.com/dispute/tool/aider/install-and-setup/setup-xai-api-key with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/aider/install-and-setup/setup-xai-api-key?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I set up Aider to use xAI models like Grok 3? Revision 1, last verified 2026-11-20T11:43:22Z. https://latestn.com/tool/aider/install-and-setup/setup-xai-api-key (accessed 2026-11-21T09:57:29Z). @misc{LatestN_tool_aider_install_and_setup_setup_xai_api_key_r1, title = {How do I set up Aider to use xAI models like Grok 3?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/aider/install-and-setup/setup-xai-api-key}}, note = {Revision 1; digest sha256:739ca50077ac4fe0; last verified 2026-11-20T11:43:22Z; accessed 2026-11-21T09:57:29Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/aider/install-and-setup/setup-xai-api-key