const response = await fetch('https://api.llmtune.io/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.LLMTUNE_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'meta-llama/Llama-3.3-70B-Instruct',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Draft a product update email.' }
],
temperature: 0.5,
max_tokens: 300
})
});
const data = await response.json();
console.log(data.choices[0].message.content);