{"id":15643167,"url":"https://github.com/logankilpatrick/gemini-api-quickstart","last_synced_at":"2025-11-03T19:41:40.534Z","repository":{"id":238679793,"uuid":"797224756","full_name":"logankilpatrick/gemini-api-quickstart","owner":"logankilpatrick","description":"Get up and running in under 5 minutes with the Google AI Gemini API (in Python)","archived":false,"fork":false,"pushed_at":"2024-09-10T15:35:44.000Z","size":134,"stargazers_count":144,"open_issues_count":1,"forks_count":26,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T15:46:57.679Z","etag":null,"topics":["ai","gemini","gemini-api","google","python"],"latest_commit_sha":null,"homepage":"https://ai.google.dev/gemini-api/docs","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logankilpatrick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-07T12:38:31.000Z","updated_at":"2025-03-21T23:08:58.000Z","dependencies_parsed_at":"2024-10-23T01:12:41.006Z","dependency_job_id":null,"html_url":"https://github.com/logankilpatrick/gemini-api-quickstart","commit_stats":null,"previous_names":["logankilpatrick/gemini-api-quickstart"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logankilpatrick%2Fgemini-api-quickstart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logankilpatrick%2Fgemini-api-quickstart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logankilpatrick%2Fgemini-api-quickstart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logankilpatrick%2Fgemini-api-quickstart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logankilpatrick","download_url":"https://codeload.github.com/logankilpatrick/gemini-api-quickstart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251689217,"owners_count":21627867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","gemini","gemini-api","google","python"],"created_at":"2024-10-03T11:59:18.963Z","updated_at":"2025-11-03T19:41:40.506Z","avatar_url":"https://github.com/logankilpatrick.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gemini API Quickstart - Python\n\nThis repository contains a simple Python Flask App running with the Google AI Gemini API, designed to get you started building with Gemini's multi-modal capabilities. The app comes with a basic UI and a Flask backend.\n\n\u003cimg width=\"1271\" alt=\"Screenshot 2024-05-07 at 7 42 28 AM\" src=\"https://github.com/logankilpatrick/gemini-api-quickstart/assets/35577566/156ae3e0-cffa-47a3-8a71-1bded78c4632\"\u003e\n\n## Basic request\n\nTo send your first API request with the [Gemini API Python SDK](https://github.com/google-gemini/generative-ai-python), make sure you have the right dependencies installed (see installation steps below) and then run the following code:\n\n```python\nimport os\nimport google.generativeai as genai\n\nGOOGLE_API_KEY = os.getenv(\"GOOGLE_API_KEY\")\n\ngenai.configure(api_key=GOOGLE_API_KEY)\nmodel = genai.GenerativeModel('gemini-pro')\n\nchat = model.start_chat(history=[])\nresponse = chat.send_message(\"In one sentence, explain how AI works to a child.\")\n# Note that the chat object is temporarily stateful, as you send messages and get responses, you can \n# see the history changing by doing `chat.history`.\n\nprint(response.text)\n```\n\n## Setup\n\n1. If you don’t have Python installed, install it [from Python.org](https://www.python.org/downloads/).\n\n2. [Clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) this repository.\n\n3. Create a new virtual environment:\n\n   - macOS:\n     ```bash\n     $ python -m venv venv\n     $ . venv/bin/activate\n     ```\n\n   - Windows:\n     ```cmd\n     \u003e python -m venv venv\n     \u003e .\\venv\\Scripts\\activate\n     ```\n\n   - Linux:\n      ```bash\n      $ python -m venv venv\n      $ source venv/bin/activate\n      ```\n\n4. Install the requirements:\n\n   ```bash\n   $ pip install -r requirements.txt\n   ```\n\n5. Make a copy of the example environment variables file:\n\n   ```bash\n   $ cp .env.example .env\n   ```\n\n6. Add your [API key](https://ai.google.dev/gemini-api/docs/api-key) to the newly created `.env` file.\n\n7. Run the app:\n\n```bash\n$ flask run\n```\n\nYou should now be able to access the app from your browser at the following URL: [http://localhost:5000](http://localhost:5000)!\n\n#### Attribution\n\nThis repo includes code that was forked from [another repo I made](https://github.com/openai/openai-quickstart-python), under an MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogankilpatrick%2Fgemini-api-quickstart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogankilpatrick%2Fgemini-api-quickstart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogankilpatrick%2Fgemini-api-quickstart/lists"}