const openai = new OpenAI({
// #1: Switch to the Auto API key
apiKey: process.env.AUTO_API_KEY,
// #2: Add the Auto base URL
baseURL: "https://api.auto.venki.dev/api/v1",
// #3: Add the OpenAI API key - optional, see Bringing Your Own Keys for more details
defaultHeaders: {
"X-OpenAI-Api-Key": process.env.OPENAI_API_KEY,
},
});
const chatResponse = await openai.chat.completions.create(
{
model: "gpt-4o"
messages: ...,
},
{
// #4: Add a prompt ID
headers: {
"X-Auto-Prompt-Id": "summarize-webpage",
},
}
);