Google makes it easier for developers to switch to Gemini from OpenAI

OpenAI leads the Generative AI industry in both consumer and developer spheres, thanks to ChatGPT and its GPT series models. Google has been steadily improving its Gemini models over the past few months to challenge OpenAI"s dominance. Today, Google announced that developers can now access the latest Gemini models in Google AI Studio via the OpenAI Library and REST API.

By making Gemini compatible with OpenAI"s libraries for Python, TypeScript/JavaScript, and REST, developers can simply update three lines of code, use their Gemini API key, and start using the latest Gemini models. Recently, Elon Musk"s xAI also announced that its APIs are compatible with OpenAI"s libraries for Python and REST. This trend indicates that OpenAI has become a standard among AI developers, and other companies are trying to attract them with an easy migration path.

xAI"s API is live! - try it out @ https://t.co/BZD8ZyOTTY
* 128k token context
* Function calling support
* Custom system prompt support
* Compatible with OpenAI & Anthropic SDKs
* $25/mo in free credits till EOYhttps://t.co/CCQAry6d5w https://t.co/MEEU2wkstS

— xAI (@xai) November 4, 2024

A few months ago, Google released similar OpenAI library support for its Vertex AI offerings. Developers can use the API to switch between calling OpenAI models and Vertex AI-hosted models to compare output, cost, and scalability without changing their existing code. Google recommends that developers call the Gemini API directly if they aren"t already using the OpenAI libraries.

Initially, Google is supporting the Chat Completions API, Function Calling, and Embeddings API. Image upload using a URL/Base64 and Structured Output API support are coming soon. Google has plans for additional compatibility in the coming months. OpenAI compatibility will make it easier for developers to get started with Gemini. Developers can learn more about Gemini"s OpenAI compatibility at Google"s official developer documentation portal.

Report a problem with article
Next Article

Samsung seems to be quite serious about a tri-folding phone

Previous Article

Google Maps now lets you upgrade to a new vehicle, at least virtually