Skip to content
IFAI

AI models

Google brings Gemini to the OpenAI SDK

Published Reach 51

Google just added native compatibility for Gemini models directly inside the OpenAI Library and REST API. Developers can now switch to Gemini using Chat Completions and Embeddings endpoints without rewriting code—simply point the base URL to Google and plug in a Gemini API key.

Google brings Gemini to the OpenAI SDK
Image: developers.googleblog.com

Migrating between AI providers usually feels like moving apartments: nobody wants to rewrite their API calls, debug fresh schemas, or swap out perfectly working client libraries.

Google just decided to eliminate that friction entirely. The tech giant announced that its latest Gemini models are now officially accessible through OpenAI's official libraries and REST API.

Swap a URL, keep your code

If you already use the standard OpenAI Python or Node.js packages, you do not need to install anything new. The workflow remains identical to what you are already running in production.

All you have to do is point the base_url parameter to Google's generative language endpoint, drop in a Gemini API key, and specify a model like gemini-1.5-flash. Your chat completions code stays exactly as it was written.

The same applies to direct REST calls over curl. Google maps OpenAI's chat completions endpoint directly to Gemini's backend under the hood.

Chat and embeddings are live today

According to Google, the initial release supports the Chat Completions API and Embeddings API. The company plans to roll out broader compatibility across additional features over the coming weeks and months.

The support is not limited to indie hackers. Google confirmed that Vertex AI enterprise customers also have access to this OpenAI-compatible layer right away.

Interestingly, Google also added a practical note: if your codebase is not already tied to OpenAI's libraries, you are still better off calling the native Gemini API directly to get the cleanest experience.

Why it matters

We think this is a brilliant, ego-free move by Google that directly targets OpenAI's developer base.

Over the past two years, OpenAI's API design quietly became the unofficial HTTP standard of the generative AI era. Every major framework, wrapper, and developer tool speaks OpenAI syntax by default. By stubbornly sticking to its own proprietary SDK, Google was giving developers a very convenient excuse never to test Gemini.

Now, switching to Gemini is literally a one-line config change. If you are building an AI product, you can instantly test whether gemini-1.5-flash delivers better latency or cost efficiency without touching your application logic. It makes Gemini an effortless fallback or primary model for existing setups.

The tradeoff is obvious: Google is essentially admitting that OpenAI won the developer mindshare race for API standards. Wrapping yourself in an opponent's interface also means unique native features might take longer to expose.

Still, lowering switching costs to zero is the most aggressive way to win developers over. If you have an OpenAI-powered pipeline running right now, it is absolutely worth swapping the endpoint just to see what Gemini can do for your margins.

Sources (1)

  1. [1]
    developers.googleblog.com(opens in a new tab)Originaldevelopers.googleblog.com

Best of AI, daily