{"id":29115666,"url":"https://github.com/googleapis/go-genai","last_synced_at":"2026-05-05T02:04:43.556Z","repository":{"id":267676627,"uuid":"899744525","full_name":"googleapis/go-genai","owner":"googleapis","description":"Google Gen AI Go SDK provides an interface for developers to integrate Google's generative models into their Go applications.","archived":false,"fork":false,"pushed_at":"2026-04-28T22:29:12.000Z","size":1830,"stargazers_count":1101,"open_issues_count":42,"forks_count":138,"subscribers_count":38,"default_branch":"main","last_synced_at":"2026-04-29T00:09:21.908Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/google.golang.org/genai","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googleapis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-06T23:16:53.000Z","updated_at":"2026-04-28T02:43:27.000Z","dependencies_parsed_at":"2026-02-26T04:01:31.751Z","dependency_job_id":null,"html_url":"https://github.com/googleapis/go-genai","commit_stats":null,"previous_names":["googleapis/go-genai"],"tags_count":66,"template":false,"template_full_name":null,"purl":"pkg:github/googleapis/go-genai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgo-genai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgo-genai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgo-genai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgo-genai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleapis","download_url":"https://codeload.github.com/googleapis/go-genai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgo-genai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-29T11:13:11.224Z","updated_at":"2026-04-30T00:01:16.507Z","avatar_url":"https://github.com/googleapis.png","language":"Go","funding_links":[],"categories":["SDKs \u0026 Libraries"],"sub_categories":["Go"],"readme":"![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/googleapis/go-genai)\n[![Go Reference](https://pkg.go.dev/badge/google.golang.org/genai.svg)](https://pkg.go.dev/google.golang.org/genai)\n\n# Google Gen AI Go SDK\n\nThe Google Gen AI Go SDK provides an interface for developers to integrate\nGoogle's generative models into their Go applications. It supports the\n[Gemini Developer API](https://ai.google.dev/gemini-api/docs) and\n[Gemini Enterprise Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform)\nAPIs.\n\nThe Google Gen AI Go SDK enables developers to use Google's state-of-the-art\ngenerative AI models (like Gemini) to build AI-powered features and applications.\nThis SDK supports use cases like:\n- Generate text from text-only input\n- Generate text from text-and-images input (multimodal)\n- ...\n\nFor example, with just a few lines of code, you can access Gemini's multimodal\ncapabilities to generate text from text-and-image input.\n\n```go\nparts := []*genai.Part{\n  {Text: \"What's this image about?\"},\n  {InlineData: \u0026genai.Blob{Data: imageBytes, MIMEType: \"image/jpeg\"}},\n}\nresult, err := client.Models.GenerateContent(ctx, \"gemini-2.5-flash\", []*genai.Content{{Parts: parts}}, nil)\n```\n\n## Installation and usage\n\nAdd the SDK to your module with `go get google.golang.org/genai`.\n\n## Create Clients\n\n### Imports\n```go\nimport \"google.golang.org/genai\"\n```\n\n### Gemini API Client:\n```go\nclient, err := genai.NewClient(ctx, \u0026genai.ClientConfig{\n\tAPIKey:   apiKey,\n\tBackend:  genai.BackendGeminiAPI,\n})\n```\n\n### Gemini Enterprise Agent Platform Client:\n```go\nclient, err := genai.NewClient(ctx, \u0026genai.ClientConfig{\n\tProject:  project,\n\tLocation: location,\n\tBackend:  genai.BackendEnterprise,\n})\n```\n\n### (Optional) Using environment variables:\n\nYou can create a client by configuring the necessary environment variables.\nConfiguration setup instructions depends on whether you're using the Gemini\nDeveloper API or the Gemini API in Gemini Enterprise Agent Platform.\n\n**Gemini Developer API:** Set `GOOGLE_API_KEY` as shown below:\n\n```bash\nexport GOOGLE_API_KEY='your-api-key'\n```\n\n**Gemini API on Gemini Enterprise Agent Platform:** Set `GOOGLE_GENAI_USE_ENTERPRISE`,\n`GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION`, as shown below:\n\n```bash\nexport GOOGLE_GENAI_USE_ENTERPRISE=true\nexport GOOGLE_CLOUD_PROJECT='your-project-id'\nexport GOOGLE_CLOUD_LOCATION='us-central1'\n```\n\n```go\nclient, err := genai.NewClient(ctx, \u0026genai.ClientConfig{})\n```\n\n## License\n\nThe contents of this repository are licensed under the\n[Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fgo-genai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleapis%2Fgo-genai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fgo-genai/lists"}