Interface GoogleGenAIOptions

Google Gen AI SDK's configuration options.

See GoogleGenAI for usage samples.

interface GoogleGenAIOptions {
    apiKey?: string;
    apiVersion?: string;
    enterprise?: boolean;
    googleAuthOptions?: GoogleAuthOptions<AnyAuthClient>;
    httpOptions?: HttpOptions;
    location?: string;
    project?: string;
    vertexai?: boolean;
}

Properties

apiKey?: string

The API Key, required for Gemini API clients.

Required on browser runtimes.

apiVersion?: string

Optional. The API version to use.

If unset, the default API version will be used.

enterprise?: boolean

Optional. Determines whether to use the Vertex AI or the Gemini API.

When true, the Gemini Enterprise Agent Platform API will used. When false, the Gemini API will be used. When both enterprise and vertexai are set, and they have different values, an Error will be thrown.

If unset, default SDK behavior is to use the Gemini API service.

googleAuthOptions?: GoogleAuthOptions<AnyAuthClient>

Optional. Authentication options defined by the by google-auth-library for Vertex AI clients.

GoogleAuthOptions interface in google-auth-library-nodejs.

Only supported on Node runtimes, ignored on browser runtimes.

httpOptions?: HttpOptions

Optional. A set of customizable configuration for HTTP requests.

location?: string

Optional. The Google Cloud project location for Vertex AI clients.

Only supported on Node runtimes, ignored on browser runtimes.

project?: string

Optional. The Google Cloud project ID for Vertex AI clients.

Find your project ID: https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects

Only supported on Node runtimes, ignored on browser runtimes.

vertexai?: boolean

Optional. Determines whether to use the Vertex AI (now Gemini Enterprise Agent Platform) or the Gemini API. The enterprise flag is recommended instead.

When true, the Vertex AI API will used. When false, the Gemini API will be used. When both enterprise and vertexai are set, and they have different values, an Error will be thrown.

If unset, default SDK behavior is to use the Gemini API service.