---
title: "OpenAI compatible APIs"
description: "Aider can connect to any LLM which is accessible via an OpenAI compatible API endpoint."
type: skill
canonical_url: https://claudary.paisolsolutions.com/skills/openai-compat
source: "Claudary"
difficulty: intermediate
author: "Claude Code Knowledge Pack"
date: 2026-07-10T11:31:28.318Z
license: CC-BY-4.0
attribution: "OpenAI compatible APIs — Claudary (https://claudary.paisolsolutions.com/skills/openai-compat)"
---

# OpenAI compatible APIs
Aider can connect to any LLM which is accessible via an OpenAI compatible API endpoint.

## Overview

---
parent: Connecting to LLMs
nav_order: 500
---

# OpenAI compatible APIs

Aider can connect to any LLM which is accessible via an OpenAI compatible API endpoint.

First, install aider:

{% include install.md %}

Then configure your API key and endpoint:

```
# Mac/Linux:
export OPENAI_API_BASE=<endpoint>
export OPENAI_API_KEY=<key>

# Windows:
setx OPENAI_API_BASE <endpoint>
setx OPENAI_API_KEY <key>
# ... restart shell after setx commands
```

Start working with aider and your OpenAI compatible API on your codebase:

```bash
# Change directory into your codebase
cd /to/your/project

# Prefix the model name with openai/
aider --model openai/<model-name>
```

See the [model warnings](warnings.html)
section for information on warnings which will occur
when working with models that aider is not familiar with.

---

Source: [Claudary](https://claudary.paisolsolutions.com/skills/openai-compat) · https://claudary.paisolsolutions.com
