← Back to Interdict AI

Quick Start · about 3 minutes

Protect your first LLM request.

Use the matching Interdict endpoint to preserve your provider's SDK and request shape. The example below is for OpenAI or xAI Chat Completions.

1

Create an Interdict API key

In your account, generate an Interdict API key. Store it as INTERDICT_API_KEY.

2

Add a provider key

Save a credential for OpenAI, Anthropic, Gemini, xAI/Grok, or Ollama Cloud in the account dashboard so Interdict can securely forward approved requests.

3

Use the matching provider endpoint

Use your Interdict key and the route for your provider. OpenAI and xAI keep their Chat Completions shape.

import OpenAI from 'openai'

const client = new OpenAI({
  apiKey: process.env.INTERDICT_API_KEY,
  baseURL: 'https://www.interdictai.com/api/proxy/v1',
})

const completion = await client.chat.completions.create({
  model: 'gpt-4o-mini',
  messages: [{ role: 'user', content: 'My SSN is 123-45-6789' }],
})

Provider endpoint map

Run the example above in your own application using fictional data, then inspect the response and your Interdict audit log. Your model provider may charge for the request. Never commit provider or Interdict keys to source control.

Back to account →