Gateway endpoints
Replace your LLM provider’s base URL with the corresponding Trident gateway endpoint:
Your existing API key for the underlying provider is stored on your Trident project (see the Gateway settings page) and is used by Trident to forward requests on your behalf. Trident never logs or returns your provider API keys.
Enable the gateway
Authenticate gateway requests using HTTP Basic auth with your Trident project key pair — the samepublicKey:secretKey credentials you use for the REST API. Pass the Base64-encoded pair in the Authorization header. Optionally, include x-vouch-agent to tag which agent is making the request.
- OpenAI — TypeScript
- OpenAI — Python
- Anthropic — TypeScript
- Anthropic — Python
Required and optional headers
Pass these headers on every request to the gateway. Your HTTP client’sdefaultHeaders (or equivalent) is the most convenient place to set them once.
Store your provider API keys
Before routing requests through the gateway, save your LLM provider API keys in Settings → Gateway. Trident encrypts and stores them server-side, then uses them to forward your requests to OpenAI or Anthropic. You never need to pass provider keys in gateway requests — Trident handles that automatically.Blocked requests
When the firewall blocks a request, the gateway returns an HTTP451 response instead of forwarding the call to the LLM provider. The response body is a JSON object:
451 responses from the gateway gracefully. Inspect the error field to distinguish a firewall block from a malformed request error (400) or an authentication failure (401).
Firewall scan modes
The gateway supports two scan modes:
Fast mode uses regex-based and keyword-pattern matching to catch the highest-confidence threats with minimal latency impact. Full mode runs a deeper ML-based scan pipeline with higher accuracy and a broader set of detectors.