Skip to main content
Inviolet integrates with the OpenAI surface on three layers: the OpenAI SDK (server-side agents calling /responses or /chat/completions), the Assistants API (function-calling tools), and ChatGPT Enterprise custom actions invoked from the chat UI.

Why it matters

OpenAI tool calls share the same intent-extraction need as Claude. Wrapping the SDK at the call site yields the same decision feed entry shape — so dashboards, audit exports, and policies work identically across LLM providers.

1. Wrap the OpenAI SDK

import { InViolet } from "@inviolet/sdk"
import OpenAI from "openai"

const inviolet = new InViolet({ apiKey: process.env.INVIOLET_API_KEY! })
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY! })

const decision = await inviolet.intent.evaluate({
  userId: "user_2pX9...",
  toolCall: { name: "search_orders", arguments: { customer_id: "12345" } },
  dataSourceId: "snowflake_prod",
})

if (decision.outcome === "denied") {
  throw new Error(`call_denied: ${decision.intent_label}`)
}

const completion = await openai.chat.completions.create({
  model: "gpt-4.1",
  messages: [{ role: "user", content: "Find this customer's last 3 orders." }],
  tools: [{ type: "function", function: { name: "search_orders" /* ... */ } }],
})

2. ChatGPT Enterprise custom actions

ChatGPT Enterprise actions are OpenAPI-described HTTP calls. Point the action’s base URL at the Inviolet gateway path — Inviolet evaluates intent, then proxies the request to the underlying API:
# action.yaml served to ChatGPT
servers:
  - url: https://gateway.inviolet.ai/proxy/your-app
paths:
  /orders/{customer_id}:
    get:
      operationId: searchOrders
      parameters:
        - name: customer_id
          in: path
          required: true
          schema: { type: string }
Every action invocation now flows through Inviolet’s intent extractor before reaching your-app.

3. Verify

Open the decision feed. Trigger an action from ChatGPT Enterprise (or a tool call from the SDK). The event arrives with intent_class and the matched purpose. Provider doesn’t matter — Inviolet’s view is unified.