Request Logs
Record production data to train and improve your models’ performance.
Proxy
Example
import OpenAI from "openai";
// Initialize OpenAI client with API key
const openai = new OpenAI({
apiKey: process.env.FRYDAY_API_KEY, // Replace with your actual API key
baseURL: "https://api.fryday.ai/v1", // Fryday's base URL
});
async function createChatCompletion() {
try {
const chatCompletion = await openai.chat.completions.create({
messages: [
{ role: "system", content: "You are an assistant that helps users answer simple questions." },
{ role: "user", content: "What is the capital of France?" }
],
model: "gpt-4o-mini", // Replace with your model name
headers: {
"X-Prompt-ID": "your_prompt_id_here"
},
});
console.log(chatCompletion);
} catch (error) {
console.error("Error creating chat completion:", error);
}
}
createChatCompletion();Last updated