Integration · OpenAI
OpenAI Prompt Management
Stop hardcoding GPT-5.4 prompts. Store them in PromptForge, version every tweak, and fetch via REST API, no redeployment needed.
PromptForge + OpenAI in one file
Version, template, and serve OpenAI prompts via REST API. Connect PromptForge to GPT-5.4 in minutes: fetch interpolated system prompts from one endpoint and pass them directly to the OpenAI SDK.
- 1
- Fetch your versioned, interpolated prompt from the PromptForge REST API with a single
fetch()call. - 2
- Pass the returned
contentstring directly to the OpenAI SDK as the system prompt, no transformation needed. - 3
- Update the prompt in the PromptForge dashboard anytime, running applications pick up the change on the next request. No redeployment required.
import OpenAI from "openai";
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
async function fetchPrompt(userName: string, product: 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: { user_name: userName, product },
}),
}
);
const { content } = await res.json();
return content as string;
}
// Prompt template in PromptForge (e.g.):
// You are assisting {{user_name}} with {{product}}. Help with their questions.
// 1. Fetch your versioned system prompt with dynamic variables
const content = await fetchPrompt("Alice", "WidgetPro");
// 2. Pass the interpolated prompt to GPT-5.4
const completion = await openai.chat.completions.create({
model: "gpt-5.4",
messages: [
{ role: "system", content },
{ role: "user", content: "What features does WidgetPro have?" },
],
});
console.log(completion.choices[0].message.content);OpenAI + PromptForge in Three Steps
Add a prompt management layer to your OpenAI integration without refactoring your application.
Write your GPT-4o prompt template
Create a system prompt in PromptForge using {{variable}} syntax for dynamic parts: {{tone}}, {{user_context}}, or {{task}}. One template, unlimited call variations.
Version every change automatically
Pin your OpenAI API calls to a specific version number so GPT-4o behaviour stays consistent between tweaks. View a line-by-line diff of any two versions and roll back in one click.
Fetch and inject at runtime
One HTTP call to PromptForge returns your fully interpolated prompt. Pass it as the `system` message to `openai.chat.completions.create`. Ship prompt improvements without redeployment.
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.
- 1k API requests/month
- 1 prompt
- Unlimited versions
- Dynamic variables
- Version pinning
- API key management
No charge until your trial ends
- 10k API requests/month
- 5 prompt
- Unlimited versions
- Dynamic variables
- Version pinning
- API key management
No charge until your trial ends
- 100k API requests/month
- 25 prompt
- Unlimited versions
- Dynamic variables
- Version pinning
- API key management
No charge until your trial ends
- 500k API requests/month
- 100 prompt
- Unlimited versions
- Dynamic variables
- Version pinning
- API key management
Questions? Contact us
OpenAI + PromptForge: Common Questions
Specific answers for developers integrating PromptForge with OpenAI.
How do I use PromptForge with GPT-4o function calling?
Store the system prompt that defines your function-calling behaviour in PromptForge with template variables. Fetch it at runtime and pass it as the `system` message alongside your `tools` array in `openai.chat.completions.create`. The function definitions stay in code (they are structural, not natural language); only the instructional system prompt lives in PromptForge where it benefits from versioning and diff tracking.
Can I version system prompts separately from user message templates?
Yes. You can create separate PromptForge prompts for each distinct template, one for the system message, one for a repeating user-message scaffold, and so on. Each has its own version history and API slug. Fetch them independently and compose them in your application layer, keeping each piece independently versioned.
Does PromptForge work with the OpenAI Assistants API?
The OpenAI Assistants API stores instructions on the Assistant object itself, not per-request. The workflow is: fetch the latest instruction text from PromptForge, then call `openai.beta.assistants.update({ assistant_id, instructions: content })` to update the assistant. You gain PromptForge's full version history and diff view over every instruction change made to your assistant.
How do I handle OpenAI streaming with PromptForge-managed prompts?
The PromptForge API call is a standard one-time `fetch` that completes in under 50 ms on average. Once you have the prompt content, pass it into the OpenAI SDK exactly as you normally would, including `stream: true`. PromptForge has no impact on the streaming call itself because it only supplies the prompt text before the OpenAI request begins.