iTranslated by AI
Let's Try Calling Gemini and Claude from Vertex AI!
Are you familiar with Vertex AI? Vertex AI is Google's generative AI service, but Google actually has two generative AI services:
- Gemini Developer API
- Vertex AI Gemini API
These two services have different roles. Roughly speaking, Gemini Developer is for easy development, while Vertex AI is for serious product use.
Actually, when using them, Vertex AI has more hassle in terms of code, authentication, and various settings, but it offers overwhelmingly more capabilities, so if you want to really develop, go with Vertex AI!
Vertex AI supports not only Google's models but also partner models and open models!
It supports models from Anthropic, Meta, Mistral, etc. (OpenAI only has gpt-oss).
It's called MaaS (Model as a Service).
-
Gemini Series (Google's official Generative AI on Vertex AI)
This is a managed API. You just specify the model name (e.g.,gemini-2.5-pro) and hit the endpoint directly. No need to create an endpoint or deploy, and it's pay-as-you-go. -
Publisher/Partner Models partially (Claude, etc.)
Something likepublishers/anthropic/models/claude-3-5-sonnet. Many of these can be requested directly from the Publisher Model Endpoint. However, in some cases, you need to "enable, agree to EULA, and apply for quota" before use. It's pay-as-you-go. -
Self-deployed Models (Many Model Garden open models)
Llama series, Gemma open version, etc., appear in Model Garden as a catalog but cannot be used via the API directly. You need to "deploy and create an endpoint" in your own Vertex AI project. Billing is not per token but mainly for the assigned machine resources (including GPU/TPU).
You can check supported models on GCP's Vertex AI / Model Garden.
With Vertex AI, billing goes through GCP, so it's convenient for companies that want to use various models but don't want to set up billing with each provider.
GCP Project Creation
To use Vertex AI, you need to create a project in GCP (Google Cloud Project) and link a credit card. By the way, if you link for the first time, you get a free credit of $300 for 3 months! That's generous, isn't it?
There are many articles explaining how to create a GCP project, so please refer to them.
Authentication Setup
When using Vertex AI services, instead of an API key, you use a service account or ADC (Application Default Credentials)! This is quite different from other services.
Roughly speaking, a service account is a virtual account that runs the program, while ADC is like your own credentials. The idea is to use a service account when using services in the cloud, and ADC for local development.
For details, please refer to the official documentation and explanatory articles.
This time, since we are developing in a local environment, we will set up ADC!
To set up ADC, install the gcloud CLI and initialize it.
The method varies by OS, so please refer to the official documentation!
Once authentication is complete, the setup is done. Let's actually call the AI.
Don't forget to enable the Vertex API on GCP!
langchain-google-vertexai
You can use the Vertex AI library directly, but LangChain also supports Vertex AI! I've become accustomed to LangChain's way of building chains and handling conversation history, so I generally tend to use LangChain rather than each LLM provider's library.
from langchain_google_vertexai import ChatVertexAI
llm = ChatVertexAI(model="gemini-2.5-flash")
messages = [
("system","You are an excellent AI assistant."),
("human", "Hello, please introduce yourself"),
]
res = llm.invoke(messages)
print(res.content)
Hello! I'm glad to talk to you.
I am a large language model trained by Google.
I don't have a name, but as an "AI assistant," I strive every day to be helpful to all of you.
Specifically, I can do the following:
* **Answer questions**: Provide information on various topics.
* **Brainstorm ideas**: Act as a sounding board or offer new perspectives.
* **Write text**: I can help create various types of text, such as emails, articles, and poems.
* **Summarize/Translate**: Summarize long texts or translate between different languages.
* **Organize information**: Organize complex information and explain it in an easy-to-understand manner.
My role is to help solve your problems or assist you in creating something. Please feel free to ask me anything. I would be happy to support you with anything I can do!
Trying Claude
Vertex AI allows you to use partner models like Anthropic and Meta on a pay-as-you-go basis. However, you may need to enable the model and increase the quota in advance. Let's try using Claude!
Enable in Model Garden
Search for the model you want to use in Model Garden and enable it.

For Claude, when using the Claude model via Vertex AI, it seems approval from Anthropic is required, and you will be asked to input company information and use cases in a form. There doesn't seem to be an option for personal use, so approval might not be granted for non-corporate entities?

Check Quota
After enabling, the default quota is 0, so you need to submit a quota increase request.
In GCP, go to IAM & Admin → Quotas & System Limits.
Enter base_model:anthropic-claude-sonnet-4-5 and online_prediction_requests_per_base_model in the filter. As I have no particular preference for region, I chose Global.
Check the service you want to increase and click Edit.

Quota Increase Request

I'll try applying for around 60 QPM (queries per minute) for now.
It seems the quota increase request will be reviewed within 2 business days!
Once the increase request is approved, you can execute! Replace the model part mentioned earlier.
from langchain_google_vertexai import ChatVertexAI
llm = ChatVertexAI(model="claude-sonnet-4-5@20250929")
messages = [
("system","You are an excellent AI assistant."),
("human", "Hello, please introduce yourself"),
]
res = llm.invoke(messages)
print(res.content)
Conclusion
Vertex AI and the Gemini Developer API have a clear division: "Gemini Developer for easy trials, Vertex AI for serious product or internal system deployment." Especially for companies that want to consolidate billing through GCP or use models from multiple vendors through a common framework, Vertex AI is a very convenient option. In this article, I've roughly introduced the preparation of a GCP project, authentication settings (service account / ADC), using Gemini via LangChain, enabling Claude through Model Garden, and applying for quotas. Once you've done this, you can integrate it into the "usual GCP world" such as RAG configurations, internal chatbots, or deployment to Cloud Run. I hope this helps as a first step for those who "don't understand the difference between Gemini Developer and Vertex AI" or "are not sure how to use models in Model Garden."
Discussion