import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.GETPROFILE_API_KEY,
baseURL: 'https://api.yourserver.com/v1',
defaultHeaders: {
'X-GetProfile-Id': "student-456",
'X-Upstream-Key': process.env.OPENAI_API_KEY,
},
});
// Tutoring session
const response = await client.chat.completions.create({
model: 'gpt-5',
messages: [
{
role: 'system',
content: 'You are a patient tutor. Adapt your explanations to the student\'s learning style.',
},
{
role: 'user',
content: 'I still don\'t understand conditional statements in Python.',
},
],
});
// GetProfile injects student's skill level, learning style, and past attempts