GitHub
github.com › googleapis › go-genai
GitHub - googleapis/go-genai: Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications. · GitHub
May 22, 2026 - The Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications. It supports the Gemini Developer API and Gemini Enterprise Agent Platform APIs.
Starred by 1.1K users
Forked by 152 users
Languages Go
GitHub
github.com › claudiocandio › gemini-api
GitHub - claudiocandio/gemini-api: Golang API wrapper for the Gemini Exchange REST API
package main import ( "encoding/json" "fmt" "github.com/claudiocandio/gemini-api" ) func main() { api := gemini.New( false, // if this is false, it will use Gemini Sandox site: <https://api.sandbox.gemini.com> // if this is true, it will use Gemini Production site: <https://api.gemini.com> "MyGeminiApiKey", // GEMINI_API_KEY "MyGeminiApiSecret", // GEMINI_API_SECRET ) // check more api methods in private.go & public.go accountDetail, err := api.AccountDetail() if err != nil { fmt.Printf("Error AccountDetail: %s\n", err) return } j, err := json.MarshalIndent(&accountDetail, "", " ") if err != nil { fmt.Printf("Error MarshalIndent: %s\n", err) } fmt.Printf("%s", j) }
Author claudiocandio
Videos
12:07
Gemini API with Python - Getting Started Tutorial - YouTube
46:16
Accelerate your development with the Gemini API - YouTube
14:42
5 practical Gemini API uses for developers - YouTube
05:32
Gemini AI API with Go Golang Tutorial - YouTube
13:40
How to Use Gemini AI API for Beginners ✦ Google Gemini AI API ...
How to Use Google Gemini API
GitHub
github.com › jyap808 › go-gemini
GitHub - jyap808/go-gemini: Gemini API in Golang
package main import ( "fmt" "github.com/jyap808/go-gemini" ) const ( API_KEY = "YOUR_API_KEY" API_SECRET = "YOUR_API_SECRET" ) func main() { // Gemini client gemini := gemini.New(API_KEY, API_SECRET) // Get markets markets, err := gemini.GetMarkets() fmt.Println(err, markets) }
Author jyap808
DEV Community
dev.to › pradumnasaraf › building-an-ai-powered-cli-with-golang-and-google-gemini-45a1
Building an AI-Powered CLI with Golang and Google Gemini - DEV Community
August 27, 2024 - Now, let's work on the API side of things. Let's Import packages for Google Gemini API as well as other necessary for logging and os level tasks. Here is a complete list. import ( "context" "log" "os" "github.com/google/generative-ai-go/genai" "github.com/spf13/cobra" "google.golang.org/api/option" )
Reddit
reddit.com › r/golang › working with gemini api in go
r/golang on Reddit: working with gemini api in go
March 20, 2024 -
ive been wanting to use the gemini api in some projects i have but the documentation is not very helpful and provides barely any information in go while other languages are very well documented in the official gemini api documentation. anyone who knows how it it can be used please help
Top answer 1 of 3
3
https://ai.google.dev/tutorials/go_quickstart
2 of 3
3
Thats a nice example! If your operating on any GCP compute service like GCE or Cloud Run, you dont need to authenticate like that - gcp compute services have metadata server which client will pull from. Other helpful tip: genai.Part is an interface - so you can use type assertion to convert to strings as needed. If you need RAG either use an OSS or MatchingEngine now known as Vector Search. Powerful stuff. You'll also need Gecko for embeddings.
Go Packages
pkg.go.dev › google.golang.org › genai
genai package - google.golang.org/genai - Go Packages
3 weeks ago - The Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications. It supports the Gemini Developer API and Gemini Enterprise Agent Platform APIs.
Medium
leogtzr.medium.com › calling-google-gemini-ai-from-the-terminal-with-go-076097510dfd
Calling Google Gemini AI from the terminal with Go | by Leo Gutiérrez | Medium
May 4, 2024 - You will need an API Key to call Gemini, you can get it here: https://ai.google.dev/gemini-api/docs/api-key · 2. Store it in an environmental variable. I have it in my ˜/.bashrc: ... Note: If you use ZSH, you can put it in the ~/.zshrc and load it with the same command shown above. ... package main import ( "bufio" "context" "fmt" "log" "os" "strings" "time" "github.com/google/generative-ai-go/genai" "google.golang.org/api/option" ) func printModelResponse(resp *genai.GenerateContentResponse) {…
Eli Bendersky
eli.thegreenplace.net › 2023 › using-gemini-models-from-go
Using Gemini models from Go - Eli Bendersky's website
package main import ( "context" "encoding/json" "fmt" "log" "os" "github.com/google/generative-ai-go/genai" "google.golang.org/api/option" ) func main() { ctx := context.Background() client, err := genai.NewClient(ctx, option.WithAPIKey(os.Getenv("API_KEY"))) if err != nil { log.Fatal(err) } defer client.Close() model := client.GenerativeModel("gemini-pro-vision") imgData1, err := os.ReadFile("../images/turtle1.png") if err != nil { log.Fatal(err) } imgData2, err := os.ReadFile("../images/turtle2.png") if err != nil { log.Fatal(err) } prompt := []genai.Part{ genai.ImageData("png", imgData1), genai.ImageData("png", imgData2), genai.Text("Describe the difference between these two pictures, with scientific detail"), } resp, err := model.GenerateContent(ctx, prompt...) if err != nil { log.Fatal(err) } bs, _ := json.MarshalIndent(resp, "", " ") fmt.Println(string(bs)) }
Liu Houliang
liuhouliang.com › en › post › go_gemini
Use Google Gemini API in Go - Liu Houliang
February 19, 2024 - Golang · Gemini is a series of multimodal generative AI models developed by Google. Gemini models can accept text and image in prompts, depending on what model variation you choose, and output text responses. The legacy PaLM models accept text-only and output text responses.
Google AI
ai.google.dev › gemini api › getting started with gemini api
Getting started with Gemini API | Google AI for Developers
import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({}); const interaction = await ai.interactions.create({ model: "gemini-3.5-flash", input: "Explain how AI works in a few words", }); console.log(interaction.output_text); curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \ -H "x-goog-api-key: $GEMINI_API_KEY" \ -H 'Content-Type: application/json' \ -H "Api-Revision: 2026-05-20" \ -d '{ "model": "gemini-3.5-flash", "input": "Explain how AI works in a few words" }'
Go Packages
pkg.go.dev › github.com › claudiocandio › gemini-api
gemini package - github.com/claudiocandio/gemini-api - Go Packages
package main import ( "encoding/json" "fmt" "github.com/claudiocandio/gemini-api" ) func main() { api := gemini.New( false, // false uses Gemini Sandox site - true uses Gemini Production site "MyGeminiApiKey", // GEMINI_API_KEY "MyGeminiApiSecret", // GEMINI_API_SECRET ) // check more api.nameAPI() in private.go & public.go accountDetail, err := api.AccountDetail() if err != nil { fmt.Printf("Error AccountDetail: %s\n", err) return } j, err := json.MarshalIndent(&accountDetail, "", " ") if err != nil { fmt.Printf("Error MarshalIndent: %s\n", err) } fmt.Printf("%s", j) }
GitHub
github.com › google › generative-ai-go
GitHub - google/generative-ai-go: Go SDK for Google Generative AI · GitHub
With Gemini 2.0, we took the chance to create a single unified SDK for all developers who want to use Google's GenAI models (Gemini, Veo, Imagen, etc).
Starred by 856 users
Forked by 101 users
Languages Go 98.7% | Shell 1.3%
PixelsTech
pixelstech.net › home › articles › gemini example with go
Gemini Example with Go | PixelsTech
December 15, 2024 - To interact with Google's Gemini LLM using Go, developers can leverage the official Go SDK. The process involves initializing a genai.Client with an API key, then selecting a specific generative model such as "gemini-1.5-flash-latest". After optionally setting parameters like Temperature to control output randomness, content generation is initiated by calling model.GenerateContent with the desired text prompt.
Google Cloud
cloud.google.com › client libraries › generative language api v1 - package cloud.google.com/go/ai/generativelanguage/apiv1 (v0.19.0)
Generative Language API v1 - Package cloud.google.com/go/ai/generativelanguage/apiv1 (v0.19.0) | Go client libraries | Google Cloud Documentation
The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different ...
GitHub
github.com › Limit-LAB › go-gemini
GitHub - Limit-LAB/go-gemini: Go Gemini - A Go SDK for Google Gemini LLM · GitHub
Starred by 18 users
Forked by 4 users
Languages Go
Go Packages
pkg.go.dev › github.com › google › generative-ai-go › genai
genai package - github.com/google/generative-ai-go/genai - Go Packages
May 2, 2025 - package main import ( "context" "fmt" "log" "os" "github.com/google/generative-ai-go/genai" "google.golang.org/api/option" ) func main() { ctx := context.Background() client, err := genai.NewClient(ctx, option.WithAPIKey(os.Getenv("GEMINI_API_KEY"))) if err != nil { log.Fatal(err) } defer client.Close() model := client.GenerativeModel("gemini-1.5-flash") cs := model.StartChat() cs.History = []*genai.Content{ { Parts: []genai.Part{ genai.Text("Hello, I have 2 dogs in my house."), }, Role: "user", }, { Parts: []genai.Part{ genai.Text("Great to meet you.
Pipedream
pipedream.com › apps › google-gemini › integrations › go
Integrate the Google Gemini API with the Go API - Pipedream
Setup the Google Gemini API trigger to run a workflow which integrates with the Go API. Pipedream's integration platform allows you to integrate Google Gemini and Go remarkably fast. Free for developers.