Our docs got a refresh! Check out the new content and improved navigation. For detailed API reference see our Python SDK docs and TypeScript SDK.
Description
Integrations

Portkey AI Gateway

Using Patronus with Portkey

The following tutorial describes how to use Patronus with the Portkey AI Gateway

  1. Add Patronus API Key to Portkey

Navigate to the Plugins page in Settings, click on the edit button for Patronus and add your Patronus API key.

  1. Add Patronus' Guardrail Checks & Actions Navigate to the Guardrails page, click Create, and select a Patronus eval. Set actions and create the Guardrail!

  1. Add Guardrail ID to a Config and Make Your Request

When you save a Guardrail, you’ll get an associated Guardrail ID - add this ID to the after_request_hooks params in your Portkey Config.
Save this Config and pass it along with any Portkey request you’re making!

Your requests are now guarded by your Patronus evaluators and you can see the Verdict and any action you take directly on Portkey logs! More detailed logs for your requests will also be available on your Patronus dashboard.

On this page