USE CASES Six scenarios · before vs. after

Contain the risks. Unlock the capabilities.

Six scenarios — three problems PromptGate quietly solves (keys, costs, PII), three capabilities it unlocks (one-click MCP, multi-provider routing, central observability). Each shown as a Before / After diff.

01 · RISK · KEY LEAK

Hard-coded API key in the codebase

The OpenAI key sits right next to the React component. It lands in Git, in the bundle, on a contractor's laptop — every commit a permanent exposure.

App.jsx · pushed to GitHub
const client = new OpenAI({  apiKey: "sk-proj-abc123…"});await client.chat.completions.create({…});
App.jsx · with PromptGate PromptGate
const client = new OpenAI({  baseURL: "https://gw.acme.io/api/<uuid>/v1",  apiKey: process.env.PG_TOKEN  // pg_live_…});
02 · RISK · OFFBOARDING

The departing engineer who issued every key

A senior dev leaves. Their personal OpenAI key powered the team chatbot, the eval pipeline and a forgotten cron. Nobody knows which is which — revoke breaks production.

Friday 18:00 · we revoke the key
$ openai keys revoke sk-proj-abc…# 14 services start returning 401chatbot.prod  ❌  eval-pipeline  ❌whose-cron-is-this  ❌  status-bot  ❌
Friday 18:00 · with PromptGate PromptGate
$ pg tokens revoke ada@acme.io# Only Ada's tokens are revoked.Other team tokens keep working —every service is auditable, per-owner.
03 · RISK · COST BLOWUP

The retry loop that drained a quarter's budget

A test harness hits GPT-4 in a while(true) because someone forgot a break. Eleven hours later, $11,200 burned. The invoice arrives two months in.

3am · billing@openai pings the CTO
while (true) {  await openai.chat({ model: "gpt-4o" });}  // 11h × $1 020/h = $11 200🔥 OpenAI: invoice paid in advance
3am · with PromptGate PromptGate
while (true) {  await openai.chat({ model: "gpt-4o" });}  // PG: monthly_budget_usd: 500✓ Calls return 422 after $500. Sleep.
04 · CAPABILITY · MCP EXPOSURE

Turn any HTTP API into an MCP tool in one click

You want Claude Code to talk to your internal billing API. The traditional answer is a custom MCP server. The PromptGate answer is: paste the OpenAPI URL, attach a credential, point the agent at the resulting MCP URL.

Without PromptGate · custom MCP server
# Write 200 LOC: tool defs, auth, schemasclass BillingMcpServer:  tools = [ /* hand-mapped per endpoint */ ]  # then host it, monitor it, scale it…
With PromptGate · one configuration PromptGate
# Paste OpenAPI URL in the PG UI$ claude --mcp-add billing \    https://gw.acme.io/mcp/<uuid>/billing✓ 18 tools auto-discovered. Auth: PG token.
05 · CAPABILITY · MULTI-PROVIDER ROUTING

A/B between Claude and GPT without touching the app

You want to send long inputs to Claude (cheaper per million tokens) and short ones to GPT-4o-mini (lower latency). The traditional answer is a router service. The PromptGate answer is a YAML rule on the endpoint.

App-side: hand-rolled router
const provider = msg.length > 8000  ? anthropicClient   // refactor SDKs,  : openaiClient;     // keys, retries…await provider.call({ … });
With PromptGate · YAML on the endpoint PromptGate
# Routing rules · per endpoint:- when: input_tokens > 8000  use:  anthropic:claude-sonnetdefault: openai:gpt-4o-mini
06 · CAPABILITY · REVERSIBLE REDACTION

Personalised replies without sending PII to the LLM

The personalised-reply feature wants the customer's email and name in the prompt. Sending them raw is a GDPR landmine. PromptGate substitutes opaque tokens on the way out and the real values back on the way in.

Outbound prompt body
prompt = f"""Reply to {user.email} about case {case_id}.Customer name: {user.full_name}."""  // sent raw to OpenAI
Outbound prompt · with PromptGate PromptGate
prompt = f"""Reply to [[EMAIL_001]] about case [[ID_002]].Customer name: [[NAME_003]]."""  // PG re-substitutes on the way back

Consolidate every AI call through one gate.

Pull the image, point your SDK at your gateway, and stop choosing between security, capability and budget.

Install Community Edition Explore features →