Does anyone have an example? Chat GPT gave me something but I’m getting 404s.
const response = await fetch('https://api.groq.com/v1/engines/llama3/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${env.GROQ_API_KEY}`
},
body: JSON.stringify({
prompt,
// maxTokens: 150000, // Customize as needed
temperature: 0.5, // Customize as needed
topP: 1.0, // Customize as needed
n: 1, // Number of completions to generate
stop: null // Optional stopping sequence
})
});
anyone know how to fix? The official sdk is overly complex and I just want to make fetch requests.