AI gateway · Optimization · Security
Optimize your AI. Protect every request.
Improve prompts, replace unnecessary LLM calls with code, switch to free models, and block prompt injection — all through one AI gateway.

- OpenAI-compatible API
- OpenAI, Anthropic, Gemini, Azure
- Review changes before applying
- Request-level visibility
Capabilities
One gateway. Four ways to improve your AI.
1Optimize
Better prompts. Smarter models. Lower costs.
ModelGate flags oversized prompts and premium models on simple tasks, replays real requests through a cheaper model to score agreement before you switch, and measures cost per call after you change it.
Prompt changes are recommendations you apply in your code.
See it in the demo
2Replace with code
Some AI calls don’t need AI.
For narrow tasks — fixed labels, extraction, JSON reshaping — with 50+ recorded calls, ModelGate generates code from 20 of them and tests it on the rest. It’s suggested only if it matches 95% of 30 or more calls it never saw. You review it as a pull request.
See it in the demo
3Go free
Use free models when they fit.
When code can’t do the task, ModelGate tests small open-weight models — permissive licences, pinned revisions — against the same held-out answers before suggesting one.
No per-call model API fee or key. You host it, so compute and latency are yours — and ModelGate’s 30% fee applies to the estimated saving for 90 days.
See it in the demo
4Protect
Stop malicious instructions before they reach your model.
User messages, retrieved documents and tool results are scored for injection patterns. In enforce mode a high-risk request gets a 403 before any provider call; every incident is logged with masked context.
A heuristic: it catches common attack families, not every phrasing.
See it in the demo
Also in the gateway: request-level cost logs, an exact cache and model routing, spend limits and secret/PII scans, and reliability checks. Caching, routing, code generation and enforce mode are paid-plan features.
Up close
Some LLM calls should be an if { statement }
Ticket triage on gpt-4o, replaced by generated code — checked against the model’s own answers first.
openai.chat.completions.create(…)const priority = replacement(ticket.body);Labelling tickets “urgent” or “normal”: generated from 20 recorded calls, then run in a sandbox on 150 it never saw — 146 matched (97.3%). Below 95% on 30+ unseen calls, nothing is suggested. Illustrative counts.
See the actual generated code
const res = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{ role: "system", content: "Reply with one word: urgent or normal." },
{ role: "user", content: ticket.body },
],
});
const priority = res.choices[0].message.content;export function replacement(input: string): string {
const text = input.toLowerCase();
const rules = [
{
"label": "urgent",
"any": ["outage", "is down", "can't log in", "charged twice", "data loss"],
"none": ["not urgent"],
},
];
for (const r of rules) {
if (r.any.some((k) => text.includes(k)) && !r.none.some((k) => text.includes(k))) return r.label;
}
return "normal";
}
// where the LLM call was:
const priority = replacement(ticket.body);TypeScript is what gets tested. The Python version is a port ModelGate doesn’t run.
Only narrow tasks qualify. More examples: image checks, a free open model, a blocked injection →
How it works
Connect once. Approve every change.
Step 1
Connect your AI application
Point your client at the OpenAI-compatible gateway to observe and manage every LLM request.
Step 2
Find what costs you money
See expensive models, repeated requests and calls plain code could handle, priced per request.
Step 3
Optimize with control
Switch on routing and caching when you're ready, or review proposed code changes before merging.
Setup guide →What we store, and how →How ModelGate compares →Questions →
Pricing
A base fee, plus a share of what it saves.
14 days free from the day you add a card. Cancel anytime.
On both plans
- + 30% of realized savings from caching and routing, measured per request.
- + 30% of savings from changes made from our suggestions, for 3 months each (estimated for code replacements; can be turned off).
- Reliability add-on, optional: $49/month + $0.50 per active test above 20 a month.
Every saving is labelled: measured when it happened at the gateway, estimated for code replacements and suggestions you haven’t made yet. Full pricing and billing terms →
See what ModelGate finds in your traffic.
Connect with a base URL change. Nothing changes until you approve it.
Start optimizingNot ready? Watch this.

Built by Raz Dagan — system engineer with a background in physics, mathematics and AI. LinkedIn · info@modelgatehq.com