const response = await fetch("https://api.terminal.fyi/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TERMINAL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gemma-4-31b",
service_tier: "flex",
messages: [
{
role: "user",
content: "Summarize this overnight evaluation run for the platform team.",
},
],
max_tokens: 8000,
}),
signal: AbortSignal.timeout(1_800_000),
});
if (!response.ok) throw new Error(await response.text());
const completion = await response.json();
console.log(completion.choices[0].message.content);