Streaming

Streaming allows your application to receive AI-generated content incrementally, enhancing responsiveness by displaying text as it's created. This is ideal for chat apps, coding assistants, and interactive workflows. Instead of a single response, the Streaming API delivers small content chunks in real time, enabling users to start reading immediately. This guide covers creating a streaming request, processing incoming data, and managing stream completion.

Create a Stream

Streaming requests use the same structure as standard chat requests, but return an asynchronous stream of response chunks instead of a single completed message.

import client from "./client.js";

const stream = await client.chat.stream({
  model: "axiom-1",
  messages: [
    {
      role: "user",
      content: "Write a product launch announcement."
    }
  ]
});
Process Streaming Output

Iterate through each incoming chunk. This enables your interface to update continuously while the model generates its response, creating a more natural user experience.

import client from "./client.js";

async function streamResponse() {
  const stream = await client.chat.stream({
    model: "axiom-1",
    temperature: 0.7,
    messages: [
      {
        role: "user",
        content: "Explain machine learning step by step."
      }
    ]
  });

  let output = "";

  for await (const chunk of stream) {
    output += chunk.delta;
    process.stdout.write(chunk.delta);
  }

  console.log("\n\nCompleted.");
}

streamResponse();
Detect Stream Completion

After the stream finishes, perform any necessary post-processing tasks such as saving messages, updating analytics, or enabling additional interface controls promptly.

let completed = false;

stream.on("end", () => {
  completed = true;

  console.log("Stream finished.");
  console.log(`Completed: ${completed}`);
});
When to Use Streaming

Streaming is recommended whenever response speed improves the user experience. It works particularly well for conversational interfaces, long-form content generation, coding assistants, and AI-powered productivity tools where users benefit from seeing results immediately rather than waiting for the full response.

Models

SDKs

Streaming

Streaming allows your application to receive AI-generated content incrementally, enhancing responsiveness by displaying text as it's created. This is ideal for chat apps, coding assistants, and interactive workflows. Instead of a single response, the Streaming API delivers small content chunks in real time, enabling users to start reading immediately. This guide covers creating a streaming request, processing incoming data, and managing stream completion.

Create a Stream

Streaming requests use the same structure as standard chat requests, but return an asynchronous stream of response chunks instead of a single completed message.

import client from "./client.js";

const stream = await client.chat.stream({
  model: "axiom-1",
  messages: [
    {
      role: "user",
      content: "Write a product launch announcement."
    }
  ]
});
Process Streaming Output

Iterate through each incoming chunk. This enables your interface to update continuously while the model generates its response, creating a more natural user experience.

import client from "./client.js";

async function streamResponse() {
  const stream = await client.chat.stream({
    model: "axiom-1",
    temperature: 0.7,
    messages: [
      {
        role: "user",
        content: "Explain machine learning step by step."
      }
    ]
  });

  let output = "";

  for await (const chunk of stream) {
    output += chunk.delta;
    process.stdout.write(chunk.delta);
  }

  console.log("\n\nCompleted.");
}

streamResponse();
Detect Stream Completion

After the stream finishes, perform any necessary post-processing tasks such as saving messages, updating analytics, or enabling additional interface controls promptly.

let completed = false;

stream.on("end", () => {
  completed = true;

  console.log("Stream finished.");
  console.log(`Completed: ${completed}`);
});
When to Use Streaming

Streaming is recommended whenever response speed improves the user experience. It works particularly well for conversational interfaces, long-form content generation, coding assistants, and AI-powered productivity tools where users benefit from seeing results immediately rather than waiting for the full response.

Models

SDKs

Streaming

Streaming allows your application to receive AI-generated content incrementally, enhancing responsiveness by displaying text as it's created. This is ideal for chat apps, coding assistants, and interactive workflows. Instead of a single response, the Streaming API delivers small content chunks in real time, enabling users to start reading immediately. This guide covers creating a streaming request, processing incoming data, and managing stream completion.

Create a Stream

Streaming requests use the same structure as standard chat requests, but return an asynchronous stream of response chunks instead of a single completed message.

import client from "./client.js";

const stream = await client.chat.stream({
  model: "axiom-1",
  messages: [
    {
      role: "user",
      content: "Write a product launch announcement."
    }
  ]
});
Process Streaming Output

Iterate through each incoming chunk. This enables your interface to update continuously while the model generates its response, creating a more natural user experience.

import client from "./client.js";

async function streamResponse() {
  const stream = await client.chat.stream({
    model: "axiom-1",
    temperature: 0.7,
    messages: [
      {
        role: "user",
        content: "Explain machine learning step by step."
      }
    ]
  });

  let output = "";

  for await (const chunk of stream) {
    output += chunk.delta;
    process.stdout.write(chunk.delta);
  }

  console.log("\n\nCompleted.");
}

streamResponse();
Detect Stream Completion

After the stream finishes, perform any necessary post-processing tasks such as saving messages, updating analytics, or enabling additional interface controls promptly.

let completed = false;

stream.on("end", () => {
  completed = true;

  console.log("Stream finished.");
  console.log(`Completed: ${completed}`);
});
When to Use Streaming

Streaming is recommended whenever response speed improves the user experience. It works particularly well for conversational interfaces, long-form content generation, coding assistants, and AI-powered productivity tools where users benefit from seeing results immediately rather than waiting for the full response.

Models

SDKs

──•✦

Synoria

✦•──

Start building with AI today.

Join innovators using Synoria to scale confidently with one AI platform.

monochrome vintage leaf line art style

Streaming

Streaming allows your application to receive AI-generated content incrementally, enhancing responsiveness by displaying text as it's created. This is ideal for chat apps, coding assistants, and interactive workflows. Instead of a single response, the Streaming API delivers small content chunks in real time, enabling users to start reading immediately. This guide covers creating a streaming request, processing incoming data, and managing stream completion.

Create a Stream

Streaming requests use the same structure as standard chat requests, but return an asynchronous stream of response chunks instead of a single completed message.

import client from "./client.js";

const stream = await client.chat.stream({
  model: "axiom-1",
  messages: [
    {
      role: "user",
      content: "Write a product launch announcement."
    }
  ]
});
Process Streaming Output

Iterate through each incoming chunk. This enables your interface to update continuously while the model generates its response, creating a more natural user experience.

import client from "./client.js";

async function streamResponse() {
  const stream = await client.chat.stream({
    model: "axiom-1",
    temperature: 0.7,
    messages: [
      {
        role: "user",
        content: "Explain machine learning step by step."
      }
    ]
  });

  let output = "";

  for await (const chunk of stream) {
    output += chunk.delta;
    process.stdout.write(chunk.delta);
  }

  console.log("\n\nCompleted.");
}

streamResponse();
Detect Stream Completion

After the stream finishes, perform any necessary post-processing tasks such as saving messages, updating analytics, or enabling additional interface controls promptly.

let completed = false;

stream.on("end", () => {
  completed = true;

  console.log("Stream finished.");
  console.log(`Completed: ${completed}`);
});
When to Use Streaming

Streaming is recommended whenever response speed improves the user experience. It works particularly well for conversational interfaces, long-form content generation, coding assistants, and AI-powered productivity tools where users benefit from seeing results immediately rather than waiting for the full response.

Models

SDKs

Streaming

Streaming allows your application to receive AI-generated content incrementally, enhancing responsiveness by displaying text as it's created. This is ideal for chat apps, coding assistants, and interactive workflows. Instead of a single response, the Streaming API delivers small content chunks in real time, enabling users to start reading immediately. This guide covers creating a streaming request, processing incoming data, and managing stream completion.

Create a Stream

Streaming requests use the same structure as standard chat requests, but return an asynchronous stream of response chunks instead of a single completed message.

import client from "./client.js";

const stream = await client.chat.stream({
  model: "axiom-1",
  messages: [
    {
      role: "user",
      content: "Write a product launch announcement."
    }
  ]
});
Process Streaming Output

Iterate through each incoming chunk. This enables your interface to update continuously while the model generates its response, creating a more natural user experience.

import client from "./client.js";

async function streamResponse() {
  const stream = await client.chat.stream({
    model: "axiom-1",
    temperature: 0.7,
    messages: [
      {
        role: "user",
        content: "Explain machine learning step by step."
      }
    ]
  });

  let output = "";

  for await (const chunk of stream) {
    output += chunk.delta;
    process.stdout.write(chunk.delta);
  }

  console.log("\n\nCompleted.");
}

streamResponse();
Detect Stream Completion

After the stream finishes, perform any necessary post-processing tasks such as saving messages, updating analytics, or enabling additional interface controls promptly.

let completed = false;

stream.on("end", () => {
  completed = true;

  console.log("Stream finished.");
  console.log(`Completed: ${completed}`);
});
When to Use Streaming

Streaming is recommended whenever response speed improves the user experience. It works particularly well for conversational interfaces, long-form content generation, coding assistants, and AI-powered productivity tools where users benefit from seeing results immediately rather than waiting for the full response.

Models

SDKs

Streaming

Streaming allows your application to receive AI-generated content incrementally, enhancing responsiveness by displaying text as it's created. This is ideal for chat apps, coding assistants, and interactive workflows. Instead of a single response, the Streaming API delivers small content chunks in real time, enabling users to start reading immediately. This guide covers creating a streaming request, processing incoming data, and managing stream completion.

Create a Stream

Streaming requests use the same structure as standard chat requests, but return an asynchronous stream of response chunks instead of a single completed message.

import client from "./client.js";

const stream = await client.chat.stream({
  model: "axiom-1",
  messages: [
    {
      role: "user",
      content: "Write a product launch announcement."
    }
  ]
});
Process Streaming Output

Iterate through each incoming chunk. This enables your interface to update continuously while the model generates its response, creating a more natural user experience.

import client from "./client.js";

async function streamResponse() {
  const stream = await client.chat.stream({
    model: "axiom-1",
    temperature: 0.7,
    messages: [
      {
        role: "user",
        content: "Explain machine learning step by step."
      }
    ]
  });

  let output = "";

  for await (const chunk of stream) {
    output += chunk.delta;
    process.stdout.write(chunk.delta);
  }

  console.log("\n\nCompleted.");
}

streamResponse();
Detect Stream Completion

After the stream finishes, perform any necessary post-processing tasks such as saving messages, updating analytics, or enabling additional interface controls promptly.

let completed = false;

stream.on("end", () => {
  completed = true;

  console.log("Stream finished.");
  console.log(`Completed: ${completed}`);
});
When to Use Streaming

Streaming is recommended whenever response speed improves the user experience. It works particularly well for conversational interfaces, long-form content generation, coding assistants, and AI-powered productivity tools where users benefit from seeing results immediately rather than waiting for the full response.

Models

SDKs

──•✦

Synoria

✦•──

Start building with AI today.

Join innovators using Synoria to scale confidently with one AI platform.

monochrome vintage leaf line art style

Streaming

Streaming allows your application to receive AI-generated content incrementally, enhancing responsiveness by displaying text as it's created. This is ideal for chat apps, coding assistants, and interactive workflows. Instead of a single response, the Streaming API delivers small content chunks in real time, enabling users to start reading immediately. This guide covers creating a streaming request, processing incoming data, and managing stream completion.

Create a Stream

Streaming requests use the same structure as standard chat requests, but return an asynchronous stream of response chunks instead of a single completed message.

import client from "./client.js";

const stream = await client.chat.stream({
  model: "axiom-1",
  messages: [
    {
      role: "user",
      content: "Write a product launch announcement."
    }
  ]
});
Process Streaming Output

Iterate through each incoming chunk. This enables your interface to update continuously while the model generates its response, creating a more natural user experience.

import client from "./client.js";

async function streamResponse() {
  const stream = await client.chat.stream({
    model: "axiom-1",
    temperature: 0.7,
    messages: [
      {
        role: "user",
        content: "Explain machine learning step by step."
      }
    ]
  });

  let output = "";

  for await (const chunk of stream) {
    output += chunk.delta;
    process.stdout.write(chunk.delta);
  }

  console.log("\n\nCompleted.");
}

streamResponse();
Detect Stream Completion

After the stream finishes, perform any necessary post-processing tasks such as saving messages, updating analytics, or enabling additional interface controls promptly.

let completed = false;

stream.on("end", () => {
  completed = true;

  console.log("Stream finished.");
  console.log(`Completed: ${completed}`);
});
When to Use Streaming

Streaming is recommended whenever response speed improves the user experience. It works particularly well for conversational interfaces, long-form content generation, coding assistants, and AI-powered productivity tools where users benefit from seeing results immediately rather than waiting for the full response.

Models

SDKs

Streaming

Streaming allows your application to receive AI-generated content incrementally, enhancing responsiveness by displaying text as it's created. This is ideal for chat apps, coding assistants, and interactive workflows. Instead of a single response, the Streaming API delivers small content chunks in real time, enabling users to start reading immediately. This guide covers creating a streaming request, processing incoming data, and managing stream completion.

Create a Stream

Streaming requests use the same structure as standard chat requests, but return an asynchronous stream of response chunks instead of a single completed message.

import client from "./client.js";

const stream = await client.chat.stream({
  model: "axiom-1",
  messages: [
    {
      role: "user",
      content: "Write a product launch announcement."
    }
  ]
});
Process Streaming Output

Iterate through each incoming chunk. This enables your interface to update continuously while the model generates its response, creating a more natural user experience.

import client from "./client.js";

async function streamResponse() {
  const stream = await client.chat.stream({
    model: "axiom-1",
    temperature: 0.7,
    messages: [
      {
        role: "user",
        content: "Explain machine learning step by step."
      }
    ]
  });

  let output = "";

  for await (const chunk of stream) {
    output += chunk.delta;
    process.stdout.write(chunk.delta);
  }

  console.log("\n\nCompleted.");
}

streamResponse();
Detect Stream Completion

After the stream finishes, perform any necessary post-processing tasks such as saving messages, updating analytics, or enabling additional interface controls promptly.

let completed = false;

stream.on("end", () => {
  completed = true;

  console.log("Stream finished.");
  console.log(`Completed: ${completed}`);
});
When to Use Streaming

Streaming is recommended whenever response speed improves the user experience. It works particularly well for conversational interfaces, long-form content generation, coding assistants, and AI-powered productivity tools where users benefit from seeing results immediately rather than waiting for the full response.

Models

SDKs

Streaming

Streaming allows your application to receive AI-generated content incrementally, enhancing responsiveness by displaying text as it's created. This is ideal for chat apps, coding assistants, and interactive workflows. Instead of a single response, the Streaming API delivers small content chunks in real time, enabling users to start reading immediately. This guide covers creating a streaming request, processing incoming data, and managing stream completion.

Create a Stream

Streaming requests use the same structure as standard chat requests, but return an asynchronous stream of response chunks instead of a single completed message.

import client from "./client.js";

const stream = await client.chat.stream({
  model: "axiom-1",
  messages: [
    {
      role: "user",
      content: "Write a product launch announcement."
    }
  ]
});
Process Streaming Output

Iterate through each incoming chunk. This enables your interface to update continuously while the model generates its response, creating a more natural user experience.

import client from "./client.js";

async function streamResponse() {
  const stream = await client.chat.stream({
    model: "axiom-1",
    temperature: 0.7,
    messages: [
      {
        role: "user",
        content: "Explain machine learning step by step."
      }
    ]
  });

  let output = "";

  for await (const chunk of stream) {
    output += chunk.delta;
    process.stdout.write(chunk.delta);
  }

  console.log("\n\nCompleted.");
}

streamResponse();
Detect Stream Completion

After the stream finishes, perform any necessary post-processing tasks such as saving messages, updating analytics, or enabling additional interface controls promptly.

let completed = false;

stream.on("end", () => {
  completed = true;

  console.log("Stream finished.");
  console.log(`Completed: ${completed}`);
});
When to Use Streaming

Streaming is recommended whenever response speed improves the user experience. It works particularly well for conversational interfaces, long-form content generation, coding assistants, and AI-powered productivity tools where users benefit from seeing results immediately rather than waiting for the full response.

Models

SDKs

──•✦

Synoria

✦•──

Start building with AI today.

Join innovators using Synoria to scale confidently with one AI platform.

monochrome vintage leaf line art style

Create a free website with Framer, the website builder loved by startups, designers and agencies.