← All integrations

Integration · Google

Google Prompt Management

Keep Gemini 3.1 Pro system instructions out of your codebase. Version them in PromptForge and fetch them live with any variable interpolated.

Integration Example

PromptForge + Google in one file

Version, template, and serve Google Gemini prompts via REST API. Manage `systemInstruction` strings for Gemini 3.1 Pro in PromptForge, update them live without redeploying your application.

  1. 1
  2. Fetch your versioned, interpolated prompt from the PromptForge REST API with a single fetch() call.
  3. 2
  4. Pass the returned content string directly to the Google SDK as the system prompt, no transformation needed.
  5. 3
  6. Update the prompt in the PromptForge dashboard anytime, running applications pick up the change on the next request. No redeployment required.
integration.ts
TypeScript
import { GoogleGenerativeAI } from "@google/generative-ai";

const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY!);

async function fetchPrompt(domain: string, audience: string) {
  const res = await fetch(
    "https://www.promptforge-app.com/api/v1/prompts/your-prompt-id",
    {
      method: "POST",
      headers: {
        Authorization: "Bearer pfk_your_api_key",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        version: "latest",
        variables: { domain, audience },
      }),
    }
  );
  const { content } = await res.json();
  return content as string;
}

// Prompt template in PromptForge (e.g.):
//   You are a {{domain}} expert. Explain concepts for {{audience}}.
// 1. Fetch the system instruction with dynamic variables
const content = await fetchPrompt("healthcare", "patients");

// 2. Pass as systemInstruction to Gemini 3.1 Pro
//    Change domain or audience by updating the PromptForge template,
//    the model gets the new instruction on the next request
const model = genAI.getGenerativeModel({
  model: "gemini-3.1-pro",
  systemInstruction: content,
});

const result = await model.generateContent(
  "Explain the benefits of regular exercise."
);
console.log(result.response.text());
How It Works

Google + PromptForge in Three Steps

Add a prompt management layer to your Google integration without refactoring your application.

Step 1

Create your Gemini system instruction template

Gemini's `systemInstruction` parameter defines the model's persona and task context. Write it in PromptForge with {{domain}}, {{audience}}, or any variable your use case requires.

Step 2

Track every instruction change with diffs

Gemini models are sensitive to system instruction wording. PromptForge records every edit, shows a line-by-line diff, and lets you pin API calls to a specific version for reproducible outputs.

Step 3

Fetch and pass to `getGenerativeModel`

Call the PromptForge API once per session, then pass the returned `content` string to `genAI.getGenerativeModel({ systemInstruction: content })`. Zero code changes required when you update the instruction.

Features

Powerful Prompt Management Features for AI Developers

From simple prompt storage to production-ready APIs with version control, dynamic variables, rollback, and a public gallery.

Dynamic Variables

Use {{variable}} syntax to create reusable prompt templates. Pass different values via API for endless customization across any LLM.

Instant Prompt API

RESTful API endpoint ready in seconds. Fetch any prompt with version pinning and variable interpolation. No redeployment needed.

Rollback with Diff Checker

View a line-by-line diff of every change and roll back to any previous version in one click. Never lose a working prompt again.

Publish to Gallery

Share your best prompts with the community in the public gallery. Get discovered by other developers and grow your personal library.

Start for free, upgrade anytime

No credit card required to get started. Paid plans include a 14-day free trial.

HobbyNo credit card
  • 1k API requests/month
  • 1 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start Managing My Prompts
Starter
14-day free trial
$9/month

No charge until your trial ends

  • 10k API requests/month
  • 5 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-day Free Trial
Most Popular
Pro
14-day free trial
$29/month

No charge until your trial ends

  • 100k API requests/month
  • 25 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-day Free Trial
Business
14-day free trial
$49/month

No charge until your trial ends

  • 500k API requests/month
  • 100 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-day Free Trial

Questions? Contact us

FAQ

Google + PromptForge: Common Questions

Specific answers for developers integrating PromptForge with Google.

How do I use PromptForge with Gemini's multi-modal inputs?

Gemini's multi-modal capability applies to the `contents` array (images, video, audio alongside text). The system instruction is always text-only, store and version that in PromptForge as normal. Your application still handles assembling the multi-modal `contents` array; PromptForge only manages the instructional text that shapes the model's behaviour across all input types.

Can I manage system instructions for Gemini 2.0 Flash and Gemini 2.0 Pro separately?

Yes, create a separate PromptForge prompt for each model variant. Use slugs like `gemini-flash-support-agent` and `gemini-pro-analyst`. This lets you optimise and version each instruction independently, since Flash and Pro have different capability profiles and often benefit from different instructional styles and length budgets.

Does PromptForge work with Gemini's chat session (multi-turn)?

Yes. Fetch the system instruction from PromptForge before starting the chat session, then pass it to `getGenerativeModel({ systemInstruction: content })`. The model object is created once per session, so the PromptForge fetch is a one-time call. All subsequent `sendMessage` calls within the session use the same versioned instruction automatically.

How do I use PromptForge with Vertex AI (Google Cloud)?

The Vertex AI SDK uses the same `systemInstruction` parameter. Fetch the prompt text from PromptForge using your server-side API key, then pass the returned string to `vertexai.getGenerativeModel({ model, systemInstruction: content })`. Your Vertex AI authentication (ADC or service account) is entirely separate from the PromptForge Bearer token, both are set as environment variables in your Cloud Run or Compute Engine environment.