--- title: Gemini AI API (No Login) emoji: ๐Ÿค– colorFrom: blue colorTo: purple sdk: docker app_port: 7860 tags: - api - playwright - gemini --- # ๐Ÿค– Gemini AI API (Headless & No-Login) This is a FastAPI-based wrapper for Google Gemini that runs on Hugging Face Spaces using Playwright. It operates in **Guest Mode** (no login required), opens a fresh browser session for every request, and automatically cleans up afterwards to ensure privacy and stability. ## โœจ Features - ๐Ÿ”“ **No Login Required:** Runs in guest mode; no cookies or user_data needed. - ๐Ÿงน **Auto-Cleanup:** Fresh browser instance for every API call. - ๐Ÿ–ผ๏ธ **Image Support:** Automatically downloads generated images and uploads them to ImgBB. - โšก **FastAPI:** High-performance async API endpoints. - ๐Ÿณ **Dockerized:** Pre-configured with Chromium and all dependencies. ## ๐Ÿš€ Setup Instructions ### 1. Create a Hugging Face Space - Select **Docker** as the SDK. - Upload `app.py`, `requirements.txt`, and `Dockerfile`. ### 2. Configure Secrets Go to your Space **Settings > Variables and Secrets** and add: - `IMGBB_API_KEY`: Your API key from [ImgBB](https://api.imgbb.com/) (Required for image uploads). ### 3. Files Required Ensure these files are in your repository: - `app.py` (Main application code) - `requirements.txt` (Dependencies) - `Dockerfile` (Installs Chromium + Python deps) ## ๐Ÿ“ก API Usage ### Endpoint: `/chat` **Method:** `POST` **Content-Type:** `application/json` #### Request Body ```json { "message": "Your prompt here" }