OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI APIs & Platforms

Gemini API

Gemini API is an open-source asynchronous Python library and CLI that wraps the Google Gemini web app through reverse-engineered interfaces. It provides programmatic access to chat and documented file, streaming, generation, and deep-research workflows.

Independent OpenViST project profile, based on linked sources.

Gemini API — OpenViST project profile in AI APIs & Platforms.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when a Python application or CLI needs to interact with Gemini web-app capabilities and the documented cookie-based authentication approach fits the project.

Who it is for

  • Python developers integrating Gemini web-app interactions into applications
  • Developers building chat integrations or prototypes involving Gemini generation and research workflows
  • Users who want to interact with Gemini from a command line

Documented uses

  • Send prompts and continue multi-turn conversations through a Python client
  • Submit image or document files alongside a prompt
  • Stream partial outputs and handle classified response content
  • Use documented image, video, audio, and deep-research workflows
  • Ask questions, continue chats, and conduct deep research through the CLI
Before you choose

Requirements & limits

The package requires Python 3.11 or higher. The documented client authentication uses cookies from a Google account logged in to gemini.google.com; the CLI requires a cookies JSON file. The project is licensed under AGPL-3.0.

  • The wrapper is reverse-engineered and interacts with the Gemini web app rather than being Google's official API.
  • The README documents cookie refresh and optional cookie import through browser-cookie3; Firefox is the browser identified for that optional dependency.
  • For containerized applications, the README describes persisting refreshed cookies with a writable GEMINI_COOKIE_PATH.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install the library and prepare Gemini authentication

Set up the Python package and the cookie-based authentication required to initialize its client.

Before you start

  • Python 3.11 or higher
  • A Google account logged in to gemini.google.com
  • pip

Steps

  1. Install the package with the command below.

    Documented command
    pip install -U gemini_webapi
  2. Log in to gemini.google.com, open the browser's web inspector, select Network, and refresh the page.

  3. Copy the __Secure-1PSID and __Secure-1PSIDTS cookie values from a request for use when initializing the client.

Expected outcome

The package is installed and the cookie values needed for client initialization are available.

Guide limitations

  • The documented cookie-import alternative requires the optional browser-cookie3 dependency; the README identifies Firefox as supported.
  • This guide covers setup and authentication, not a completed request or successful runtime.
Source-based practical guide

Prepare cookies for the command-line tool

Create the cookie file required to use the documented Gemini API CLI.

Before you start

  • Python 3.11 or higher
  • Cookies exported from a logged-in Gemini web session
  • A JSON file for the exported cookies

Steps

  1. Export cookies from gemini.google.com.

  2. Save them in a JSON file using the documented __Secure-1PSID and __Secure-1PSIDTS keys, or use a supported browser-cookie-extension export format.

  3. Provide the file to the CLI with its required --cookies-json PATH option.

Expected outcome

The CLI has a cookie file in the documented format for its commands.

Guide limitations

  • This guide covers cookie preparation and the required CLI option, not execution of a CLI command.
  • The CLI persists updated cookies to the JSON file after each run unless --no-persist is used.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
10 October 2026
Original website title
HanaokaYuzu/Gemini-API · Official homepage title · retained in its source language