← nopea.tech
ScaneaConsenteaMaskeaBundlesPricing
Providers

Google Gemini

Wrap @google/generative-ai's generateContent the same way -- retries and redaction apply before the request ever reaches Google.

← All recipes
import { Maskea, retries, pii } from "@nopeatech/maskea";
import { GoogleGenerativeAI } from "@google/generative-ai";

const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY!);
const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" });

const maskea = new Maskea()
  .use(retries({ max: 3 }))
  .use(pii({ mode: "mask" }));

const generate = maskea.wrap(model.generateContent.bind(model));

const result = await generate("Summarize this ticket: ...");

Checked against the shipped @nopeatech/maskea API. Full docs at nopea.tech/maskea/docs.

More in Providers

OpenAI + exponential backoff →Anthropic Claude with retries + secret masking →Claude fallback when GPT-5 is rate limited →OpenRouter (OpenAI-compatible endpoint) →