Skip to content

API references

Access comprehensive API documentation for Genkit in your preferred programming language. These references provide detailed information about all available methods, classes, interfaces, and configuration options.

Genkit Go is one module, github.com/firebase/genkit/go, split across the packages below. Godoc for each is on pkg.go.dev; the guide column is the narrative page that explains when to reach for it.

PackageWhat’s in itGuide
genkitInit, DefineFlow, DefineStreamingFlow, DefineTool, Generate, GenerateData, GenerateDataStream, Handler, HandlerFunc, and the genkit.With* optionsFlows, Serve flows over HTTP
aiThe generation types (Message, Part, ModelRequest, ModelResponse), tool and prompt types (ToolContext, Tool, Prompt), retrievers, embedders, and the ai.With* request optionsGenerating content, Tool calling
coreAction context: ActionContext, WithActionContext, FromContext, ContextProvider, RequestDataPassing information through context
core/statusError classification: the status vocabulary, Errorf, PublicErrorf, Of, HTTPCodeError types
core/apiThe Action, BidiAction, and Registry interfaces that transports and plugins are written againstWriting plugins
ai/exp, genkit/exp, ai/exp/localstorePreview: agents, sessions and snapshots, and the context.Context tool signatureAgents, API stability channels
core/x/streamingPreview: StreamManager and the in-memory implementationDurable streaming
plugins/...Model, vector store, and observability providers, one subpackage eachIntegrations

Deprecations are marked in godoc, so check the symbol page before you adopt an option: ai.WithMiddleware, for example, is marked Deprecated: Use WithUse instead.

View Go API Reference

You can also read the same reference offline with go doc, which is often faster than the website:

Terminal window
go doc github.com/firebase/genkit/go/genkit Handler
go doc -all github.com/firebase/genkit/go/ai | less
  • GitHub Issues: Report bugs and request features in the Genkit repository
  • Discord: Join community discussions on the Genkit Discord
  • Stack Overflow: Ask questions using the genkit tag