stream: true and iterate over the returned stream.
serv_shadow_agent. SERV rejects that combination with a 400 response because Shadow Agent must validate a completed response.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Read SERV response chunks over server-sent events.
stream: true and iterate over the returned stream.
const stream = await client.chat.completions.create({
model: "gpt-5.4-mini",
stream: true,
messages: [
{ role: "system", content: "You are a concise technical writer." },
{ role: "user", content: "Explain database indexes in three paragraphs." },
],
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
serv_shadow_agent. SERV rejects that combination with a 400 response because Shadow Agent must validate a completed response.