A Comprehensive Guide to Interacting
with the Gemini API via the Linux
Command Line Using curl
Part I: Foundational Concepts and Setup
1.1 Introduction to the Gemini REST API with curl
The Google Gemini family of models represents a significant advancement in generative
artificial intelligence, offering a suite of capabilities ranging from sophisticated reasoning to
multimodal understanding.1 At its core, the Gemini API is a RESTful service, which makes it
universally accessible from any environment capable of making HTTP requests.3 This
document provides a definitive guide for interacting with the Gemini API directly from the
Linux command line using curl, the ubiquitous tool for data transfer.
While Google provides official Software Development Kits (SDKs) for various programming
languages, direct interaction via curl offers unparalleled flexibility and control. It is an essential
skill for developers engaged in shell scripting, automation, serverless environments, or any
scenario where integrating a full SDK is either impractical or unnecessary. This guide will cover
the complete feature set of the API, providing detailed explanations and practical,
command-line examples.
1.2 Critical Distinction: Google AI vs. Vertex AI Endpoints
Before making any API calls, it is crucial to understand that Google offers two distinct
platforms for accessing Gemini models, each with its own endpoint, authentication
mechanism, and intended use case. The choice between these platforms is the first and most
important decision a developer must make, as it fundamentally dictates the structure of every
curl request.
● Google AI (Developer API): This platform is designed for rapid prototyping and
developer-centric applications. It is accessed through Google AI Studio and is
characterized by a simple, API-key-based authentication system.5 The base URL for all
requests to this service is [Link] This path provides
a low-friction entry point for individual developers and smaller projects.
● Vertex AI (Enterprise API): This is Google's enterprise-grade, fully managed AI platform.
It integrates Gemini into the broader Google Cloud ecosystem, offering robust security,
governance, and MLOps capabilities.2 Endpoints for Vertex AI are region-specific and
follow the pattern [Link] This platform is
intended for production-scale, enterprise applications that require integration with
Google Cloud Identity and Access Management (IAM) and other cloud services.
This bifurcation is a deliberate product strategy. The Google AI API serves to foster a broad
developer community with an accessible on-ramp, while the Vertex AI API caters to enterprise
clients who require the scalability, security, and operational controls of a major cloud platform.
Scripts and tools built for one platform are not directly portable to the other due to these
fundamental differences in authentication and endpoint structure.
1.3 Authentication: Your Gateway to the API
Access to the Gemini API is secured through one of two methods, corresponding directly to
the platform being used.
Method 1: Google AI Studio API Key
For the developer-focused Google AI platform, authentication is handled via a simple API key.
1. Obtain an API Key: Generate a new API key from the Google AI Studio dashboard. This
involves creating or selecting a Google Cloud project to associate with the key.5
2. Set Environment Variable: For security and convenience, it is best practice to store this
key in a shell environment variable rather than hardcoding it into scripts. Add the
following line to your shell's configuration file (e.g., ~/.bashrc or ~/.zshrc).11
Bash
export GEMINI_API_KEY="YOUR_API_KEY_HERE"
Remember to reload your shell configuration (source ~/.bashrc) or open a new terminal
session for the change to take effect.
3. Use in curl: The API key is passed in the x-goog-api-key HTTP header.1
Bash
-H "x-goog-api-key: $GEMINI_API_KEY"
Method 2: Vertex AI Bearer Token (gcloud)
For the enterprise-grade Vertex AI platform, authentication relies on short-lived OAuth 2.0
access tokens generated by the Google Cloud CLI.
1. Prerequisites: Ensure you have a Google Cloud project with billing and the Vertex AI API
enabled. You must also have the gcloud command-line tool installed and authenticated
(gcloud init and gcloud auth login).13
2. Generate Access Token: The gcloud tool can generate a temporary access token. The
command gcloud auth print-access-token will output a valid token to standard output.9
3. Use in curl: This token is passed in the standard Authorization header with the Bearer
scheme. The command can be embedded directly into the curl call to ensure a fresh
token is always used.9
Bash
-H "Authorization: Bearer $(gcloud auth print-access-token)"
This method is more secure for production environments as the tokens expire automatically,
reducing the risk associated with a compromised long-lived credential.
Table 1: API Platform and Authentication Comparison
Platform Typical Use Case Base URL curl Authentication
Header
Google AI Prototyping, [Link] -H
(Developer API) Individual [Link]. "x-goog-api-key:
Developers, Small com $GEMINI_API_KEY"
Apps
Vertex AI Production, [Link] -H "Authorization:
(Enterprise API) Enterprise, Google -[Link] Bearer $(gcloud
Cloud Integration [Link] auth
print-access-token
)"
1.4 The Anatomy of a Gemini curl Request
All interactions with the Gemini REST API via curl follow a consistent structure. Understanding
this structure provides a template that can be adapted for all the features discussed in this
guide.
A typical request consists of the following components:
● curl: The command-line tool.
● "URL": The full endpoint URL, which combines the base URL (from Table 1) with the
specific model and method being called.
● -X POST: The HTTP method, which is almost always POST for generative actions.1
● -H "Header: Value": HTTP headers. At a minimum, this includes the Content-Type:
application/json header and the appropriate authentication header.4
● -d '{...}': The request body, a JSON object containing the prompt (contents) and any
configuration parameters (generationConfig, safetySettings).12
This structure forms the foundation for all subsequent examples.
Part II: Core Content Generation Capabilities
2.1 Text Generation: The generateContent Endpoint
The most fundamental capability of the Gemini API is generating text from a text-based
prompt. This is accomplished using the generateContent method, which operates in a
synchronous request-response pattern.4
The request body requires a JSON object with a contents key. This key holds an array
containing a single content object. This object, in turn, has a parts array, which contains the
actual prompt text.4
Example: Google AI (API Key)
This example uses the gemini-2.5-flash model to answer a simple question.
Bash
curl "[Link] \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents": [{
"parts":[{
"text": "Explain the theory of relativity in a single sentence."
}]
}]
}'
Example: Vertex AI (Bearer Token)
This example performs the same task but targets the Vertex AI endpoint, requiring
environment variables for PROJECT_ID and LOCATION.
Bash
# Set environment variables first
# export PROJECT_ID="your-gcp-project-id"
# export LOCATION="us-central1"
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"[Link]
ublishers/google/models/gemini-2.5-flash:generateContent" \
-d '{
"contents": {
"parts": {
"text": "Explain the theory of relativity in a single sentence."
}
}
}'
Note the slight difference in the Vertex AI JSON payload, where contents can be a single
object instead of an array for single-turn requests.10
A successful response for either platform will be a JSON object containing a candidates array.
The generated text is located within the first element of this array at the path
[Link].4
2.2 Streaming Generation: The streamGenerateContent Endpoint
For interactive applications like chatbots, waiting for the full response to be generated can
introduce undesirable latency. The streamGenerateContent method addresses this by
streaming back the response in chunks as it is generated.4
To enable this functionality at the HTTP level, a specific query parameter, alt=sse (Server-Sent
Events), must be appended to the request URL. This parameter is a convention of Google's
REST APIs and is the key to activating the streaming behavior. Without it, the endpoint will
behave differently.16 When using curl, it is also advisable to include the --no-buffer flag to
ensure that the output is processed immediately as it is received.
Example: Google AI (API Key)
Bash
curl
"[Link]
lt=sse" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
--no-buffer \
-X POST \
-d '{
"contents":
}]
}'
The output will not be a single JSON object but a stream of data events. Each event is a
self-contained JSON object representing a GenerateContentResponse chunk. A client-side
script is responsible for parsing this stream and concatenating the text field from each chunk
to reconstruct the full response.4
2.3 Building Multi-Turn Conversations (Chat)
The Gemini API is inherently stateless, meaning each API call is independent and has no
memory of previous interactions. To create a conversational or chat-like experience, the client
application is responsible for maintaining the conversation history and sending it with every
new request.18
This is achieved by populating the contents array in the request body with multiple objects.
Each object represents a turn in the conversation and must include a role key, which can be
either "user" (for prompts from the user) or "model" (for previous responses from the AI). The
API uses this entire history as context for generating the next response.4
This design places the burden of state management entirely on the client. A shell script
implementing a chat feature must programmatically store the conversation history—for
instance, in a temporary file or a growing shell variable—and reconstruct the full JSON
payload for every turn.
Example: Google AI (API Key)
In this example, the contents array includes the initial user question and the model's first
answer, followed by the new user follow-up question.
Bash
curl "[Link] \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents":
},
{
"role": "model",
"parts":
},
{
"role": "user",
"parts": [{
"text": "How fast is that in miles per hour?"
}]
}
]
}'
The model will use the context of the first two turns to correctly answer the third.
Part III: Advanced Multimodal Interaction
3.1 Image Understanding: Combining Text and Images
Gemini models are natively multimodal, capable of processing and reasoning about both text
and images within a single prompt.20 The most direct way to provide image data in a curl
request is by embedding it directly into the JSON payload.
This is done using an inline_data object within a part. This object requires two keys:
mime_type (e.g., "image/jpeg") and data, which must contain the Base64-encoded string of
the image file.4 The total request size, including the encoded image and text, must not exceed
20MB.23
The following shell script provides a practical, reusable example. It takes a file path and a text
prompt as arguments, encodes the image using the base64 utility, and constructs and
executes the curl command. It also accounts for differences in the base64 command between
Linux (-w0) and macOS (-b 0).20
Example Script: [Link]
Bash
#!/bin/bash
# Usage:./[Link] <image_path> "<prompt>"
IMAGE_PATH=$1
PROMPT=$2
if]; then
echo "Usage: $0 <image_path> \"<prompt>\""
exit 1
fi
if]; then
echo "Error: File not found at $IMAGE_PATH"
exit 1
fi
# Determine MIME type
MIME_TYPE=$(file -b --mime-type "$IMAGE_PATH")
# Base64 encode the image, handling macOS/Linux differences
if]; then
BASE64_IMAGE=$(base64 -b 0 "$IMAGE_PATH")
else
BASE64_IMAGE=$(base64 -w 0 "$IMAGE_PATH")
fi
# Construct the JSON payload
JSON_PAYLOAD=$(cat <<EOF
{
"contents":
}]
}
EOF
)
# Make the API call
curl "[Link] \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-X POST \
-d "$JSON_PAYLOAD"
3.2 Native Image Generation with gemini-2.5-flash-image
The Gemini API also supports native image generation using the specialized
gemini-2.5-flash-image model.1 The request structure is similar to text generation, but the
endpoint must specify this particular model.
The model's response will contain the generated image as a Base64-encoded string within an
inline_data part. To view the image, this string must be extracted from the JSON response,
decoded, and saved to a file. The jq utility is invaluable for parsing the JSON on the command
line.
Example Script: [Link]
This script takes a text prompt, sends it to the image generation endpoint, and saves the
resulting image as [Link].
Bash
#!/bin/bash
# Usage:./[Link] "<prompt>"
PROMPT=$1
if]; then
echo "Usage: $0 \"<prompt>\""
exit 1
fi
# Construct the JSON payload
JSON_PAYLOAD=$(cat <<EOF
{
"contents":
}]
}
EOF
)
# Make the API call, parse the response with jq, and decode the base64 data
curl -s
"[Link] \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-X POST \
-d "$JSON_PAYLOAD" | jq -r '.[Link].inline_data.data' | base64 --decode >
[Link]
echo "Image saved to [Link]"
3.3 Interacting with Video and Audio Files
While small images can be sent inline, larger media files such as video and audio should be
referenced via a URI. The API supports this through the file_data part in the request body.4
This object contains a file_uri and a mime_type.
The most common and robust method, particularly within the Vertex AI ecosystem, is to use a
Google Cloud Storage (GCS) URI (e.g., gs://your-bucket/your-video.mp4).10 The file in the GCS
bucket must be accessible to the service account or user making the API request.
Example: Vertex AI with GCS Video File
Bash
# Set environment variables first
# export PROJECT_ID="your-gcp-project-id"
# export LOCATION="us-central1"
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"[Link]
ublishers/google/models/gemini-2.5-flash:generateContent" \
-d '{
"contents": {
"parts":
}
}'
Part IV: Specialized API Functions and Models
4.1 Generating Text Embeddings for Semantic Tasks
Text embeddings are numerical vector representations of text, crucial for tasks like semantic
search, clustering, and classification.25 The Gemini API provides a dedicated model,
gemini-embedding-001, for this purpose.26
Single Text Embedding
The embedContent method generates an embedding for a single piece of text.
Bash
curl
"[Link] \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"model": "models/gemini-embedding-001",
"content": {
"parts":
}
}'
The response contains an embedding object with a values array of floating-point numbers.
Batch Text Embeddings
For greater efficiency when processing multiple texts, the batchEmbedContents method
should be used. Its request body contains a requests array, where each element is a complete
request for a single embedding.25
Bash
curl
"[Link]
nts" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"requests":}
},
{
"model": "models/gemini-embedding-001",
"content": { "parts":[{"text": "How much wood would a woodchuck chuck?"}]}
}
]
}'
The response will contain an embeddings array with the vector for each request, in the same
order they were provided.
4.2 Implementing Function Calling for Tool Integration
Function calling is one of the most powerful features of the Gemini API, allowing the model to
interact with external tools and APIs. This transforms the model from a content generator into
a reasoning engine that can orchestrate complex workflows. The interaction is a multi-step
process that requires programmatic logic on the client side.28
Step 1: Define Tools and Make Initial Request
The client first defines a set of available tools (functions) in the request payload. Each
functionDeclaration includes a name, a description of what it does, and a JSON schema for its
parameters.10 The model uses this information to decide if and how to use a tool to answer
the user's prompt.
Bash
# Step 1: Ask a question that requires a tool.
curl "[Link] \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents":
}],
"tools":
}
}]
}]
}'
If the model decides to use the tool, its response will not contain text. Instead, it will contain a
functionCall object specifying the name of the function to execute (get_current_weather) and
the arguments ({"location": "Boston, MA"}).
Step 2: Execute the Function and Return the Result
The client-side script must now parse this response. It is responsible for actually executing
the requested function—in this case, it might call a real weather API. After obtaining the result
(e.g., {"temperature": "72F", "condition": "Sunny"}), the script makes a second API call to
Gemini.
This second request must include the entire history: the original user prompt, the model's first
functionCall response, and a new functionResponse part containing the result from the tool.
Bash
# Step 2: Provide the function's result back to the model.
curl "[Link] \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents":
},
{
"role": "model",
"parts":
},
{
"role": "function",
"parts":
}
],
"tools": [...] // The same tool definition from Step 1 must be included.
}'
The model will then process the tool's output and generate a final, human-readable text
response (e.g., "The weather in Boston is currently 72°F and sunny.").
Part V: Refining and Controlling Model Behavior
5.1 Mastering Generation Parameters with generationConfig
The generationConfig object, included at the top level of the request JSON, provides
fine-grained control over the model's generation process.14 Adjusting these parameters allows
for tuning the creativity, length, and determinism of the output.
Table 2: generationConfig Parameter Reference
Parameter Description Value Range Default Effect
temperature Controls the Lower values
degree of (e.g., ) are
randomness in more
token deterministic
selection. and factual.
Higher values
(e.g., ) are
more creative
and diverse.21
maxOutputTok The maximum Integer Varies by Limits the
ens number of model length of the
tokens to output. A
generate in the token is
response. roughly 4
characters.15
topP Nucleus Varies by Lower values
sampling. The model (e.g., ) restrict
model the model to a
considers small set of
tokens with a likely tokens,
cumulative making output
probability of less random.15
topP.
topK The model Integer Varies by A topK of 1 is
selects the model greedy
next token decoding.
from the topK Higher values
most probable allow for more
tokens. diversity.15
stopSequence An array of Array of `` Useful for
s strings. The strings forcing the
model will stop model to stop
generating if it at a specific
encounters point, like the
one of these end of a list or
sequences. a section
title.15
Example: Using generationConfig
Bash
curl "[Link] \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents":}],
"generationConfig": {
"temperature": 1.2,
"maxOutputTokens": 20,
"topP": 0.8,
"topK": 20
}
}'
5.2 Enforcing Responsible AI with safetySettings
The Gemini API includes built-in safety filters to block harmful content. The safetySettings
object allows developers to adjust the sensitivity of these filters for specific use cases.15 This
is configured as an array of objects, where each object specifies a harm category and a
blocking threshold.
Table 3: Safety Categories and Thresholds
category (Enum) Description threshold (Enum) Blocking Behavior
HARM_CATEGORY_ Negative or harmful BLOCK_NONE No content is
HARASSMENT comments blocked.
targeting identity.29
HARM_CATEGORY_ Content that is BLOCK_ONLY_HIGH Blocks content with
HATE_SPEECH rude, disrespectful, a high probability
or profane.29 of being harmful.
HARM_CATEGORY_ References to BLOCK_MEDIUM_A Blocks content with
SEXUALLY_EXPLICI sexual acts or other ND_ABOVE a medium or high
T lewd content.29 probability of being
harmful.
HARM_CATEGORY_ Content that BLOCK_LOW_AND_ Blocks content with
DANGEROUS_CON promotes ABOVE a low, medium, or
TENT dangerous acts high probability of
(e.g., self-harm).30 being harmful.
Example: Using safetySettings
This example sets a strict threshold for hate speech and a more lenient one for harassment.
Bash
curl "[Link] \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents":}],
"safetySettings":
}'
Part VI: The OpenAI Compatibility Layer
To facilitate migration for developers familiar with OpenAI's APIs, Google provides an
OpenAI-compatible endpoint. This is a strategic feature designed to lower the barrier to entry
by allowing the use of existing tools and code patterns.31 However, it has its own unique URL,
authentication scheme, and request structure that must be understood.
1. Endpoint URL: The base URL is different from the standard Gemini API:
[Link]
2. Authentication: This is the most critical distinction. While it uses the Authorization:
Bearer scheme, the token is not an OAuth token. Instead, it is the standard Gemini API
Key obtained from AI Studio. This non-standard implementation is a potential point of
confusion and must be noted carefully.31
3. Request Body: The JSON payload mirrors the OpenAI format, using a messages array
where each object has role and content keys.31
Example: Using the OpenAI Compatibility Endpoint
Bash
curl "[Link] \
-H "Authorization: Bearer $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [
{
"role": "user",
"content": "Explain to me how AI works"
}
]
}'
This compatibility layer is a powerful tool for migration but requires careful attention to its
specific implementation details, particularly the unique use of an API key within a Bearer token
header.
Appendix
A.1 Model and Endpoint Reference Guide
Table 4: Model Capabilities Quick Reference
Task Model Name API Method Example Endpoint
(Google AI)
Text Generation gemini-2.5-flash, generateContent .../models/gemini-2.
gemini-2.5-pro 5-flash:generateCo
ntent
Streaming Text gemini-2.5-flash, streamGenerateCo .../models/gemini-2.
gemini-2.5-pro ntent 5-flash:streamGen
erateContent?alt=s
se
Chat / Conversation gemini-2.5-flash, generateContent .../models/gemini-2.
gemini-2.5-pro 5-flash:generateCo
ntent
Image gemini-2.5-flash, generateContent .../models/gemini-2.
Understanding gemini-2.5-pro 5-flash:generateCo
ntent
Image Generation gemini-2.5-flash-im generateContent .../models/gemini-2.
age 5-flash-image:gene
rateContent
Text Embedding gemini-embedding embedContent, .../models/gemini-e
-001 batchEmbedConte mbedding-001:em
nts bedContent
A.2 Common curl Errors and Solutions
● Error: "User location is not supported for the API use without a billing account
linked." 32
○ Cause: Attempting to use the free tier of the Google AI API from a geographical
region (such as the EU) that requires a billing account to be linked to the Google
Cloud project.
○ Solution: In the Google Cloud Console, navigate to the project associated with your
API key and link a valid billing account.
● Error: 401 Unauthorized / API Key Not Valid
○ Cause: The API key is incorrect, the GEMINI_API_KEY environment variable is not set
or exported correctly, or the wrong authentication method is being used for the
target endpoint (e.g., sending an x-goog-api-key header to a Vertex AI endpoint).
○ Solution: Verify the API key in Google AI Studio. Run echo $GEMINI_API_KEY to
confirm the variable is loaded in your shell. Refer to Table 1 to ensure you are using
the correct authentication header for your chosen platform.
● Error: 400 Bad Request / Invalid Argument
○ Cause: The JSON payload in the -d argument is malformed. Common errors include
unescaped double quotes within strings, trailing commas, or an incorrect object
structure.
○ Solution: Validate your JSON using an online linter or a command-line tool like jq. For
complex payloads, it is often easier to write the JSON to a file (e.g., [Link]) and
pass it to curl using the -d @[Link] syntax.
● Error: Streaming Not Working (Receiving a single response instead of a stream)
○ Cause: The ?alt=sse query parameter was omitted from the URL when calling the
streamGenerateContent endpoint.
○ Solution: Ensure the URL for your streaming request explicitly ends with ?alt=sse.16
Works cited
1. Gemini API | Google AI for Developers, accessed October 13, 2025,
[Link]
2. Getting Started with the Gemini API in Vertex AI with cURL - Google Cloud Skills
Boost, accessed October 13, 2025,
[Link]
3. google-gemini/cookbook: Examples and guides for using the Gemini API -
GitHub, accessed October 13, 2025, [Link]
4. Gemini API reference - Google AI for Developers, accessed October 13, 2025,
[Link]
5. Google AI Studio, accessed October 13, 2025, [Link]
6. All methods | Gemini API - Google AI for Developers, accessed October 13, 2025,
[Link]
7. Whats the base url of gemini's API? : r/GoogleGeminiAI - Reddit, accessed
October 13, 2025,
[Link]
l_of_geminis_api/
8. Gemini for Google Cloud documentation, accessed October 13, 2025,
[Link]
9. Examples | Generative AI on Vertex AI - Google Cloud, accessed October 13,
2025,
[Link]
10.Getting Started with the Gemini API in Vertex AI with cURL / REST API - Google
Colab, accessed October 13, 2025,
[Link]
b/main/gemini/getting-started/intro_gemini_curl.ipynb
11. Using Gemini API keys | Google AI for Developers, accessed October 13, 2025,
[Link]
12.Gemini API quickstart - Google AI for Developers, accessed October 13, 2025,
[Link]
13.Gemini API in Vertex AI quickstart - Google Cloud, accessed October 13, 2025,
[Link]
14.Text generation | Gemini API | Google AI for Developers, accessed October 13,
2025, [Link]
15.Get started with Gemini using the REST API - Google Colab, accessed October
13, 2025,
[Link]
te/en/gemini-api/docs/get-started/[Link]?authuser=5&hl=fa
16.Gemini API: Streaming Quickstart with REST - Colab - Google, accessed October
13, 2025,
[Link]
ckstarts/rest/Streaming_REST.ipynb
17.Streaming output - Google Gemini API - Apidog, accessed October 13, 2025,
[Link]
18.Build multi-turn conversations (chat) using the Gemini API | Firebase AI Logic -
Google, accessed October 13, 2025,
[Link]
19.Multi-turn conversations - Google Gemini API - Apidog, accessed October 13,
2025, [Link]
20.Image understanding | Gemini API | Google AI for Developers, accessed October
13, 2025, [Link]
21.Generate content with the Gemini API in Vertex AI - Google Cloud, accessed
October 13, 2025,
[Link]
22.How Can I Send Files to Google's Gemini Models via API Call? - Stack Overflow,
accessed October 13, 2025,
[Link]
gemini-models-via-api-call
23.Image understanding - Google Gemini API, accessed October 13, 2025,
[Link]
24.Image generation with Gemini (aka Nano Banana) | Gemini API | Google AI for
Developers, accessed October 13, 2025,
[Link]
25.Embeddings | Gemini API - Google AI for Developers, accessed October 13, 2025,
[Link]
26.Gemini Embedding now generally available in the Gemini API - Google
Developers Blog, accessed October 13, 2025,
[Link]
27.Embeddings | Gemini API - Google AI for Developers, accessed October 13, 2025,
[Link]
28.Function calling with the Gemini API | Google AI for Developers, accessed
October 13, 2025, [Link]
29.Safety settings | Gemini API | Google AI for Developers, accessed October 13,
2025, [Link]
30.Safety and content filters | Generative AI on Vertex AI - Google Cloud, accessed
October 13, 2025,
[Link]
ty-filters
31.OpenAI compatibility | Gemini API - Google AI for Developers, accessed October
13, 2025, [Link]
32.Setting up Google AI services for API-based text inference | by Péter Harang |
Medium, accessed October 13, 2025,
[Link]
-text-inference-b6e75162beb3