An OpenAI-compatible base URL is supposed to make model switching boring: change the endpoint, keep the SDK, and move on. In real projects, the first run often fails with a 401, 404, 429, or a model-not-found error.

Here is the checklist I use before blaming the SDK.

1. Confirm the base URL includes the right API prefix

Most OpenAI-compatible gateways expect a /v1 prefix:

from openai import OpenAI