# Python package for Gemini API: google-cloud-aiplatform or vertexai?

**URL:** <https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688>\
**Category:** Gemini API\
**Tags:** api\
**Created:** [May 13, 2024, 4:03am UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688 "2024-05-13T04:03:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Will](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/will/32/125_2.png) [@Will](https://discuss.ai.google.dev/u/Will)\
**Post date:** [May 13, 2024, 4:03am UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688/1 "2024-05-13T04:03:42Z")

</div>

May I ask, when using Python to call the **Vertex AI Generative API** , should I use the `google-cloud-aiplatform` package, or should I install the `vertexai` package? I really confused. These two look similar, and I can’t tell which one I need to install.

---

<div class="post-metadata">

**Author:** ![sps](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/sps/32/143_2.png) [@sps](https://discuss.ai.google.dev/u/sps)\
**Post date:** [May 13, 2024, 4:50am UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688/2 "2024-05-13T04:50:41Z")

</div>

Welcome @Will

This should help: [Создавайте с помощью Gemini в Google Cloud &nbsp;|&nbsp; Gemini API &nbsp;|&nbsp; Google for Developers](https://ai.google.dev/gemini-api/docs/migrate-to-cloud)

---

<div class="post-metadata">

**Author:** ![Will](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/will/32/125_2.png) [@Will](https://discuss.ai.google.dev/u/Will)\
**Post date:** [May 13, 2024, 5:58am UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688/3 "2024-05-13T05:58:21Z")

</div>

Thank you.

So both `google-cloud-aiplatform` and `vertexai` package contains `vertexai` module, right? Isn’t it confusing?

---

<div class="post-metadata">

**Author:** ![Will](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/will/32/125_2.png) [@Will](https://discuss.ai.google.dev/u/Will)\
**Post date:** [May 13, 2024, 7:19am UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688/4 "2024-05-13T07:19:26Z")

</div>

Thanks.

Does the `vertexai` package contains all modules in the `google-cloud-aiplatform` package have?

---

<div class="post-metadata">

**Author:** ![N2U](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/n2u/32/176_2.png) [@N2U](https://discuss.ai.google.dev/u/N2U)\
**Post date:** [May 13, 2024, 8:51am UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688/7 "2024-05-13T08:51:45Z")

</div>

You can access Gemini though both packages, but if you’re in a restricted area, like the EU, then you will have to use the Vertex AI package ❤

---

<div class="post-metadata">

**Author:** ![Will](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/will/32/125_2.png) [@Will](https://discuss.ai.google.dev/u/Will)\
**Post date:** [May 13, 2024, 3:58pm UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688/8 "2024-05-13T15:58:49Z")

</div>

Where did you get these information? 🙂

---

<div class="post-metadata">

**Author:** ![N2U](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/n2u/32/176_2.png) [@N2U](https://discuss.ai.google.dev/u/N2U)\
**Post date:** [May 13, 2024, 6:36pm UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688/9 "2024-05-13T18:36:43Z")

</div>

If you try to access [Google AI studio](https://aistudio.google.com/) from a restricted region, you’ll be redirected to this information 😆

If you can access that page, you can also use the `google-cloud-aiplatform` package.

---

<div class="post-metadata">

**Author:** ![SamRahimi](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/samrahimi/32/1775_2.png) [@SamRahimi](https://discuss.ai.google.dev/u/SamRahimi)\
**Post date:** [May 17, 2024, 9:54pm UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688/10 "2024-05-17T21:54:11Z")

</div>

Are the node.js and python libraries for calling Gemini via vertex AI compatible with the Google AI Studio version?

Specifically: I have been building an app that interacts with Gemini using vertex AI, but I am not sure if I want to keep the associated Google cloud account active after my trial runs out

So if I decide to switch to AI Studio, is it just a matter of importing different libraries and otherwise my code should run unmodified? Or will I have to rewrite everything?

---

<div class="post-metadata">

**Author:** ![Macha](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/macha/32/179_2.png) [@Macha](https://discuss.ai.google.dev/u/Macha)\
**Post date:** [May 17, 2024, 9:59pm UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688/11 "2024-05-17T21:59:49Z")

</div>

Welcome to the forum!

So, afaik, you still need a google cloud account in order to generate API keys via Google AI studio, so I would not recommend deactivating the google cloud account.

---

<div class="post-metadata">

**Author:** ![OrangiaNebula](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/orangianebula/32/480_2.png) [@OrangiaNebula](https://discuss.ai.google.dev/u/OrangiaNebula)\
**Post date:** [May 17, 2024, 10:00pm UTC](https://discuss.ai.google.dev/t/python-package-for-gemini-api-google-cloud-aiplatform-or-vertexai/1688/12 "2024-05-17T22:00:42Z")

</div>

Welcome to the forum. The API is basically identical, you just change an import here and there. However: Vertex has many convenient features (helpers) that you will not find in the AI Studio endpoint. If you plan your migration, you can easily built the helpers yourself.  
If you don’t plan it, when you cut over different things that used to work, won’t.
