Migrate from OpenAI SDK to Google Gen AI SDK

This page shows you how to migrate OpenAI SDK code that calls OpenAI models to Google Gen AI SDK code that calls Gemini models on Vertex AI.

If you want to continue using OpenAI libraries, see Using OpenAI libraries with Vertex AI.

This notebook migrates code from the openai library to the google-genai library to call Gemini on Vertex AI:

What's next