Docs · Developers

Drop TrustGate into your stack in a minute.

TrustGate AI is a self-hosted AI security gateway that inspects and governs every surface your agents touch — prompts, RAG, tools, and egress — inside your own infrastructure. It's drop-in OpenAI-compatible, so you keep your existing code and simply route it through the gateway. These quickstarts show how.

Quickstart

Install, set your key, and you're governed.

No rewrites. Install the SDK for your language — or just swap the base URL — and your current OpenAI, Anthropic, LangChain, or Vercel AI code runs unchanged, now inspected, audited, and cost-governed.

PythonNode.jsBase URL swapcURLJava alpha.NET alpha
$ pip install trustgate
import trustgate
trustgate.patch_all()        # your existing OpenAI / LangChain code is now governed
$ npm install @trustgate/sdk
import { TrustGate } from '@trustgate/sdk';
new TrustGate({ apiKey: process.env.TRUSTGATE_API_KEY });
// Vercel AI SDK / OpenAI / Anthropic calls now route through TrustGate
any OpenAI-compatible client
# Any OpenAI-compatible client — just swap the base URL
export OPENAI_BASE_URL=https://api.trustgate.io/v1
export OPENAI_API_KEY=$TRUSTGATE_API_KEY
point the base URL at your gateway
curl https://api.trustgate.io/v1/chat/completions \
  -H "Authorization: Bearer $TRUSTGATE_API_KEY" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello"}]}'
dependency ai.trustgate:trustgate-sdk
try (TrustGateClient client = TrustGateClient.builder()
        .apiKey(System.getenv("TRUSTGATE_API_KEY"))
        .build()) {
    var res = client.chat().completions().create(
        ChatCompletionRequest.builder().model("gpt-4o")
            .addMessage(ChatMessage.user("Hello")).build());
}
$ dotnet add package TrustGate.Sdk
await using var client = new TrustGateClient(new TrustGateClientOptions {
    ApiKey = Environment.GetEnvironmentVariable("TRUSTGATE_API_KEY") });
var res = await client.Chat.Completions.CreateAsync(new ChatCompletionRequest {
    Model = "gpt-4o", Messages = new[] { new ChatMessage("user", "Hello") } });

Works with OpenAI, Anthropic, Vercel AI SDK, LangChain, and any OpenAI-compatible client. Self-hosted? Point the base URL at your own gateway instead.

SDKs & integrations

Every stack, one gateway.

Python and Node are the fastest paths in; any OpenAI-compatible client works via a base-URL swap. Java and .NET clients are in alpha.

01

Python

Import and call patch_all() — your existing OpenAI, Anthropic, or LangChain code is governed with no rewrites.

pip install trustgate
02

Node.js / TypeScript

Initialise the SDK once and your Vercel AI SDK, OpenAI, and Anthropic calls route through the gateway.

npm install @trustgate/sdk
03

Base URL swap

Any OpenAI-compatible client works out of the box — point the base URL at the gateway and add your key.

OPENAI_BASE_URL → gateway
04

n8n / no-code

In your workflow tool, set the HTTP node's base URL to the gateway and add your key as a Bearer token.

HTTP node · Bearer token
05

Java

First-class client with builder-style requests. In alpha today — request access to join the early cohort.

alpha · request access
06

.NET

Async client for .NET services. In alpha today — request access to join the early cohort.

alpha · request access
Run it yourself

Self-host in your own VPC — or fully air-gapped.

TrustGate runs entirely inside your infrastructure, so your prompts, documents, and tool calls never leave your network. Deploy the control plane in three commands, then point any SDK at your gateway instead of the hosted endpoint.

Zero data egress. Runs in your VPC on AWS, GCP, or Azure — or fully air-gapped, with GPU options. See the self-hosted deployment guide for the full architecture, or read how it works.

Ready to route your first request?

Request an API key to start integrating, or book a walkthrough with our team.