Learn AI Math

OpenAI-Compatible API

What is OpenAI-Compatible API?

In one sentence: An OpenAI-compatible API is an API that copies the request and response format of OpenAI's API, so the same code works with different providers.

Many tools, like vLLM, Ollama and various hosting services, offer this format. You can often switch providers by changing just the web address and key.

What does OpenAI-Compatible API look like?

Pointing an app's base URL at a local Ollama server instead of a cloud service, with no other code changes.

Why does OpenAI-Compatible API matter?

It reduces lock-in and makes switching models easy.

Last updated · Fact-checked by The AI Math

Linking to this page from a lesson or article?

Like this explanation? Get one every week.

The AI Math newsletter turns confusing AI news into plain English. No hype, no jargon walls.