Answer: Install aider, then configure your API key and endpoint using OPENAI_API_BASE and OPENAI_API_KEY environment variables, and run aider with the model name prefixed by openai/. Status: Confirmed Entry: tool/aider/models/connect-openai-compatible-api Revision: 1 Digest: sha256:9dee0c878b132dfe (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:10Z Next check: 2026-11-21T11:43:10Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of install command | python -m pip install aider-install | [1] | 2026-11-20 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:10Z Quote: "python -m pip install aider-install" (Supports: install command) 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:10Z. No independent second source is configured for this entry Last successful check: 2026-11-20T11:43:10Z Last attempt: 2026-11-20T11:43:10Z Notes and limitations: Extracted automatically from a single official source (section "OpenAI compatible APIs"). Related: https://latestn.com/tool/aider/models/context-window-size-token-costs How do I set the context window size and token costs for an Aider model? https://latestn.com/tool/aider/models/contribute-benchmark-results How can I contribute benchmark results to Aider's code editing leaderboard? https://latestn.com/tool/aider/models/contribute-model-metadata How do I contribute model metadata to Aider? https://latestn.com/tool/aider/models/connect-aider-to-openai How do I connect Aider to OpenAI models? https://latestn.com/tool/aider/models/connect-aider-to-openrouter How do I connect Aider to OpenRouter? https://latestn.com/tool/aider/models/connect-local-models How do I connect Aider to a local model? 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/models/connect-openai-compatible-api/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/models/connect-openai-compatible-api POST: https://latestn.com/dispute/tool/aider/models/connect-openai-compatible-api with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/aider/models/connect-openai-compatible-api?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I connect Aider to an OpenAI-compatible API? Revision 1, last verified 2026-11-20T11:43:10Z. https://latestn.com/tool/aider/models/connect-openai-compatible-api (accessed 2026-11-21T09:54:24Z). @misc{LatestN_tool_aider_models_connect_openai_compatible_api_r1, title = {How do I connect Aider to an OpenAI-compatible API?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/aider/models/connect-openai-compatible-api}}, note = {Revision 1; digest sha256:9dee0c878b132dfe; last verified 2026-11-20T11:43:10Z; accessed 2026-11-21T09:54:24Z} } 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/models/connect-openai-compatible-api