Documentation Index Fetch the complete documentation index at: https://mintlify.com/firebase/genkit/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start
Get up and running with Genkit in under a minute. Choose your preferred language and follow the steps below.
JavaScript/TypeScript
Go
Python
Prerequisites
Node.js 20 or higher
npm or yarn
Installation
Install Genkit and Google AI plugin
npm install genkit @genkit-ai/google-genai
Install the Genkit CLI
npm install -g genkit-cli
Get an API key
Get a Google AI API key from Google AI Studio . Set it as an environment variable: export GOOGLE_GENAI_API_KEY = "your-api-key"
Your First Genkit App Create a file called index.ts (or index.js): import { genkit } from 'genkit' ;
import { googleAI } from '@genkit-ai/google-genai' ;
const ai = genkit ({ plugins: [ googleAI ()] });
const { text } = await ai . generate ({
model: googleAI . model ( 'gemini-2.5-flash' ),
prompt: 'Why is Firebase awesome?'
});
console . log ( text );
Run Your App TypeScript (tsx)
Node.js (native)
JavaScript
You should see the AI-generated response printed to your console! Launch the Developer UI The Genkit Developer UI helps you test and debug your AI flows: genkit start -- npx tsx index.ts
Open your browser to the URL shown in the terminal (usually http://localhost:4000) to access the Developer UI. Next Steps
Build Your First Flow Learn how to create deployable AI workflows
Add Tool Calling Enable your AI to use external functions and APIs
Structured Output Generate type-safe JSON responses
Deploy to Production Ship your AI features to Cloud Run, Firebase, or anywhere
Prerequisites Installation
Initialize your Go module
mkdir genkit-app
cd genkit-app
go mod init example/genkit-app
Install Genkit for Go
go get github.com/firebase/genkit/go
Install the Genkit CLI
curl -sL cli.genkit.dev | bash
Get an API key
Get a Google AI API key from Google AI Studio . Set it as an environment variable: export GEMINI_API_KEY = "your-api-key"
Your First Genkit App Create a file called main.go: package main
import (
" context "
" fmt "
" github.com/firebase/genkit/go/ai "
" github.com/firebase/genkit/go/genkit "
" github.com/firebase/genkit/go/plugins/googlegenai "
)
func main () {
ctx := context . Background ()
g := genkit . Init ( ctx , genkit . WithPlugins ( & googlegenai . GoogleAI {}))
answer , err := genkit . GenerateText ( ctx , g ,
ai . WithModelName ( "googleai/gemini-2.5-flash" ),
ai . WithPrompt ( "Why is Go a great language for AI applications?" ),
)
if err != nil {
fmt . Println ( "could not generate: %s " , err )
}
fmt . Println ( answer )
}
Run Your App export GEMINI_API_KEY = "your-api-key"
go run main.go
You should see the AI-generated response printed to your console! Launch the Developer UI The Genkit Developer UI helps you test and debug your AI flows: genkit start -- go run main.go
Open your browser to the URL shown in the terminal (usually http://localhost:4000) to access the Developer UI. Next Steps
Define Flows Create deployable AI workflows with tracing
Add Tools Give your AI the ability to call functions
Structured Data Generate type-safe Go structs from AI models
HTTP Endpoints Expose flows as HTTP endpoints
The Python SDK is currently in Alpha . APIs may change, and some features are still under development.
Prerequisites
Python 3.10 or higher
uv package manager (recommended)
Installation
Install uv package manager
curl -LsSf https://astral.sh/uv/install.sh | sh
Create a new project
mkdir genkit-app
cd genkit-app
uv init
Install Genkit and Google GenAI plugin
uv add genkit genkit-google-genai
Get an API key
Get a Google AI API key from Google AI Studio . Set it as an environment variable: export GOOGLE_GENAI_API_KEY = "your-api-key"
Your First Genkit App Create a file called main.py: from genkit import Genkit
from genkit.plugins.google_genai import GoogleGenAI, gemini_2_0_flash
ai = Genkit(
plugins = [GoogleGenAI()],
model = gemini_2_0_flash,
)
response = await ai.generate( prompt = "Tell me a joke" )
print (response.text)
Run Your App export GOOGLE_GENAI_API_KEY = "your-api-key"
uv run python main.py
You should see the AI-generated response printed to your console! Launch the Developer UI The Genkit Developer UI helps you test and debug your AI flows: genkit start -- uv run python main.py
Install the Genkit CLI first: curl -sL cli.genkit.dev | bash
Open your browser to the URL shown in the terminal (usually http://localhost:4000) to access the Developer UI. Next Steps
Define Flows Create deployable AI workflows with full tracing
Tool Calling Build agents that can call external functions
Structured Output Generate Pydantic models from AI responses
Deploy with Flask Expose flows as HTTP endpoints
Common Next Steps
Regardless of which language you chose, here are some common next steps:
Explore Model Providers Connect to OpenAI, Anthropic, Ollama, and more
Learn Core Concepts Understand flows, tools, prompts, and the Genkit architecture
Try Examples Explore interactive examples and sample applications
Join the Community Get help and share ideas with other developers
Need Help?
If you run into any issues: