Zapier
Add Trappr security monitoring to your Zapier AI actions using the Webhooks by Zapier or Code by Zapier step — no custom apps needed.
Overview
Zapier's native OpenAI integration doesn't expose a custom base URL, so the recommended approach is to replace the OpenAI action with a Webhooks by Zapier → POST step that calls the Trappr Gateway directly. The gateway is fully OpenAI API-compatible, so the request body and response structure are identical.
Setup
In your Zap editor, add a new action step. Search for Webhooks by Zapierand select the POST event. This lets you make a fully custom HTTP request.
Set the following fields:
| Field | Value |
|---|---|
| URL | https://gateway.trappr.net/v1/chat/completions |
| Payload Type | JSON |
| Headers — Authorization | Bearer cht_gw_XXXX |
| Headers — Content-Type | application/json |
In the Data field, enter the OpenAI-compatible JSON body. Use Zapier field mapping for dynamic content:
{
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "{{zap_field_content}}"
}
],
"temperature": 0.5
}Run the Zap test. The LLM response comes back in the webhook response body — map choices[0].message.content to your downstream steps. Confirm the call appears in Trappr → Gateway → Logs.
Using Code by Zapier
If you prefer to keep the logic in a code step, use Code by Zapier → JavaScript:
const response = await fetch("https://gateway.trappr.net/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer " + inputData.trappr_key,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gpt-4o",
messages: [
{ role: "system", content: "You are a support assistant." },
{ role: "user", content: inputData.user_message },
],
}),
});
const data = await response.json();
return { reply: data.choices[0].message.content };Parsing the response
The Trappr Gateway returns the exact same response format as the OpenAI API. Map the completion content using:
choices → 0 → message → content