@crowdstrike/aidr-openai
v1.0.0
Published
A wrapper around the OpenAI TypeScript library that wraps the Responses API with CrowdStrike AIDR
Downloads
88
Readme
CrowdStrike AIDR + OpenAI TypeScript API Library
A wrapper around the OpenAI TypeScript library that wraps the Responses API with CrowdStrike AIDR. Supports Node.js v22 and greater.
Installation
npm install @crowdstrike/aidr-openaiUsage
import { AidrOpenAI } from "@crowdstrike/aidr-openai";
const client = new AidrOpenAI({
apiKey: process.env.OPENAI_API_KEY,
aidrApiKey: process.env.AIDR_API_KEY,
});
const response = await client.responses.create({
model: "gpt-4o-mini",
instructions: "You are a helpful assistant.",
input: "Are semicolons optional in JavaScript?",
});
console.log(response.output_text);Azure OpenAI
To use this library with Azure OpenAI,
use the AidrAzureOpenAI class with an Azure base URL.
import { AidrAzureOpenAI } from "@crowdstrike/aidr-openai";
const client = new AidrAzureOpenAI({
baseURL: "https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/",
apiKey: process.env.AZURE_OPENAI_API_KEY,
aidrApiKey: process.env.AIDR_API_KEY,
});
const response = await client.responses.create({
model: "gpt-4o-mini",
instructions: "You are a helpful assistant.",
input: "Are semicolons optional in JavaScript?",
});
console.log(response.output_text);