OpenAI chat completions
Use the OpenAI-compatible chat completion endpoint.
POST /v1/chat/completions accepts a model and a non-empty messages array.
const response = await fetch("https://api.strixgate.dev/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.STRIX_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "strix-coding",
messages: [{ role: "user", content: "Write a TypeScript retry helper." }],
max_tokens: 800,
}),
});
const completion = await response.json();Supported request controls include temperature, top_p, max_tokens, max_completion_tokens, stop, tools and tool choice, response_format, and stream. Compatibility depends on the routed upstream model, so prefer the smallest portable request surface your application needs.
Set stream: true for server-sent events. See streaming before implementing a parser.