Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a Unity project that needs Gemini, use Firebase AI Logic for Unity. Google’s standalone GenAI SDK language list does not include Unity or C#, while Firebase documents a Unity SDK for connecting to Gemini. You can also call Gemini through REST, but a production client must not contain a hardcoded API key; use a backend proxy or Firebase AI Logic instead.

Is there an official Google GenAI SDK for Unity?

Google’s standalone GenAI SDK documentation lists Python, JavaScript/TypeScript, Go, and Java. It does not list Unity or C#. For a Unity client, Firebase AI Logic is Google’s documented SDK route for supported Gemini features.

Firebase AI Logic can connect to either the Gemini Developer API or the Agent Platform Gemini API, formerly Vertex AI. Choose based on your account and billing setup, required model and features, security or compliance needs, and geographic availability. Provider selection can be changed when both are configured, but the initialization code differs.

Choose an integration route

Route Best fit Key considerations
Firebase AI Logic Unity SDK A Unity mobile or web app using supported Gemini features through Firebase’s client SDK and proxy service. Check the current model and feature support, Firebase provider setup, and availability for your target platform.
Gemini API REST A custom HTTP-level integration or a service-side connection. Do not put a production API key in a shipped Unity client. For a client app, put requests behind a backend proxy or use Firebase AI Logic.
Google GenAI SDK Projects written in one of the languages listed in Google’s supported libraries documentation. Unity/C# is not listed as an officially supported language.

Firebase AI Logic is the most direct documented path when Unity itself needs to call supported Gemini features. A custom REST integration gives you more control over HTTP behavior, but also makes you responsible for the service-side security design.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set up Firebase AI Logic in Unity

  1. Add Firebase to the Unity project. Follow the Firebase Unity setup guide to configure the Firebase project and platform files. Its package list includes FirebaseAI.unitypackage.
  2. Import the required Firebase packages. Download and extract the Firebase Unity SDK, then use Unity’s custom package importer to import FirebaseAI and FirebaseAppCheck, as described in the Firebase AI Logic Unity guide.
  3. Initialize the backend and create a model. The guide’s example for the Gemini Developer API is:
using Firebase;
using Firebase.AI;

var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.GoogleAI());
var model = ai.GetGenerativeModel(modelName: "gemini-3.8-flash");

The model identifier shown here is the one in Firebase’s current quickstart example, not a permanent recommendation. Use the current guide’s namespaces, signatures, and model identifier when implementing: SDK APIs and model names can change.

  1. Choose a model for the capability you need. Consult Firebase’s model reference for supported models, features, release stages, and lifecycle dates. Select by the required capability and check that the model is available for your chosen provider and target.
  2. Make prompts and model configuration changeable where practical. Firebase’s getting-started material recommends considering Remote Config or server prompt templates so you can revise configuration without releasing a new app build.
  3. Configure protections and launch checks. Set up App Check, then review provider configuration, billing, quotas, regional availability, data handling, model capabilities, and platform support before shipping.

Protect credentials and control abuse

Google’s API key security guidance says not to hardcode API keys in production web or mobile apps because users can extract keys from client-side code. If you choose direct REST calls, route them through a backend proxy that keeps credentials server-side. Firebase AI Logic provides a proxy service and client SDKs for mobile and web apps.

App Check adds a layer of protection against unauthorized clients, but it is not a replacement for project access controls, quota limits, or abuse monitoring. Configure those controls alongside App Check rather than treating it as the only safeguard.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check platform and model support before shipping

Firebase’s Unity platform guidance lists desktop workflow support for a subset of Firebase products, including AI Logic, but labels desktop support beta and intended for development workflows—not publicly shipped code. The Firebase AI package release notes also provide platform support information. Verify the current matrix against your Unity version and shipping target; support for one workflow does not establish that every target is production-ready.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Model names, capabilities, and lifecycle status can change. The model reference also identifies capabilities not supported in Firebase AI Logic, including grounding with Google Image Search, fine-tuning, embeddings generation, and semantic retrieval. Confirm that your required feature is supported before building around a model or publishing an app.

Common integration decisions

  • Unity client needs Gemini: Start with Firebase AI Logic and the Firebase Unity SDK.
  • You need a custom HTTP implementation: REST is possible, but keep the production key on a backend rather than in the Unity build.
  • You need a particular model feature: Check the current Firebase model reference for provider, capability, and lifecycle support.
  • You plan to ship on desktop: Treat Firebase’s documented desktop support as a development workflow, not a public-shipping guarantee.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.