Request Logs

Record production data to train and improve your models’ performance.

Request logs are a powerful tool to understand your data. Even better, you can import recorded logs directly into your training datasets, making it simple to train on real-world data collected in production.

We recommend gathering request logs for both base and fine-tuned models. Fryday provides several flexible options for recording your requests.

Proxy

Fryday offers a /chat/completions endpoint that is fully compatible with OpenAI, allowing you to use features like tool calls seamlessly.

Integrating the Proxy and Logging Requests Here’s how to get started:

  1. Add an OpenAI key to your project in the project settingsarrow-up-right page.

  2. Set the authorization token in your request to be your Fryday API key.

  3. Set the destination URL of your request to be https://api.fryday.ai/v1/chat/completions or if you're using the OpenAI SDK, set the base URL as https://api.fryday.ai/v1

  4. (Optional) Add a Prompt ID: Include the prompt ID using the X-Prompt-ID header to help track and identify specific prompts. Check the example on how to do this.

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();

Let me know if this works for you!

Last updated