From dda7d5f738e960f9ff00d4a18ab34673fd5a2347 Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Fri, 31 Oct 2025 17:23:24 +0800 Subject: [PATCH] `GOOGLE_API_KEY` -> `GEMINI_API_KEY` Colab now uses `GEMINI_API_KEY` for keys imported from AI Studio, along with the default across the docs on ai.google.dev. This brings the cookbook in line with the same defaults. --- .../Agents_Function_Calling_Barista_Bot.ipynb | 4 ++-- examples/Analyze_a_Video_Classification.ipynb | 4 ++-- ...e_a_Video_Historic_Event_Recognition.ipynb | 4 ++-- examples/Analyze_a_Video_Summarization.ipynb | 4 ++-- ...imated_Story_Video_Generation_gemini.ipynb | 4 ++-- .../Anomaly_detection_with_embeddings.ipynb | 4 ++-- examples/Apollo_11.ipynb | 6 +++--- examples/Book_illustration.ipynb | 6 +++--- examples/Browser_as_a_tool.ipynb | 6 +++--- examples/Entity_Extraction.ipynb | 6 +++--- examples/Google_IO2025_Live_Coding.ipynb | 10 +++++----- examples/Guess_the_shape.ipynb | 4 ++-- examples/LiveAPI_plotting_and_mapping.ipynb | 6 +++--- examples/Market_a_Jet_Backpack.ipynb | 6 +++--- examples/Opossum_search.ipynb | 6 +++--- ...ctured_outputs_on_invoices_and_forms.ipynb | 2 +- examples/Search_Wikipedia_using_ReAct.ipynb | 6 +++--- ...Search_grounding_for_research_report.ipynb | 6 +++--- examples/Spatial_understanding_3d.ipynb | 6 +++--- .../Story_Writing_with_Prompt_Chaining.ipynb | 6 +++--- examples/Tag_and_caption_images.ipynb | 4 ++-- .../Talk_to_documents_with_embeddings.ipynb | 2 +- examples/Translate_a_Public_Domain_Book.ipynb | 6 +++--- examples/Upload_files_to_Colab.ipynb | 6 +++--- examples/Virtual_Try_On.ipynb | 4 ++-- examples/Voice_memos.ipynb | 6 +++--- ...g_with_Charts_Graphs_and_Slide_Decks.ipynb | 6 +++--- .../google-adk/Getting_started_with_ADK.ipynb | 6 +++--- .../Entity_Extraction_JSON.ipynb | 6 +++--- .../Sentiment_Analysis.ipynb | 6 +++--- .../Text_Classification.ipynb | 6 +++--- .../Text_Summarization.ipynb | 6 +++--- .../Chat_with_SQL_using_langchain.ipynb | 6 +++--- .../Gemini_LangChain_QA_Chroma_WebLoad.ipynb | 6 +++--- ...Gemini_LangChain_QA_Pinecone_WebLoad.ipynb | 6 +++--- ...mini_LangChain_Summarization_WebLoad.ipynb | 6 +++--- ...i_LlamaIndex_QA_Chroma_WebPageReader.ipynb | 6 +++--- examples/mlflow/MLflow_Observability.ipynb | 2 +- .../Adding_context_information.ipynb | 6 +++--- examples/prompting/Basic_Classification.ipynb | 6 +++--- .../prompting/Basic_Code_Generation.ipynb | 6 +++--- examples/prompting/Basic_Evaluation.ipynb | 6 +++--- .../Basic_Information_Extraction.ipynb | 6 +++--- examples/prompting/Basic_Reasoning.ipynb | 6 +++--- .../Chain_of_thought_prompting.ipynb | 6 +++--- examples/prompting/Few_shot_prompting.ipynb | 6 +++--- examples/prompting/Providing_base_cases.ipynb | 6 +++--- examples/prompting/Role_prompting.ipynb | 6 +++--- examples/prompting/Self_ask_prompting.ipynb | 6 +++--- examples/prompting/Zero_shot_prompting.ipynb | 6 +++--- examples/qdrant/Hybrid_Search_Legal.ipynb | 6 +++--- .../qdrant/Qdrant_similarity_search.ipynb | 2 +- examples/weaviate/query-agent-as-a-tool.ipynb | 2 +- quickstarts/Asynchronous_requests.ipynb | 6 +++--- quickstarts/Audio.ipynb | 6 +++--- quickstarts/Authentication.ipynb | 14 ++++++------- quickstarts/Batch_mode.ipynb | 6 +++--- quickstarts/Caching.ipynb | 6 +++--- quickstarts/Code_Execution.ipynb | 6 +++--- quickstarts/Counting_Tokens.ipynb | 6 +++--- quickstarts/Embeddings.ipynb | 2 +- quickstarts/Enum.ipynb | 6 +++--- quickstarts/Error_handling.ipynb | 6 +++--- quickstarts/File_API.ipynb | 6 +++--- quickstarts/Function_calling.ipynb | 6 +++--- quickstarts/Get_started_LearnLM.ipynb | 6 +++--- quickstarts/Get_started_LiveAPI.ipynb | 8 ++++---- quickstarts/Get_started_LiveAPI_tools.ipynb | 4 ++-- quickstarts/Get_started_LyriaRealTime.ipynb | 6 +++--- .../Get_started_OpenAI_Compatibility.ipynb | 10 +++++----- quickstarts/Get_started_TTS.ipynb | 6 +++--- quickstarts/Get_started_Veo.ipynb | 2 +- quickstarts/Get_started_imagen.ipynb | 6 +++--- quickstarts/Get_started_imagen_rest.ipynb | 6 +++--- quickstarts/Get_started_thinking.ipynb | 6 +++--- quickstarts/Get_started_thinking_REST.ipynb | 6 +++--- quickstarts/Grounding.ipynb | 6 +++--- quickstarts/Image_out.ipynb | 6 +++--- quickstarts/JSON_mode.ipynb | 6 +++--- quickstarts/New_in_002.ipynb | 2 +- quickstarts/PDF_Files.ipynb | 6 +++--- quickstarts/Prompting.ipynb | 6 +++--- quickstarts/Safety.ipynb | 6 +++--- quickstarts/Search_Grounding.ipynb | 4 ++-- quickstarts/Spatial_understanding.ipynb | 6 +++--- quickstarts/Streaming.ipynb | 4 ++-- quickstarts/System_instructions.ipynb | 4 ++-- quickstarts/Template.ipynb | 6 +++--- quickstarts/Video_understanding.ipynb | 6 +++--- quickstarts/gemini-robotics-er.ipynb | 6 +++--- quickstarts/rest/Audio_REST.ipynb | 20 +++++++++---------- quickstarts/rest/Caching_REST.ipynb | 14 ++++++------- quickstarts/rest/Embeddings_REST.ipynb | 2 +- quickstarts/rest/Function_calling_REST.ipynb | 10 +++++----- .../rest/Function_calling_config_REST.ipynb | 10 +++++----- quickstarts/rest/Imagen_REST.ipynb | 6 +++--- quickstarts/rest/JSON_mode_REST.ipynb | 6 +++--- quickstarts/rest/Prompting_REST.ipynb | 14 ++++++------- quickstarts/rest/Safety_REST.ipynb | 8 ++++---- quickstarts/rest/Search_Grounding.ipynb | 6 +++--- quickstarts/rest/Streaming_REST.ipynb | 6 +++--- .../rest/System_instructions_REST.ipynb | 8 ++++---- quickstarts/rest/Video_REST.ipynb | 12 +++++------ .../websockets/Get_started_LiveAPI.ipynb | 6 +++--- .../Get_started_LiveAPI_tools.ipynb | 6 +++--- ...Get_started_LyriaRealTime_websockets.ipynb | 6 +++--- .../LiveAPI_streaming_in_colab.ipynb | 6 +++--- 107 files changed, 323 insertions(+), 323 deletions(-) diff --git a/examples/Agents_Function_Calling_Barista_Bot.ipynb b/examples/Agents_Function_Calling_Barista_Bot.ipynb index 432473b47..2b3eb7f90 100644 --- a/examples/Agents_Function_Calling_Barista_Bot.ipynb +++ b/examples/Agents_Function_Calling_Barista_Bot.ipynb @@ -70,7 +70,7 @@ "id": "zFjRBXVrAdYB" }, "source": [ - "To run this notebook, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](../quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](../quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -84,7 +84,7 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "client = genai.Client(api_key=userdata.get(\"GOOGLE_API_KEY\"))" + "client = genai.Client(api_key=userdata.get(\"GEMINI_API_KEY\"))" ] }, { diff --git a/examples/Analyze_a_Video_Classification.ipynb b/examples/Analyze_a_Video_Classification.ipynb index 07efba629..f8af67cfb 100644 --- a/examples/Analyze_a_Video_Classification.ipynb +++ b/examples/Analyze_a_Video_Classification.ipynb @@ -70,7 +70,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -84,7 +84,7 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "API_KEY = userdata.get('GOOGLE_API_KEY')\n", + "API_KEY = userdata.get('GEMINI_API_KEY')\n", "client = genai.Client(api_key=API_KEY)" ] }, diff --git a/examples/Analyze_a_Video_Historic_Event_Recognition.ipynb b/examples/Analyze_a_Video_Historic_Event_Recognition.ipynb index fbafdc850..0bdfe4c94 100644 --- a/examples/Analyze_a_Video_Historic_Event_Recognition.ipynb +++ b/examples/Analyze_a_Video_Historic_Event_Recognition.ipynb @@ -81,7 +81,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -95,7 +95,7 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "API_KEY = userdata.get('GOOGLE_API_KEY')\n", + "API_KEY = userdata.get('GEMINI_API_KEY')\n", "client = genai.Client(api_key=API_KEY)" ] }, diff --git a/examples/Analyze_a_Video_Summarization.ipynb b/examples/Analyze_a_Video_Summarization.ipynb index bf72ca1d6..36869797f 100644 --- a/examples/Analyze_a_Video_Summarization.ipynb +++ b/examples/Analyze_a_Video_Summarization.ipynb @@ -70,7 +70,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -84,7 +84,7 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "API_KEY = userdata.get('GOOGLE_API_KEY')\n", + "API_KEY = userdata.get('GEMINI_API_KEY')\n", "client = genai.Client(api_key=API_KEY)" ] }, diff --git a/examples/Animated_Story_Video_Generation_gemini.ipynb b/examples/Animated_Story_Video_Generation_gemini.ipynb index 7cfeca251..6538f42cb 100644 --- a/examples/Animated_Story_Video_Generation_gemini.ipynb +++ b/examples/Animated_Story_Video_Generation_gemini.ipynb @@ -104,7 +104,7 @@ "source": [ "## Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/22859a9f498b6de9d8fe4a33161bcdd3f713d5e8/quickstarts/Authentication.ipynb) for an example" + "To run the following cell, your API key must be stored it in a Colab Secret named GEMINI_API_KEY. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/22859a9f498b6de9d8fe4a33161bcdd3f713d5e8/quickstarts/Authentication.ipynb) for an example" ] }, { @@ -118,7 +118,7 @@ "from google.colab import userdata\n", "import os\n", "\n", - "os.environ['GOOGLE_API_KEY']=userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY']=userdata.get('GEMINI_API_KEY')" ] }, { diff --git a/examples/Anomaly_detection_with_embeddings.ipynb b/examples/Anomaly_detection_with_embeddings.ipynb index 3b62a636e..8dcedd47d 100644 --- a/examples/Anomaly_detection_with_embeddings.ipynb +++ b/examples/Anomaly_detection_with_embeddings.ipynb @@ -88,7 +88,7 @@ "id": "Yi0kitgd5aLG" }, "source": [ - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -102,7 +102,7 @@ "# Used to securely store your API key\n", "from google.colab import userdata\n", "from google import genai\n", - "API_KEY = userdata.get(\"GOOGLE_API_KEY\")\n", + "API_KEY = userdata.get(\"GEMINI_API_KEY\")\n", "client = genai.Client(api_key=API_KEY)" ] }, diff --git a/examples/Apollo_11.ipynb b/examples/Apollo_11.ipynb index 422c7b70c..911584566 100644 --- a/examples/Apollo_11.ipynb +++ b/examples/Apollo_11.ipynb @@ -77,7 +77,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -91,8 +91,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Book_illustration.ipynb b/examples/Book_illustration.ipynb index c703804e2..fc70c4212 100644 --- a/examples/Book_illustration.ipynb +++ b/examples/Book_illustration.ipynb @@ -137,7 +137,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -150,7 +150,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')" ] }, { @@ -175,7 +175,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Browser_as_a_tool.ipynb b/examples/Browser_as_a_tool.ipynb index c5c6a0ba7..2fcf8d7c3 100644 --- a/examples/Browser_as_a_tool.ipynb +++ b/examples/Browser_as_a_tool.ipynb @@ -115,7 +115,7 @@ "source": [ "### Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -129,7 +129,7 @@ "import os\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')" ] }, { @@ -153,7 +153,7 @@ "source": [ "from google.genai import types\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)\n", + "client = genai.Client(api_key=GEMINI_API_KEY)\n", "\n", "LIVE_MODEL = 'gemini-2.0-flash-live-001' # @param ['gemini-2.0-flash-live-001', 'gemini-live-2.5-flash-preview', 'gemini-2.5-flash-preview-native-audio-dialog', 'gemini-2.5-flash-exp-native-audio-thinking-dialog'] {allow-input: true, isTemplate: true}\n", "MODEL = 'gemini-2.5-flash' # @param ['gemini-2.5-flash'] {allow-input: true, isTemplate: true}" diff --git a/examples/Entity_Extraction.ipynb b/examples/Entity_Extraction.ipynb index 7cb64059f..a64d3b882 100644 --- a/examples/Entity_Extraction.ipynb +++ b/examples/Entity_Extraction.ipynb @@ -81,7 +81,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -95,8 +95,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Google_IO2025_Live_Coding.ipynb b/examples/Google_IO2025_Live_Coding.ipynb index 7977476d9..9b7df4c79 100644 --- a/examples/Google_IO2025_Live_Coding.ipynb +++ b/examples/Google_IO2025_Live_Coding.ipynb @@ -103,7 +103,7 @@ "source": [ "### Setup your API key\n", "\n", - "To authenticate your requests with the Gemini API, you need an API key. This key allows you to access Google's powerful generative AI models. It's recommended to store your API key securely, for instance, as a Colab Secret named `GOOGLE_API_KEY`.\n", + "To authenticate your requests with the Gemini API, you need an API key. This key allows you to access Google's powerful generative AI models. It's recommended to store your API key securely, for instance, as a Colab Secret named `GEMINI_API_KEY`.\n", "\n", "If you don't already have an API key or you aren't sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] @@ -118,7 +118,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')" ] }, { @@ -145,7 +145,7 @@ "from google.genai import types\n", "from IPython.display import Video, HTML, Markdown, Image\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { @@ -3226,7 +3226,7 @@ "tools = []\n", "tools.append(types.Tool(url_context=types.UrlContext))\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)\n", + "client = genai.Client(api_key=GEMINI_API_KEY)\n", "config = types.GenerateContentConfig(\n", " tools=tools,\n", ")\n", @@ -4027,7 +4027,7 @@ "from google.adk.sessions import InMemorySessionService\n", "\n", "\n", - "os.environ[\"GOOGLE_API_KEY\"] = GOOGLE_API_KEY\n", + "os.environ[\"GEMINI_API_KEY\"] = GEMINI_API_KEY\n", "os.environ[\"GOOGLE_GENAI_USE_VERTEXAI\"] = \"False\"" ] }, diff --git a/examples/Guess_the_shape.ipynb b/examples/Guess_the_shape.ipynb index a8fd2e3b7..4e05967e6 100644 --- a/examples/Guess_the_shape.ipynb +++ b/examples/Guess_the_shape.ipynb @@ -97,8 +97,8 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/LiveAPI_plotting_and_mapping.ipynb b/examples/LiveAPI_plotting_and_mapping.ipynb index 1b02cc886..b3267a528 100644 --- a/examples/LiveAPI_plotting_and_mapping.ipynb +++ b/examples/LiveAPI_plotting_and_mapping.ipynb @@ -99,7 +99,7 @@ "source": [ "### Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -113,7 +113,7 @@ "import os\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')" ] }, { @@ -135,7 +135,7 @@ }, "outputs": [], "source": [ - "uri = f\"wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent?key={GOOGLE_API_KEY}\"\n", + "uri = f\"wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent?key={GEMINI_API_KEY}\"\n", "model = \"models/gemini-2.5-flash-native-audio-preview-09-2025\"" ] }, diff --git a/examples/Market_a_Jet_Backpack.ipynb b/examples/Market_a_Jet_Backpack.ipynb index e844120b1..7c8cb6f6f 100644 --- a/examples/Market_a_Jet_Backpack.ipynb +++ b/examples/Market_a_Jet_Backpack.ipynb @@ -83,7 +83,7 @@ "id": "55qIbUyLuLTS" }, "source": [ - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -97,8 +97,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Opossum_search.ipynb b/examples/Opossum_search.ipynb index 7393cffa6..987895a16 100644 --- a/examples/Opossum_search.ipynb +++ b/examples/Opossum_search.ipynb @@ -81,7 +81,7 @@ "source": [ "## Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -96,8 +96,8 @@ "from google.genai.types import GenerateContentConfig\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Pdf_structured_outputs_on_invoices_and_forms.ipynb b/examples/Pdf_structured_outputs_on_invoices_and_forms.ipynb index b38def8b1..2a0d9377f 100644 --- a/examples/Pdf_structured_outputs_on_invoices_and_forms.ipynb +++ b/examples/Pdf_structured_outputs_on_invoices_and_forms.ipynb @@ -85,7 +85,7 @@ "source": [ "from google import genai\n", "from google.colab import userdata\n", - "api_key = userdata.get(\"GOOGLE_API_KEY\") # If you are not using Colab you can set the API key directly\n", + "api_key = userdata.get(\"GEMINI_API_KEY\") # If you are not using Colab you can set the API key directly\n", "\n", "# Create a client\n", "client = genai.Client(api_key=api_key)\n", diff --git a/examples/Search_Wikipedia_using_ReAct.ipynb b/examples/Search_Wikipedia_using_ReAct.ipynb index 1d1f892bf..b3fb8cb4e 100644 --- a/examples/Search_Wikipedia_using_ReAct.ipynb +++ b/examples/Search_Wikipedia_using_ReAct.ipynb @@ -166,7 +166,7 @@ "id": "SAvjxTybuWw-" }, "source": [ - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -178,8 +178,8 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "genai.configure(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "genai.configure(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Search_grounding_for_research_report.ipynb b/examples/Search_grounding_for_research_report.ipynb index b8e1fcd45..490e5a31f 100644 --- a/examples/Search_grounding_for_research_report.ipynb +++ b/examples/Search_grounding_for_research_report.ipynb @@ -103,7 +103,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -116,7 +116,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')" ] }, { @@ -163,7 +163,7 @@ }, "outputs": [], "source": [ - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Spatial_understanding_3d.ipynb b/examples/Spatial_understanding_3d.ipynb index 9247b509f..879fa1e08 100644 --- a/examples/Spatial_understanding_3d.ipynb +++ b/examples/Spatial_understanding_3d.ipynb @@ -151,7 +151,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -164,7 +164,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')" ] }, { @@ -191,7 +191,7 @@ "\n", "from PIL import Image\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Story_Writing_with_Prompt_Chaining.ipynb b/examples/Story_Writing_with_Prompt_Chaining.ipynb index 6659b7797..87bfa8d09 100644 --- a/examples/Story_Writing_with_Prompt_Chaining.ipynb +++ b/examples/Story_Writing_with_Prompt_Chaining.ipynb @@ -91,7 +91,7 @@ "id": "GFu9ooSe4kF5" }, "source": [ - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -107,8 +107,8 @@ "from google.colab import userdata\n", "from pprint import pprint\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client=genai.Client(api_key=GOOGLE_API_KEY)\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client=genai.Client(api_key=GEMINI_API_KEY)\n", "\n", "MODEL_ID=\"gemini-2.5-flash\" # @param [\"gemini-2.5-flash-lite\", \"gemini-2.5-flash-lite-preview-09-2025\", \"gemini-2.5-flash\", \"gemini-2.5-flash-preview-09-2025\", \"gemini-2.5-pro\"] {\"allow-input\":true, isTemplate: true}" ] diff --git a/examples/Tag_and_caption_images.ipynb b/examples/Tag_and_caption_images.ipynb index 53fe9f876..a1cf21c88 100644 --- a/examples/Tag_and_caption_images.ipynb +++ b/examples/Tag_and_caption_images.ipynb @@ -93,7 +93,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -105,7 +105,7 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "api_key = userdata.get('GOOGLE_API_KEY')\n", + "api_key = userdata.get('GEMINI_API_KEY')\n", "\n", "client = genai.Client(api_key=api_key)" ] diff --git a/examples/Talk_to_documents_with_embeddings.ipynb b/examples/Talk_to_documents_with_embeddings.ipynb index c4e1288c5..7f4191d98 100644 --- a/examples/Talk_to_documents_with_embeddings.ipynb +++ b/examples/Talk_to_documents_with_embeddings.ipynb @@ -110,7 +110,7 @@ "id": "DJriBaWmkL6Z" }, "source": [ - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { diff --git a/examples/Translate_a_Public_Domain_Book.ipynb b/examples/Translate_a_Public_Domain_Book.ipynb index f0aedae58..83d845c3e 100644 --- a/examples/Translate_a_Public_Domain_Book.ipynb +++ b/examples/Translate_a_Public_Domain_Book.ipynb @@ -95,7 +95,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" ] }, { @@ -108,9 +108,9 @@ "source": [ "from google import genai\n", "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Upload_files_to_Colab.ipynb b/examples/Upload_files_to_Colab.ipynb index a68060f3a..f2ed1914b 100644 --- a/examples/Upload_files_to_Colab.ipynb +++ b/examples/Upload_files_to_Colab.ipynb @@ -133,7 +133,7 @@ "id": "l8g4hTRotheH" }, "source": [ - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -147,8 +147,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Virtual_Try_On.ipynb b/examples/Virtual_Try_On.ipynb index e1d8c0988..a17f061c0 100644 --- a/examples/Virtual_Try_On.ipynb +++ b/examples/Virtual_Try_On.ipynb @@ -175,7 +175,7 @@ "source": [ "## Step 3: Configure Gemini API key and GCP Project ID\n", "\n", - "To run the following cell, your Gemini API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example.\n", + "To run the following cell, your Gemini API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example.\n", "\n", "Additionally, please also store your GCP Project ID in a Colab Secret named `GCP_PROJECT_ID`." ] @@ -189,7 +189,7 @@ "outputs": [], "source": [ "# Comfigure Gemini API key.\n", - "GEMINI_API_KEY = userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", "client = genai.Client(api_key=GEMINI_API_KEY)\n", "\n", "# Configure GCP Project ID for Vertex AI.\n", diff --git a/examples/Voice_memos.ipynb b/examples/Voice_memos.ipynb index 6b012806f..827113915 100644 --- a/examples/Voice_memos.ipynb +++ b/examples/Voice_memos.ipynb @@ -88,7 +88,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -100,8 +100,8 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "genai.configure(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "genai.configure(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/Working_with_Charts_Graphs_and_Slide_Decks.ipynb b/examples/Working_with_Charts_Graphs_and_Slide_Decks.ipynb index e0378450a..19c5d4a85 100644 --- a/examples/Working_with_Charts_Graphs_and_Slide_Decks.ipynb +++ b/examples/Working_with_Charts_Graphs_and_Slide_Decks.ipynb @@ -88,7 +88,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" ] }, { @@ -102,8 +102,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/google-adk/Getting_started_with_ADK.ipynb b/examples/google-adk/Getting_started_with_ADK.ipynb index 6aa0a1201..bd9165da2 100644 --- a/examples/google-adk/Getting_started_with_ADK.ipynb +++ b/examples/google-adk/Getting_started_with_ADK.ipynb @@ -129,7 +129,7 @@ "\n", "To power the `Agent` with Gemini, access to the Google Generative AI API is required. The next code cell configures your API key.\n", "\n", - "**Important:** This example uses Colab Secrets (`userdata.get('GOOGLE_API_KEY')`). Make sure you have stored your key named `GOOGLE_API_KEY` in the Colab Secrets manager (View -> Secrets)." + "**Important:** This example uses Colab Secrets (`userdata.get('GEMINI_API_KEY')`). Make sure you have stored your key named `GEMINI_API_KEY` in the Colab Secrets manager (View -> Secrets)." ] }, { @@ -155,8 +155,8 @@ "import os\n", "from dotenv import load_dotenv\n", "\n", - "api_key = userdata.get('GOOGLE_API_KEY')\n", - "os.environ['GOOGLE_API_KEY'] = api_key\n", + "api_key = userdata.get('GEMINI_API_KEY')\n", + "os.environ['GEMINI_API_KEY'] = api_key\n", "load_dotenv()" ] }, diff --git a/examples/json_capabilities/Entity_Extraction_JSON.ipynb b/examples/json_capabilities/Entity_Extraction_JSON.ipynb index 1ba8f8043..21100254b 100644 --- a/examples/json_capabilities/Entity_Extraction_JSON.ipynb +++ b/examples/json_capabilities/Entity_Extraction_JSON.ipynb @@ -77,7 +77,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -91,8 +91,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/json_capabilities/Sentiment_Analysis.ipynb b/examples/json_capabilities/Sentiment_Analysis.ipynb index 4e31cc021..f3bd05db2 100644 --- a/examples/json_capabilities/Sentiment_Analysis.ipynb +++ b/examples/json_capabilities/Sentiment_Analysis.ipynb @@ -77,7 +77,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -91,8 +91,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/json_capabilities/Text_Classification.ipynb b/examples/json_capabilities/Text_Classification.ipynb index a7a94c21c..47639cffe 100644 --- a/examples/json_capabilities/Text_Classification.ipynb +++ b/examples/json_capabilities/Text_Classification.ipynb @@ -88,7 +88,7 @@ "source": [ "## Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -102,8 +102,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY = userdata.get(\"GOOGLE_API_KEY\")\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get(\"GEMINI_API_KEY\")\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/json_capabilities/Text_Summarization.ipynb b/examples/json_capabilities/Text_Summarization.ipynb index eb3542c27..4c22d4244 100644 --- a/examples/json_capabilities/Text_Summarization.ipynb +++ b/examples/json_capabilities/Text_Summarization.ipynb @@ -79,7 +79,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -93,8 +93,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/langchain/Chat_with_SQL_using_langchain.ipynb b/examples/langchain/Chat_with_SQL_using_langchain.ipynb index edf7d9ff6..b9054aa39 100644 --- a/examples/langchain/Chat_with_SQL_using_langchain.ipynb +++ b/examples/langchain/Chat_with_SQL_using_langchain.ipynb @@ -99,7 +99,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" ] }, { @@ -112,9 +112,9 @@ "source": [ "import os\n", "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "os.environ[\"GOOGLE_API_KEY\"] = GOOGLE_API_KEY" + "os.environ[\"GEMINI_API_KEY\"] = GEMINI_API_KEY" ] }, { diff --git a/examples/langchain/Gemini_LangChain_QA_Chroma_WebLoad.ipynb b/examples/langchain/Gemini_LangChain_QA_Chroma_WebLoad.ipynb index 78463c7f9..1111a8648 100644 --- a/examples/langchain/Gemini_LangChain_QA_Chroma_WebLoad.ipynb +++ b/examples/langchain/Gemini_LangChain_QA_Chroma_WebLoad.ipynb @@ -145,7 +145,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" ] }, { @@ -158,9 +158,9 @@ "source": [ "import os\n", "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "os.environ[\"GOOGLE_API_KEY\"] = GOOGLE_API_KEY" + "os.environ[\"GEMINI_API_KEY\"] = GEMINI_API_KEY" ] }, { diff --git a/examples/langchain/Gemini_LangChain_QA_Pinecone_WebLoad.ipynb b/examples/langchain/Gemini_LangChain_QA_Pinecone_WebLoad.ipynb index 3cfb60233..3348ce7d1 100644 --- a/examples/langchain/Gemini_LangChain_QA_Pinecone_WebLoad.ipynb +++ b/examples/langchain/Gemini_LangChain_QA_Pinecone_WebLoad.ipynb @@ -127,7 +127,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" ] }, { @@ -140,9 +140,9 @@ "source": [ "import os\n", "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "os.environ[\"GOOGLE_API_KEY\"] = GOOGLE_API_KEY" + "os.environ[\"GEMINI_API_KEY\"] = GEMINI_API_KEY" ] }, { diff --git a/examples/langchain/Gemini_LangChain_Summarization_WebLoad.ipynb b/examples/langchain/Gemini_LangChain_Summarization_WebLoad.ipynb index 6c0edfcec..a6c872b62 100644 --- a/examples/langchain/Gemini_LangChain_Summarization_WebLoad.ipynb +++ b/examples/langchain/Gemini_LangChain_Summarization_WebLoad.ipynb @@ -150,7 +150,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" ] }, { @@ -163,9 +163,9 @@ "source": [ "import os\n", "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "os.environ[\"GOOGLE_API_KEY\"] = GOOGLE_API_KEY" + "os.environ[\"GEMINI_API_KEY\"] = GEMINI_API_KEY" ] }, { diff --git a/examples/llamaindex/Gemini_LlamaIndex_QA_Chroma_WebPageReader.ipynb b/examples/llamaindex/Gemini_LlamaIndex_QA_Chroma_WebPageReader.ipynb index 1b60fec8c..197b8a632 100644 --- a/examples/llamaindex/Gemini_LlamaIndex_QA_Chroma_WebPageReader.ipynb +++ b/examples/llamaindex/Gemini_LlamaIndex_QA_Chroma_WebPageReader.ipynb @@ -128,7 +128,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example.\n" ] }, { @@ -141,9 +141,9 @@ "source": [ "import os\n", "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "os.environ[\"GOOGLE_API_KEY\"] = GOOGLE_API_KEY" + "os.environ[\"GEMINI_API_KEY\"] = GEMINI_API_KEY" ] }, { diff --git a/examples/mlflow/MLflow_Observability.ipynb b/examples/mlflow/MLflow_Observability.ipynb index b66750b03..616f58902 100644 --- a/examples/mlflow/MLflow_Observability.ipynb +++ b/examples/mlflow/MLflow_Observability.ipynb @@ -154,7 +154,7 @@ "import google.genai as genai\n", "from google.colab import userdata\n", "\n", - "client = genai.Client(api_key=userdata.get('GOOGLE_API_KEY'))" + "client = genai.Client(api_key=userdata.get('GEMINI_API_KEY'))" ] }, { diff --git a/examples/prompting/Adding_context_information.ipynb b/examples/prompting/Adding_context_information.ipynb index e1ab9cf24..050bbbdfd 100644 --- a/examples/prompting/Adding_context_information.ipynb +++ b/examples/prompting/Adding_context_information.ipynb @@ -99,7 +99,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -112,9 +112,9 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Basic_Classification.ipynb b/examples/prompting/Basic_Classification.ipynb index 1c33749c6..be9cd9815 100644 --- a/examples/prompting/Basic_Classification.ipynb +++ b/examples/prompting/Basic_Classification.ipynb @@ -79,7 +79,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -93,8 +93,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Basic_Code_Generation.ipynb b/examples/prompting/Basic_Code_Generation.ipynb index 277b5bce3..1b7d6281e 100644 --- a/examples/prompting/Basic_Code_Generation.ipynb +++ b/examples/prompting/Basic_Code_Generation.ipynb @@ -79,7 +79,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -93,8 +93,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Basic_Evaluation.ipynb b/examples/prompting/Basic_Evaluation.ipynb index 59bedb12c..ad9bc11bc 100644 --- a/examples/prompting/Basic_Evaluation.ipynb +++ b/examples/prompting/Basic_Evaluation.ipynb @@ -96,7 +96,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -108,9 +108,9 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Basic_Information_Extraction.ipynb b/examples/prompting/Basic_Information_Extraction.ipynb index c9a8d6423..864a77636 100644 --- a/examples/prompting/Basic_Information_Extraction.ipynb +++ b/examples/prompting/Basic_Information_Extraction.ipynb @@ -85,7 +85,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -99,8 +99,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Basic_Reasoning.ipynb b/examples/prompting/Basic_Reasoning.ipynb index 7ae8d57d2..15cca39f1 100644 --- a/examples/prompting/Basic_Reasoning.ipynb +++ b/examples/prompting/Basic_Reasoning.ipynb @@ -90,7 +90,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -104,8 +104,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Chain_of_thought_prompting.ipynb b/examples/prompting/Chain_of_thought_prompting.ipynb index a80af4655..9cdb66e31 100644 --- a/examples/prompting/Chain_of_thought_prompting.ipynb +++ b/examples/prompting/Chain_of_thought_prompting.ipynb @@ -77,7 +77,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -91,8 +91,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Few_shot_prompting.ipynb b/examples/prompting/Few_shot_prompting.ipynb index be235b604..d8f80e62a 100644 --- a/examples/prompting/Few_shot_prompting.ipynb +++ b/examples/prompting/Few_shot_prompting.ipynb @@ -89,7 +89,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -101,9 +101,9 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "client=genai.Client(api_key=GOOGLE_API_KEY)" + "client=genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Providing_base_cases.ipynb b/examples/prompting/Providing_base_cases.ipynb index dd860eef7..f96acff20 100644 --- a/examples/prompting/Providing_base_cases.ipynb +++ b/examples/prompting/Providing_base_cases.ipynb @@ -88,7 +88,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -100,9 +100,9 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "genai.configure(api_key=GOOGLE_API_KEY)" + "genai.configure(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Role_prompting.ipynb b/examples/prompting/Role_prompting.ipynb index ab9ecb829..9a3be684c 100644 --- a/examples/prompting/Role_prompting.ipynb +++ b/examples/prompting/Role_prompting.ipynb @@ -91,7 +91,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -103,9 +103,9 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Self_ask_prompting.ipynb b/examples/prompting/Self_ask_prompting.ipynb index 58c0377a8..95035b7bf 100644 --- a/examples/prompting/Self_ask_prompting.ipynb +++ b/examples/prompting/Self_ask_prompting.ipynb @@ -97,7 +97,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -111,8 +111,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/prompting/Zero_shot_prompting.ipynb b/examples/prompting/Zero_shot_prompting.ipynb index 1d54c8148..27c26c4ff 100644 --- a/examples/prompting/Zero_shot_prompting.ipynb +++ b/examples/prompting/Zero_shot_prompting.ipynb @@ -86,7 +86,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -100,8 +100,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/examples/qdrant/Hybrid_Search_Legal.ipynb b/examples/qdrant/Hybrid_Search_Legal.ipynb index 4fa637f4a..ddff2eae5 100644 --- a/examples/qdrant/Hybrid_Search_Legal.ipynb +++ b/examples/qdrant/Hybrid_Search_Legal.ipynb @@ -192,7 +192,7 @@ "source": [ "### Set up your API keys:\n", "\n", - "- `GOOGLE_API_KEY`, required for using `gemini-embedding-001` embeddings \n", + "- `GEMINI_API_KEY`, required for using `gemini-embedding-001` embeddings \n", " (look up how to generate it [here](https://ai.google.dev/gemini-api/docs/api-key))\n", "\n", "- `QDRANT_API_KEY` and `QDRANT_URL` from a **free-forever** Qdrant Cloud cluster \n", @@ -211,7 +211,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", "QDRANT_API_KEY = userdata.get('QDRANT_API_KEY')\n", "QDRANT_URL = userdata.get('QDRANT_URL')" ] @@ -463,7 +463,7 @@ "from google.api_core import retry\n", "import uuid\n", "\n", - "google_client = genai.Client(api_key=GOOGLE_API_KEY)\n", + "google_client = genai.Client(api_key=GEMINI_API_KEY)\n", "\n", "@retry.Retry(timeout=300)\n", "def get_embeddings_batch(texts, task_type: str = \"RETRIEVAL_DOCUMENT\"):\n", diff --git a/examples/qdrant/Qdrant_similarity_search.ipynb b/examples/qdrant/Qdrant_similarity_search.ipynb index 0fa130a3d..66d4d49b7 100644 --- a/examples/qdrant/Qdrant_similarity_search.ipynb +++ b/examples/qdrant/Qdrant_similarity_search.ipynb @@ -135,7 +135,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { diff --git a/examples/weaviate/query-agent-as-a-tool.ipynb b/examples/weaviate/query-agent-as-a-tool.ipynb index b55f6b31a..fcc9e04ca 100644 --- a/examples/weaviate/query-agent-as-a-tool.ipynb +++ b/examples/weaviate/query-agent-as-a-tool.ipynb @@ -140,7 +140,7 @@ "source": [ "os.environ[\"WEAVIATE_URL\"] = \"\"\n", "os.environ[\"WEAVIATE_API_KEY\"] = \"\"\n", - "os.environ[\"GOOGLE_API_KEY\"] = \"\"" + "os.environ[\"GEMINI_API_KEY\"] = \"\"" ] }, { diff --git a/quickstarts/Asynchronous_requests.ipynb b/quickstarts/Asynchronous_requests.ipynb index 094a8176b..1ca98a3fb 100644 --- a/quickstarts/Asynchronous_requests.ipynb +++ b/quickstarts/Asynchronous_requests.ipynb @@ -82,7 +82,7 @@ "source": [ "## Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](../quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](../quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -96,8 +96,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY = userdata.get(\"GOOGLE_API_KEY\")\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get(\"GEMINI_API_KEY\")\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Audio.ipynb b/quickstarts/Audio.ipynb index f23eaa7d8..8cf2700ad 100644 --- a/quickstarts/Audio.ipynb +++ b/quickstarts/Audio.ipynb @@ -98,7 +98,7 @@ "source": [ "### Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -112,9 +112,9 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Authentication.ipynb b/quickstarts/Authentication.ipynb index b7f8e4926..2b8e3bc42 100644 --- a/quickstarts/Authentication.ipynb +++ b/quickstarts/Authentication.ipynb @@ -91,8 +91,8 @@ " \n", " \"You\n", "\n", - "2. Create a new secret with the name `GOOGLE_API_KEY`.\n", - "3. Copy and paste your API key into the `Value` input box of `GOOGLE_API_KEY`.\n", + "2. Create a new secret with the name `GEMINI_API_KEY`.\n", + "3. Copy and paste your API key into the `Value` input box of `GEMINI_API_KEY`.\n", "4. Toggle the button on the left to allow all notebooks access to the secret.\n" ] }, @@ -149,8 +149,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { @@ -345,13 +345,13 @@ "\n", "To store your key in an environment variable, open your terminal and run:\n", "\n", - "```export GOOGLE_API_KEY=\"YOUR_API_KEY\"```\n", + "```export GEMINI_API_KEY=\"YOUR_API_KEY\"```\n", "\n", "If you're using Python, you can add these two lines to your notebook to read the key:\n", "\n", "```\n", "import os\n", - "client = genai.Client(api_key=os.environ['GOOGLE_API_KEY'])\n", + "client = genai.Client(api_key=os.environ['GEMINI_API_KEY'])\n", "```\n", "\n", "Alternatively, if it isn't provided explicitly, the client will look for the API key.\n", @@ -363,7 +363,7 @@ "Or, if you're calling the API through your terminal using `cURL`, you can copy and paste this code to read your key from the environment variable.\n", "\n", "```\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d '{\n", diff --git a/quickstarts/Batch_mode.ipynb b/quickstarts/Batch_mode.ipynb index 86203714a..697a31a7d 100644 --- a/quickstarts/Batch_mode.ipynb +++ b/quickstarts/Batch_mode.ipynb @@ -99,7 +99,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -112,7 +112,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')" ] }, { @@ -137,7 +137,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Caching.ipynb b/quickstarts/Caching.ipynb index cb246cc7d..694fd8417 100644 --- a/quickstarts/Caching.ipynb +++ b/quickstarts/Caching.ipynb @@ -79,7 +79,7 @@ "source": [ "### Configure your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -93,8 +93,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Code_Execution.ipynb b/quickstarts/Code_Execution.ipynb index 03bf4b787..ae06a3f26 100644 --- a/quickstarts/Code_Execution.ipynb +++ b/quickstarts/Code_Execution.ipynb @@ -99,7 +99,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -112,7 +112,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')" ] }, { @@ -136,7 +136,7 @@ "source": [ "from google import genai\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Counting_Tokens.ipynb b/quickstarts/Counting_Tokens.ipynb index 3cb4e3b1f..d33882bd9 100644 --- a/quickstarts/Counting_Tokens.ipynb +++ b/quickstarts/Counting_Tokens.ipynb @@ -107,7 +107,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -120,7 +120,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')" ] }, { @@ -144,7 +144,7 @@ "source": [ "from google import genai\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Embeddings.ipynb b/quickstarts/Embeddings.ipynb index 42053a0ea..3919583b8 100644 --- a/quickstarts/Embeddings.ipynb +++ b/quickstarts/Embeddings.ipynb @@ -119,7 +119,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key or you aren't sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key or you aren't sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { diff --git a/quickstarts/Enum.ipynb b/quickstarts/Enum.ipynb index 6d8e08e09..144c900d9 100644 --- a/quickstarts/Enum.ipynb +++ b/quickstarts/Enum.ipynb @@ -79,7 +79,7 @@ "source": [ "### Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -93,8 +93,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Error_handling.ipynb b/quickstarts/Error_handling.ipynb index 71f0ce7a9..4afde7323 100644 --- a/quickstarts/Error_handling.ipynb +++ b/quickstarts/Error_handling.ipynb @@ -91,7 +91,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cells, store your API key in a Colab Secret named `GOOGLE_API_KEY`. If you don't have an API key or need help creating a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) guide." + "To run the following cells, store your API key in a Colab Secret named `GEMINI_API_KEY`. If you don't have an API key or need help creating a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) guide." ] }, { @@ -105,8 +105,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get(\"GOOGLE_API_KEY\")\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get(\"GEMINI_API_KEY\")\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/File_API.ipynb b/quickstarts/File_API.ipynb index 00d13bed3..f6d786cb8 100644 --- a/quickstarts/File_API.ipynb +++ b/quickstarts/File_API.ipynb @@ -106,7 +106,7 @@ "source": [ "#### Set up your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](./Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](./Authentication.ipynb) for an example." ] }, { @@ -120,8 +120,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get(\"GOOGLE_API_KEY\")\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get(\"GEMINI_API_KEY\")\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Function_calling.ipynb b/quickstarts/Function_calling.ipynb index 1276e7b8d..a36357aa5 100644 --- a/quickstarts/Function_calling.ipynb +++ b/quickstarts/Function_calling.ipynb @@ -97,7 +97,7 @@ "source": [ "### Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](../quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](../quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -111,8 +111,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get(\"GOOGLE_API_KEY\")\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get(\"GEMINI_API_KEY\")\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Get_started_LearnLM.ipynb b/quickstarts/Get_started_LearnLM.ipynb index ae28d919b..d8fa44ddc 100644 --- a/quickstarts/Get_started_LearnLM.ipynb +++ b/quickstarts/Get_started_LearnLM.ipynb @@ -119,7 +119,7 @@ "source": [ "## Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](../quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](../quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -133,8 +133,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Get_started_LiveAPI.ipynb b/quickstarts/Get_started_LiveAPI.ipynb index 2e9d0127f..509a9ad02 100644 --- a/quickstarts/Get_started_LiveAPI.ipynb +++ b/quickstarts/Get_started_LiveAPI.ipynb @@ -130,7 +130,7 @@ "source": [ "### Set up your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -144,7 +144,7 @@ "from google.colab import userdata\n", "import os\n", "\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')\n" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')\n" ] }, { @@ -168,7 +168,7 @@ "source": [ "from google import genai\n", "from google.genai import types\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { @@ -694,7 +694,7 @@ "\n", "MODEL = \"gemini-live-2.5-flash-preview\"\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)\n", + "client = genai.Client(api_key=GEMINI_API_KEY)\n", "\n", "async def async_enumerate(aiterable):\n", " n=0\n", diff --git a/quickstarts/Get_started_LiveAPI_tools.ipynb b/quickstarts/Get_started_LiveAPI_tools.ipynb index 625efb325..33ccb008e 100644 --- a/quickstarts/Get_started_LiveAPI_tools.ipynb +++ b/quickstarts/Get_started_LiveAPI_tools.ipynb @@ -103,7 +103,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -117,7 +117,7 @@ "from google.colab import userdata\n", "import os\n", "\n", - "os.environ['GOOGLE_API_KEY']=userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY']=userdata.get('GEMINI_API_KEY')" ] }, { diff --git a/quickstarts/Get_started_LyriaRealTime.ipynb b/quickstarts/Get_started_LyriaRealTime.ipynb index a3a3c5d9b..8c017ca97 100644 --- a/quickstarts/Get_started_LyriaRealTime.ipynb +++ b/quickstarts/Get_started_LyriaRealTime.ipynb @@ -156,7 +156,7 @@ "id": "T_C_11Lu8KjK" }, "source": [ - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -170,7 +170,7 @@ "from google.colab import userdata\n", "import os\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')" ] }, { @@ -198,7 +198,7 @@ "from google.genai import types\n", "\n", "client = genai.Client(\n", - " api_key=GOOGLE_API_KEY,\n", + " api_key=GEMINI_API_KEY,\n", " http_options={'api_version': 'v1alpha'}, # v1alpha since Lyria RealTime is only experimental\n", ")\n", "\n", diff --git a/quickstarts/Get_started_OpenAI_Compatibility.ipynb b/quickstarts/Get_started_OpenAI_Compatibility.ipynb index 4e7a49aba..1e627d6f7 100644 --- a/quickstarts/Get_started_OpenAI_Compatibility.ipynb +++ b/quickstarts/Get_started_OpenAI_Compatibility.ipynb @@ -133,15 +133,15 @@ " # Colab secrets\n", " from google.colab import userdata\n", "\n", - " GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", + " GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", "\n", "except:\n", " # enter manually your API key here if you are not using Google Colab\n", - " GOOGLE_API_KEY = \"--enter-your-API-key-here--\"\n", + " GEMINI_API_KEY = \"--enter-your-API-key-here--\"\n", "\n", "# OpenAI client\n", "client = OpenAI(\n", - " api_key=GOOGLE_API_KEY,\n", + " api_key=GEMINI_API_KEY,\n", " base_url=\"https://generativelanguage.googleapis.com/v1beta/openai/\"\n", ")" ] @@ -1395,7 +1395,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "genai_client = genai.Client(api_key=GOOGLE_API_KEY)\n", + "genai_client = genai.Client(api_key=GEMINI_API_KEY)\n", "\n", "uploaded_file = genai_client.files.upload(\n", " file=\"batch_requests.jsonl\",\n", @@ -2859,7 +2859,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "genai_client = genai.Client(api_key=GOOGLE_API_KEY)\n", + "genai_client = genai.Client(api_key=GEMINI_API_KEY)\n", "\n", "uploaded_file = genai_client.files.upload(\n", " file=\"embedding_requests.jsonl\",\n", diff --git a/quickstarts/Get_started_TTS.ipynb b/quickstarts/Get_started_TTS.ipynb index dc2380eea..68085ee78 100644 --- a/quickstarts/Get_started_TTS.ipynb +++ b/quickstarts/Get_started_TTS.ipynb @@ -95,7 +95,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -108,7 +108,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')" ] }, { @@ -151,7 +151,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Get_started_Veo.ipynb b/quickstarts/Get_started_Veo.ipynb index e969b31ab..2db01184b 100644 --- a/quickstarts/Get_started_Veo.ipynb +++ b/quickstarts/Get_started_Veo.ipynb @@ -171,7 +171,7 @@ "source": [ "### Setup your API key and initialize client\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { diff --git a/quickstarts/Get_started_imagen.ipynb b/quickstarts/Get_started_imagen.ipynb index ca51e5992..923647961 100644 --- a/quickstarts/Get_started_imagen.ipynb +++ b/quickstarts/Get_started_imagen.ipynb @@ -138,7 +138,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -151,7 +151,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')" ] }, { @@ -175,7 +175,7 @@ "source": [ "from google import genai\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Get_started_imagen_rest.ipynb b/quickstarts/Get_started_imagen_rest.ipynb index 19e8b3b8c..3a7762be6 100644 --- a/quickstarts/Get_started_imagen_rest.ipynb +++ b/quickstarts/Get_started_imagen_rest.ipynb @@ -100,7 +100,7 @@ "source": [ "## Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`." ] }, { @@ -124,7 +124,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get(\"GOOGLE_API_KEY\")" + "GEMINI_API_KEY = userdata.get(\"GEMINI_API_KEY\")" ] }, { @@ -205,7 +205,7 @@ "}\n", "\n", "response = requests.post(\n", - " f\"{url}?key={GOOGLE_API_KEY}\",\n", + " f\"{url}?key={GEMINI_API_KEY}\",\n", " headers=headers,\n", " json=data\n", ")\n", diff --git a/quickstarts/Get_started_thinking.ipynb b/quickstarts/Get_started_thinking.ipynb index 2516d7da2..ff465ae1c 100644 --- a/quickstarts/Get_started_thinking.ipynb +++ b/quickstarts/Get_started_thinking.ipynb @@ -127,7 +127,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -140,7 +140,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')" ] }, { @@ -165,7 +165,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Get_started_thinking_REST.ipynb b/quickstarts/Get_started_thinking_REST.ipynb index 04448e977..290a4f49f 100644 --- a/quickstarts/Get_started_thinking_REST.ipynb +++ b/quickstarts/Get_started_thinking_REST.ipynb @@ -72,7 +72,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -85,7 +85,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')" ] }, { @@ -122,7 +122,7 @@ "import requests\n", "\n", "MODEL_ID=\"gemini-2.5-flash-preview-04-17\" # @param [\"gemini-2.5-flash-preview-04-17\", \"gemini-2.5-pro-preview-03-25\"] {\"allow-input\":true, isTemplate: true}\n", - "url = f\"https://generativelanguage.googleapis.com/v1beta/models/{MODEL_ID}:generateContent?key={GOOGLE_API_KEY}\"" + "url = f\"https://generativelanguage.googleapis.com/v1beta/models/{MODEL_ID}:generateContent?key={GEMINI_API_KEY}\"" ] }, { diff --git a/quickstarts/Grounding.ipynb b/quickstarts/Grounding.ipynb index 4f644b1e4..beabb9848 100644 --- a/quickstarts/Grounding.ipynb +++ b/quickstarts/Grounding.ipynb @@ -106,7 +106,7 @@ "source": [ "### Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -119,7 +119,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get(\"GOOGLE_API_KEY\")" + "GEMINI_API_KEY = userdata.get(\"GEMINI_API_KEY\")" ] }, { @@ -144,7 +144,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)\n", + "client = genai.Client(api_key=GEMINI_API_KEY)\n", "\n", "MODEL_ID = \"gemini-2.5-flash\" # @param [\"gemini-2.5-flash-lite\", \"gemini-2.5-flash-lite-preview-09-2025\", \"gemini-2.5-flash\", \"gemini-2.5-flash-preview-09-2025\", \"gemini-2.5-pro\"] {\"allow-input\":true, isTemplate: true}" ] diff --git a/quickstarts/Image_out.ipynb b/quickstarts/Image_out.ipynb index 0374a8228..5206e7e98 100644 --- a/quickstarts/Image_out.ipynb +++ b/quickstarts/Image_out.ipynb @@ -150,7 +150,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -163,7 +163,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')" ] }, { @@ -188,7 +188,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/JSON_mode.ipynb b/quickstarts/JSON_mode.ipynb index 5bfbf5d74..219df869f 100644 --- a/quickstarts/JSON_mode.ipynb +++ b/quickstarts/JSON_mode.ipynb @@ -81,7 +81,7 @@ "source": [ "### Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -95,8 +95,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/New_in_002.ipynb b/quickstarts/New_in_002.ipynb index b8d5b7f64..4694b8635 100644 --- a/quickstarts/New_in_002.ipynb +++ b/quickstarts/New_in_002.ipynb @@ -120,7 +120,7 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "genai.configure(api_key=userdata.get('GOOGLE_API_KEY'))" + "genai.configure(api_key=userdata.get('GEMINI_API_KEY'))" ] }, { diff --git a/quickstarts/PDF_Files.ipynb b/quickstarts/PDF_Files.ipynb index 5ed60349c..6bc62f8ad 100644 --- a/quickstarts/PDF_Files.ipynb +++ b/quickstarts/PDF_Files.ipynb @@ -72,7 +72,7 @@ "source": [ "## Configure your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -86,8 +86,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get(\"GOOGLE_API_KEY\")\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get(\"GEMINI_API_KEY\")\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Prompting.ipynb b/quickstarts/Prompting.ipynb index 504dfa02a..371bd397d 100644 --- a/quickstarts/Prompting.ipynb +++ b/quickstarts/Prompting.ipynb @@ -80,7 +80,7 @@ "source": [ "### Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -94,8 +94,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Safety.ipynb b/quickstarts/Safety.ipynb index bc9e5f69c..e9c3e3f87 100644 --- a/quickstarts/Safety.ipynb +++ b/quickstarts/Safety.ipynb @@ -102,7 +102,7 @@ "source": [ "## Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -116,8 +116,8 @@ "from google import genai\n", "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Search_Grounding.ipynb b/quickstarts/Search_Grounding.ipynb index 25809b380..924d5e7b6 100644 --- a/quickstarts/Search_Grounding.ipynb +++ b/quickstarts/Search_Grounding.ipynb @@ -101,7 +101,7 @@ "source": [ "### Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/gemini-api-cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -115,7 +115,7 @@ "import os\n", "from google.colab import userdata\n", "\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { diff --git a/quickstarts/Spatial_understanding.ipynb b/quickstarts/Spatial_understanding.ipynb index eae40fab6..10cb707ea 100644 --- a/quickstarts/Spatial_understanding.ipynb +++ b/quickstarts/Spatial_understanding.ipynb @@ -111,7 +111,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -125,7 +125,7 @@ "from google.colab import userdata\n", "import os\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')" ] }, { @@ -150,7 +150,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Streaming.ipynb b/quickstarts/Streaming.ipynb index df632ffaf..7acc73a8e 100644 --- a/quickstarts/Streaming.ipynb +++ b/quickstarts/Streaming.ipynb @@ -99,8 +99,8 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/System_instructions.ipynb b/quickstarts/System_instructions.ipynb index 449c2c4d1..85bca0389 100644 --- a/quickstarts/System_instructions.ipynb +++ b/quickstarts/System_instructions.ipynb @@ -87,7 +87,7 @@ "id": "4Z5KfSvHCtxO" }, "source": [ - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -102,7 +102,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "client = genai.Client(api_key=userdata.get(\"GOOGLE_API_KEY\"))" + "client = genai.Client(api_key=userdata.get(\"GEMINI_API_KEY\"))" ] }, { diff --git a/quickstarts/Template.ipynb b/quickstarts/Template.ipynb index 16ab66c5f..2ad1d3baf 100644 --- a/quickstarts/Template.ipynb +++ b/quickstarts/Template.ipynb @@ -179,7 +179,7 @@ "source": [ "### Set up your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](../quickstarts/Authentication.ipynb) quickstart for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](../quickstarts/Authentication.ipynb) quickstart for an example." ] }, { @@ -193,8 +193,8 @@ "from google.colab import userdata\n", "from google import genai\n", "\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')\n", + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/Video_understanding.ipynb b/quickstarts/Video_understanding.ipynb index c32275c95..99d1d96a7 100644 --- a/quickstarts/Video_understanding.ipynb +++ b/quickstarts/Video_understanding.ipynb @@ -135,7 +135,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cell, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -148,7 +148,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')" ] }, { @@ -173,7 +173,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/gemini-robotics-er.ipynb b/quickstarts/gemini-robotics-er.ipynb index c8682825d..ecac0c57e 100644 --- a/quickstarts/gemini-robotics-er.ipynb +++ b/quickstarts/gemini-robotics-er.ipynb @@ -106,7 +106,7 @@ "source": [ "### Setup your API key\n", "\n", - "To run the following cells, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cells, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -119,7 +119,7 @@ "source": [ "from google.colab import userdata\n", "\n", - "GOOGLE_API_KEY = userdata.get(\"GOOGLE_API_KEY\")" + "GEMINI_API_KEY = userdata.get(\"GEMINI_API_KEY\")" ] }, { @@ -144,7 +144,7 @@ "from google import genai\n", "from google.genai import types\n", "\n", - "client = genai.Client(api_key=GOOGLE_API_KEY)" + "client = genai.Client(api_key=GEMINI_API_KEY)" ] }, { diff --git a/quickstarts/rest/Audio_REST.ipynb b/quickstarts/rest/Audio_REST.ipynb index 60286e2f9..5cabcc2e9 100644 --- a/quickstarts/rest/Audio_REST.ipynb +++ b/quickstarts/rest/Audio_REST.ipynb @@ -68,7 +68,7 @@ "source": [ "## Set up the environment\n", "\n", - "To run this notebook, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -92,7 +92,7 @@ "source": [ "import os\n", "from google.colab import userdata\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -231,7 +231,7 @@ "\n", "# Initial resumable request defining metadata.\n", "# The upload url is in the response headers dump them to a file.\n", - "curl \"${BASE_URL}/upload/v1beta/files?key=${GOOGLE_API_KEY}\" \\\n", + "curl \"${BASE_URL}/upload/v1beta/files?key=${GEMINI_API_KEY}\" \\\n", " -D upload-header.tmp \\\n", " -H \"X-Goog-Upload-Protocol: resumable\" \\\n", " -H \"X-Goog-Upload-Command: start\" \\\n", @@ -292,7 +292,7 @@ " echo \"Processing audio...\"\n", " sleep 5\n", " # Get the file of interest to check state\n", - " curl \"${file_uri}?key=${GOOGLE_API_KEY}\" >file_info.json 2>/dev/null\n", + " curl \"${file_uri}?key=${GEMINI_API_KEY}\" >file_info.json 2>/dev/null\n", " state=$(jq -r \".state\" file_info.json)\n", "done\n", "\n", @@ -345,7 +345,7 @@ "\n", "file_uri=$(jq -r \".file.uri\" file_info.json)\n", "\n", - "curl \"${file_uri}?key=${GOOGLE_API_KEY}\" 2>/dev/null" + "curl \"${file_uri}?key=${GEMINI_API_KEY}\" 2>/dev/null" ] }, { @@ -401,7 +401,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/files?key=$GOOGLE_API_KEY\"" + "curl \"https://generativelanguage.googleapis.com/v1beta/files?key=$GEMINI_API_KEY\"" ] }, { @@ -443,7 +443,7 @@ "\n", "file_uri=$(jq \".file.uri\" file_info.json)\n", "\n", - "curl \"${BASE_URL}/v1beta/models/gemini-2.5-flash:generateContent?key=${GOOGLE_API_KEY}\" \\\n", + "curl \"${BASE_URL}/v1beta/models/gemini-2.5-flash:generateContent?key=${GEMINI_API_KEY}\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d '{\n", @@ -503,7 +503,7 @@ "\n", "%%bash\n", "# Fetch the list of files\n", - "files_json=$(curl \"https://generativelanguage.googleapis.com/v1beta/files?key=${GOOGLE_API_KEY}\")\n", + "files_json=$(curl \"https://generativelanguage.googleapis.com/v1beta/files?key=${GEMINI_API_KEY}\")\n", "\n", "# Extract file names using jq\n", "file_names=$(echo \"$files_json\" | jq -r '.files[].name')\n", @@ -512,7 +512,7 @@ "# Loop through each file name and delete it\n", "# File names are files/abcd, so path should not include files in it if using the file name.\n", "for file_name in $file_names; do\n", - " curl --request \"DELETE\" \"https://generativelanguage.googleapis.com/v1beta/${file_name}?key=${GOOGLE_API_KEY}\"\n", + " curl --request \"DELETE\" \"https://generativelanguage.googleapis.com/v1beta/${file_name}?key=${GEMINI_API_KEY}\"\n", " echo \"Deleted file: ${file_name}\"\n", "done" ] @@ -649,7 +649,7 @@ "%%bash\n", ". vars.sh\n", "\n", - "curl \"${BASE_URL}/v1beta/models/gemini-2.5-flash:generateContent?key=${GOOGLE_API_KEY}\" \\\n", + "curl \"${BASE_URL}/v1beta/models/gemini-2.5-flash:generateContent?key=${GEMINI_API_KEY}\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d @request.json 2>/dev/null >response.json\n", diff --git a/quickstarts/rest/Caching_REST.ipynb b/quickstarts/rest/Caching_REST.ipynb index da2b05cca..72a2e977e 100644 --- a/quickstarts/rest/Caching_REST.ipynb +++ b/quickstarts/rest/Caching_REST.ipynb @@ -56,7 +56,7 @@ "\n", "### Authentication\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](../../quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named GEMINI_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](../../quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -69,7 +69,7 @@ "source": [ "import os\n", "from google.colab import userdata\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -203,7 +203,7 @@ "source": [ "%%bash\n", "\n", - "curl -X POST \"https://generativelanguage.googleapis.com/v1beta/cachedContents?key=$GOOGLE_API_KEY\" \\\n", + "curl -X POST \"https://generativelanguage.googleapis.com/v1beta/cachedContents?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -d @request.json > cache.json\n", "\n", @@ -297,7 +297,7 @@ } ], "source": [ - "!curl \"https://generativelanguage.googleapis.com/v1beta/cachedContents?key=$GOOGLE_API_KEY\"" + "!curl \"https://generativelanguage.googleapis.com/v1beta/cachedContents?key=$GEMINI_API_KEY\"" ] }, { @@ -377,7 +377,7 @@ "source": [ "%%bash\n", "\n", - "curl -X POST \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl -X POST \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", "-H 'Content-Type: application/json' \\\n", "-d '{\n", " \"contents\": [\n", @@ -450,7 +450,7 @@ "source": [ "%%bash\n", "\n", - "curl -X PATCH \"https://generativelanguage.googleapis.com/v1beta/$(cat cache_name.txt)?key=$GOOGLE_API_KEY\" \\\n", + "curl -X PATCH \"https://generativelanguage.googleapis.com/v1beta/$(cat cache_name.txt)?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -d '{\"ttl\": \"300s\"}'" ] @@ -484,7 +484,7 @@ } ], "source": [ - "!curl -X DELETE \"https://generativelanguage.googleapis.com/v1beta/$(cat cache_name.txt)?key=$GOOGLE_API_KEY\"" + "!curl -X DELETE \"https://generativelanguage.googleapis.com/v1beta/$(cat cache_name.txt)?key=$GEMINI_API_KEY\"" ] }, { diff --git a/quickstarts/rest/Embeddings_REST.ipynb b/quickstarts/rest/Embeddings_REST.ipynb index b153831e7..f81e8698d 100644 --- a/quickstarts/rest/Embeddings_REST.ipynb +++ b/quickstarts/rest/Embeddings_REST.ipynb @@ -74,7 +74,7 @@ "\n", "You can run this in Google Colab, or you can copy/paste the `curl` commands into your terminal.\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named GEMINI_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." ] }, { diff --git a/quickstarts/rest/Function_calling_REST.ipynb b/quickstarts/rest/Function_calling_REST.ipynb index e4676dea3..5b98d6e46 100644 --- a/quickstarts/rest/Function_calling_REST.ipynb +++ b/quickstarts/rest/Function_calling_REST.ipynb @@ -52,7 +52,7 @@ "\n", "You can run this in Google Colab, or you can copy/paste the `curl` commands into your terminal.\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named GEMINI_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -66,7 +66,7 @@ "import os\n", "from google.colab import userdata\n", "\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -244,7 +244,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -d '{\n", " \"contents\": {\n", @@ -433,7 +433,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -d '{\n", " \"contents\": [{\n", @@ -628,7 +628,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -d '{\n", " \"contents\": [{\n", diff --git a/quickstarts/rest/Function_calling_config_REST.ipynb b/quickstarts/rest/Function_calling_config_REST.ipynb index 8dc41eb8c..f7ac2c4de 100644 --- a/quickstarts/rest/Function_calling_config_REST.ipynb +++ b/quickstarts/rest/Function_calling_config_REST.ipynb @@ -63,7 +63,7 @@ "\n", "You can run this in Google Colab, or you can copy/paste the `curl` commands into your terminal.\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -77,7 +77,7 @@ "import os\n", "from google.colab import userdata\n", "\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -180,7 +180,7 @@ ], "source": [ "%%bash\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -d @<(echo '\n", " {\n", @@ -244,7 +244,7 @@ ], "source": [ "%%bash\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -d @<(echo '\n", " {\n", @@ -312,7 +312,7 @@ ], "source": [ "%%bash\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -d @<(echo '\n", " {\n", diff --git a/quickstarts/rest/Imagen_REST.ipynb b/quickstarts/rest/Imagen_REST.ipynb index 21dac0aa4..a3d4c0bfd 100644 --- a/quickstarts/rest/Imagen_REST.ipynb +++ b/quickstarts/rest/Imagen_REST.ipynb @@ -68,7 +68,7 @@ "source": [ "## Set up the environment\n", "\n", - "To run this notebook, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -81,7 +81,7 @@ "source": [ "import os\n", "from google.colab import userdata\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -182,7 +182,7 @@ "%%bash\n", ". vars.sh\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/imagen-3.0-generate-002:predict?key=${GOOGLE_API_KEY}\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/imagen-3.0-generate-002:predict?key=${GEMINI_API_KEY}\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d '{\n", diff --git a/quickstarts/rest/JSON_mode_REST.ipynb b/quickstarts/rest/JSON_mode_REST.ipynb index aef47b534..4bc6055a5 100644 --- a/quickstarts/rest/JSON_mode_REST.ipynb +++ b/quickstarts/rest/JSON_mode_REST.ipynb @@ -54,7 +54,7 @@ "\n", "### Authentication\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](../../quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named GEMINI_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](../../quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -77,7 +77,7 @@ }, "outputs": [], "source": [ - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -118,7 +118,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", "-H 'Content-Type: application/json' \\\n", "-d '{\n", " \"contents\": [{\n", diff --git a/quickstarts/rest/Prompting_REST.ipynb b/quickstarts/rest/Prompting_REST.ipynb index 353d7fb50..e4bca1621 100644 --- a/quickstarts/rest/Prompting_REST.ipynb +++ b/quickstarts/rest/Prompting_REST.ipynb @@ -52,7 +52,7 @@ "\n", "This notebook contains `curl` commands you can run in Google Colab, or copy to your terminal.\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named GEMINI_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -75,7 +75,7 @@ }, "outputs": [], "source": [ - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -145,7 +145,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d '{\n", @@ -338,7 +338,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${GOOGLE_API_KEY}\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${GEMINI_API_KEY}\" \\\n", " -H 'Content-Type: application/json' \\\n", " -d @request.json" ] @@ -359,7 +359,7 @@ }, "source": [ "```\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${GOOGLE_API_KEY}\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${GEMINI_API_KEY}\" \\\n", " -H 'Content-Type: application/json' \\\n", " -d '{\n", " \"contents\":[\n", @@ -458,7 +458,7 @@ ], "source": [ "%%bash\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d '{\n", @@ -509,7 +509,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d '{\n", diff --git a/quickstarts/rest/Safety_REST.ipynb b/quickstarts/rest/Safety_REST.ipynb index 400ef6400..3a20eec83 100644 --- a/quickstarts/rest/Safety_REST.ipynb +++ b/quickstarts/rest/Safety_REST.ipynb @@ -72,7 +72,7 @@ "\n", "This notebook contains `curl` commands you can run in Google Colab, or copy to your terminal.\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named GEMINI_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -106,7 +106,7 @@ }, "outputs": [], "source": [ - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -186,7 +186,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d @request.json 2> /dev/null | tee response.json" @@ -259,7 +259,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d @request.json 2> /dev/null > response.json" diff --git a/quickstarts/rest/Search_Grounding.ipynb b/quickstarts/rest/Search_Grounding.ipynb index 48f45ab6d..62a931e13 100644 --- a/quickstarts/rest/Search_Grounding.ipynb +++ b/quickstarts/rest/Search_Grounding.ipynb @@ -50,7 +50,7 @@ "source": [ "### Authentication\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](../../quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named GEMINI_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](../../quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -72,7 +72,7 @@ "source": [ "import os\n", "from google.colab import userdata\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -112,7 +112,7 @@ ], "source": [ "%%bash\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H \"Content-Type: application/json\" \\\n", " -d '{\n", " \"contents\": [\n", diff --git a/quickstarts/rest/Streaming_REST.ipynb b/quickstarts/rest/Streaming_REST.ipynb index 46af9a941..5b72ac8db 100644 --- a/quickstarts/rest/Streaming_REST.ipynb +++ b/quickstarts/rest/Streaming_REST.ipynb @@ -59,7 +59,7 @@ "\n", "This notebook contains `curl` commands you can run in Google Colab, or copy to your terminal.\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named GEMINI_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -82,7 +82,7 @@ }, "outputs": [], "source": [ - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -125,7 +125,7 @@ } ], "source": [ - "!curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse&key=${GOOGLE_API_KEY}\" \\\n", + "!curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse&key=${GEMINI_API_KEY}\" \\\n", " -H 'Content-Type: application/json' \\\n", " --no-buffer \\\n", " -d '{ \"contents\":[{\"parts\":[{\"text\": \"Write a cute story about cats.\"}]}]}'" diff --git a/quickstarts/rest/System_instructions_REST.ipynb b/quickstarts/rest/System_instructions_REST.ipynb index 43e4959cb..f5db6a79c 100644 --- a/quickstarts/rest/System_instructions_REST.ipynb +++ b/quickstarts/rest/System_instructions_REST.ipynb @@ -52,7 +52,7 @@ "\n", "You can run this in Google Colab, or you can copy/paste the `curl` commands into your terminal.\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named GOOGLE_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named GEMINI_API_KEY. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -75,7 +75,7 @@ }, "outputs": [], "source": [ - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -152,7 +152,7 @@ "source": [ "%%bash\n", "\n", - "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", "-H 'Content-Type: application/json' \\\n", "-d '{ \"system_instruction\": {\n", " \"parts\":\n", @@ -200,7 +200,7 @@ ], "source": [ "%%bash\n", - "curl -s \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GOOGLE_API_KEY\" \\\n", + "curl -s \"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d '{\n", diff --git a/quickstarts/rest/Video_REST.ipynb b/quickstarts/rest/Video_REST.ipynb index bbd989180..dc245e232 100644 --- a/quickstarts/rest/Video_REST.ipynb +++ b/quickstarts/rest/Video_REST.ipynb @@ -68,7 +68,7 @@ "source": [ "## Set up the environment\n", "\n", - "To run this notebook, your API key must be stored it in a Colab Secret named `GOOGLE_API_KEY`. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." + "To run this notebook, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you are running in a different environment, you can store your key in an environment variable. See [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) to learn more." ] }, { @@ -93,7 +93,7 @@ "import os\n", "from google.colab import userdata\n", "\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -223,7 +223,7 @@ ". vars.sh\n", "\n", "# Create the \"new upload\" request by providing the relevant metadata.\n", - "curl \"${BASE_URL}/upload/v1beta/files?key=${GOOGLE_API_KEY}\" \\\n", + "curl \"${BASE_URL}/upload/v1beta/files?key=${GEMINI_API_KEY}\" \\\n", " -D upload-header.tmp \\\n", " -H \"X-Goog-Upload-Protocol: resumable\" \\\n", " -H \"X-Goog-Upload-Command: start\" \\\n", @@ -344,7 +344,7 @@ "\n", "file_uri=$(jq -r \".file.uri\" file_info.json)\n", "\n", - "curl \"${file_uri}?key=${GOOGLE_API_KEY}\" 2>/dev/null" + "curl \"${file_uri}?key=${GEMINI_API_KEY}\" 2>/dev/null" ] }, { @@ -389,7 +389,7 @@ " echo \"Processing video...\"\n", " sleep 5\n", " # Get the file of interest to check state\n", - " curl \"${file_uri}?key=${GOOGLE_API_KEY}\" >file_info.json 2>/dev/null\n", + " curl \"${file_uri}?key=${GEMINI_API_KEY}\" >file_info.json 2>/dev/null\n", " state=$(jq -r \".state\" file_info.json)\n", "done\n", "\n", @@ -450,7 +450,7 @@ "\n", "model=\"gemini-2.5-flash\"\n", "\n", - "curl \"${BASE_URL}/v1beta/models/${model}:generateContent?key=${GOOGLE_API_KEY}\" \\\n", + "curl \"${BASE_URL}/v1beta/models/${model}:generateContent?key=${GEMINI_API_KEY}\" \\\n", " -H 'Content-Type: application/json' \\\n", " -X POST \\\n", " -d '{\n", diff --git a/quickstarts/websockets/Get_started_LiveAPI.ipynb b/quickstarts/websockets/Get_started_LiveAPI.ipynb index f01aa8fdc..73fd8102a 100644 --- a/quickstarts/websockets/Get_started_LiveAPI.ipynb +++ b/quickstarts/websockets/Get_started_LiveAPI.ipynb @@ -135,7 +135,7 @@ "source": [ "### Constants\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -147,7 +147,7 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -171,7 +171,7 @@ "\n", "HOST='generativelanguage.googleapis.com'\n", "\n", - "URI = f'wss://{HOST}/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent?key={os.environ[\"GOOGLE_API_KEY\"]}'" + "URI = f'wss://{HOST}/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent?key={os.environ[\"GEMINI_API_KEY\"]}'" ] }, { diff --git a/quickstarts/websockets/Get_started_LiveAPI_tools.ipynb b/quickstarts/websockets/Get_started_LiveAPI_tools.ipynb index 0b1192ae6..05c74541c 100644 --- a/quickstarts/websockets/Get_started_LiveAPI_tools.ipynb +++ b/quickstarts/websockets/Get_started_LiveAPI_tools.ipynb @@ -77,7 +77,7 @@ "id": "NSUz31fds3Z9" }, "source": [ - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -89,7 +89,7 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "GOOGLE_API_KEY = userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY = userdata.get('GEMINI_API_KEY')" ] }, { @@ -149,7 +149,7 @@ }, "outputs": [], "source": [ - "uri = f\"wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent?key={GOOGLE_API_KEY}\"\n", + "uri = f\"wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent?key={GEMINI_API_KEY}\"\n", "\n", "model = \"models/gemini-2.0-flash-live-001\"" ] diff --git a/quickstarts/websockets/Get_started_LyriaRealTime_websockets.ipynb b/quickstarts/websockets/Get_started_LyriaRealTime_websockets.ipynb index cac9cdb20..de8779797 100644 --- a/quickstarts/websockets/Get_started_LyriaRealTime_websockets.ipynb +++ b/quickstarts/websockets/Get_started_LyriaRealTime_websockets.ipynb @@ -163,7 +163,7 @@ "id": "T_C_11Lu8KjK" }, "source": [ - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example." ] }, { @@ -175,7 +175,7 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "os.environ['GOOGLE_API_KEY'] = userdata.get('GOOGLE_API_KEY')" + "os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY')" ] }, { @@ -200,7 +200,7 @@ "\n", "HOST='generativelanguage.googleapis.com'\n", "\n", - "URI = f'wss://{HOST}/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateMusic?key={os.environ[\"GOOGLE_API_KEY\"]}'" + "URI = f'wss://{HOST}/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateMusic?key={os.environ[\"GEMINI_API_KEY\"]}'" ] }, { diff --git a/quickstarts/websockets/LiveAPI_streaming_in_colab.ipynb b/quickstarts/websockets/LiveAPI_streaming_in_colab.ipynb index e16ce6974..bcac5b9ae 100644 --- a/quickstarts/websockets/LiveAPI_streaming_in_colab.ipynb +++ b/quickstarts/websockets/LiveAPI_streaming_in_colab.ipynb @@ -70,7 +70,7 @@ "source": [ "### Set up\n", "\n", - "To run the following cell, your API key must be stored in a Colab Secret named `GOOGLE_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../../quickstarts/Authentication.ipynb) for an example." + "To run the following cell, your API key must be stored in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](../../quickstarts/Authentication.ipynb) for an example." ] }, { @@ -82,7 +82,7 @@ "outputs": [], "source": [ "from google.colab import userdata\n", - "GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')" + "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')" ] }, { @@ -705,7 +705,7 @@ "\n", "\n", "HOST = 'generativelanguage.googleapis.com' # @param {type:'string'}\n", - "API_KEY = GOOGLE_API_KEY\n", + "API_KEY = GEMINI_API_KEY\n", "MODEL = 'models/gemini-2.0-flash-live-001' # @param {type:'string'}\n", "INITIAL_REQUEST_TEXT = \"what's up?\" # @param {type:'string'}\n", "\n",