Answer: Set the OPENAI_API_BASE environment variable to your endpoint and OPENAI_API_KEY to your key, then run aider with the model name prefixed by openai/. Status: Confirmed Entry: tool/aider/integrations/configure-openai-compatible-endpoint Revision: 1 Digest: sha256:80bec62f5e5caf9f (changes whenever the content changes) Timeline: Created: 2026-11-13T02:56:29Z Last changed: 2026-11-13T02:56:29Z Last verified: 2026-11-20T11:43:11Z Next check: 2026-11-21T11:43:11Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of endpoint variable | OPENAI_API_BASE | [1] | 2026-11-20 API key variable | OPENAI_API_KEY | [1] | 2026-11-20 model prefix | openai/ | [1] | 2026-11-20 run command | aider --model openai/ | [1] | 2026-11-20 Sources: [1] Aider. "aider.chat/docs/llms/openai-compat.html". https://aider.chat/docs/llms/openai-compat.html Role: primary. Accessed: 2026-11-20T11:43:11Z Quote: "export OPENAI_API_BASE=" (Supports: endpoint variable) Quote: "export OPENAI_API_KEY=" (Supports: API key variable) Quote: "Prefix the model name with openai/" (Supports: model prefix) Quote: "aider --model openai/" (Supports: run command) Published: 2026-04-25T16:45:23Z Snapshot SHA-256: 351f7e09c6875be8f521ee3a7b329d22609c42703def9703421c46a4c1f323d3 (captured 2026-11-13T02:56:29Z) 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:29Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T11:43:11Z. No independent second source is configured for this entry Last successful check: 2026-11-20T11:43:11Z Last attempt: 2026-11-20T11:43:11Z Notes and limitations: Extracted automatically from a single official source (section "OpenAI compatible APIs"). Related: https://latestn.com/tool/aider/integrations/configure-openrouter How do I configure Aider to use OpenRouter? https://latestn.com/tool/aider/integrations/connect-deepseek-api How do I connect Aider to the DeepSeek API? https://latestn.com/tool/aider/integrations/connect-lm-studio How do I connect Aider to a model served by LM Studio? https://latestn.com/tool/aider/install-and-setup/setup-gemini How do I set up Aider to use Gemini models? https://latestn.com/tool/aider/install-and-setup/setup-xai-api-key How do I set up Aider to use xAI models like Grok 3? 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/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T02:56:29Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/aider/integrations/configure-openai-compatible-endpoint/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/integrations/configure-openai-compatible-endpoint POST: https://latestn.com/dispute/tool/aider/integrations/configure-openai-compatible-endpoint with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/aider/integrations/configure-openai-compatible-endpoint?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I configure Aider to use a local or self-hosted OpenAI-compatible endpoint? Revision 1, last verified 2026-11-20T11:43:11Z. https://latestn.com/tool/aider/integrations/configure-openai-compatible-endpoint (accessed 2026-11-21T09:58:30Z). @misc{LatestN_tool_aider_integrations_configure_openai_compatible_endpoint_r1, title = {How do I configure Aider to use a local or self-hosted OpenAI-compatible endpoint?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/aider/integrations/configure-openai-compatible-endpoint}}, note = {Revision 1; digest sha256:80bec62f5e5caf9f; last verified 2026-11-20T11:43:11Z; accessed 2026-11-21T09:58:30Z} } 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/integrations/configure-openai-compatible-endpoint