google · Google AI Docs
Gemini API Authentication with OAuth quickstart
A guide for setting up and implementing OAuth authentication to access the Gemini API.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Gemini API Authentication with OAuth quickstart
A guide for setting up and implementing OAuth authentication to access the Gemini API.
When To Use
Use when you need to implement secure, user-delegated access to the Gemini API using OAuth credentials instead of simple API keys.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/gemini-api-authentication-with-oauth-quickstart-workflow-guide.md | A guide detailing the steps to set up and enable OAuth authentication for the Gemini API via a Google Cloud project. | Questions about a guide detailing the steps to set up and enable OAuth authentication for the Gemini API via a Google Cloud project. |
examples/gemini-api-authentication-with-oauth-quickstart-gemini-api-oauth-gcloud-.text | A shell command for authenticating with the Gemini API using gcloud application default credentials and specific OAuth scopes. | Exact payloads, commands, or snippets shown in A shell command for authenticating with the Gemini API using gcloud application default credentials and specific OAut... |
examples/gemini-api-authentication-with-oauth-quickstart-gemini-api-oauth-curl-au.text | A shell command sequence using curl and gcloud to authenticate with the Gemini API using an OAuth access token. | Exact payloads, commands, or snippets shown in A shell command sequence using curl and gcloud to authenticate with the Gemini API using an OAuth access token. |
examples/gemini-api-authentication-with-oauth-quickstart-gemini-api-oauth-python-.text | The pip install command required to install the google-genai library for Gemini API authentication. | Exact payloads, commands, or snippets shown in The pip install command required to install the google-genai library for Gemini API authentication. |
examples/gemini-api-authentication-with-oauth-quickstart-gemini-api-oauth-python--2.text | A Python code example demonstrating how to initialize the Gemini API client using OAuth credentials. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to initialize the Gemini API client using OAuth credentials. |
examples/gemini-api-authentication-with-oauth-quickstart-gemini-api-oauth-python--3.text | Shell commands to install the required Google API client and authentication libraries for Python. | Exact payloads, commands, or snippets shown in Shell commands to install the required Google API client and authentication libraries for Python. |
examples/gemini-api-authentication-with-oauth-quickstart-gemini-api-oauth-python--4.text | A Python script demonstrating how to load credentials and manage OAuth tokens for authenticating with the Gemini API. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to load credentials and manage OAuth tokens for authenticating with the Gemini API. |
examples/gemini-api-authentication-with-oauth-quickstart-gemini-api-oauth-python--5.text | A Python code example demonstrating how to initialize a Gemini API client using OAuth credentials. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to initialize a Gemini API client using OAuth credentials. |
examples/gemini-api-authentication-with-oauth-quickstart-gemini-api-oauth-python--6.text | A Python script demonstrating how to authenticate with the Gemini API using OAuth credentials. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to authenticate with the Gemini API using OAuth credentials. |
What This Skill Covers
- The easiest way to authenticate to the Gemini API is to configure an API key, as described in the Gemini API quickstart. If you need stricter access controls...
- Main sections:
Objectives,Prerequisites,Set up your cloud project,1. Enable the API,2. Configure the OAuth consent screen.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://ai.google.dev/gemini-api/docs/oauth
