Hecho para agentes de voz que no pueden esperar 600ms

OpenAI: GPT-Live 1

openai/gpt-live-1
activo speech-to-speech 1 proveedor
Playground

OpenAI full-duplex voice model for natural, expressive speech-to-speech conversations that listens while speaking and supports client delegation to your application.

AutorOpenAI
Idiomasno especificado
Formatos de respuestaStreaming: PCM · µ-law · A-law
Estadoactivo

Proveedores

Distintos proveedores pueden alojar el mismo modelo. Elige un proveedor cuando necesites un backend fijo, o deja que el enrutamiento elija entre ellos.

ProveedorSlugPor horaLatenciaiEn TTS, la latencia se mide como el tiempo hasta el primer byte de audio. En STT, se mide como el tiempo hasta el primer token.ModosDisponibilidad
OpenAI 3 parámetros
openai
$3
—
Streaming

Idiomas admitidos

Todavía no hay una lista de idiomas revisada para este modelo.

Funciones

Speech to speech

Full-duplex speech-to-speech over WebSocket, listening while it speaks.

speech_to_speech
Text input and output

Accepts text input and returns text output alongside audio.

text_input_output
Turn-taking

The model manages when to listen and speak over a continuous audio stream, with interruption handling.

turn_taking
Live transcripts

Streams timestamped transcripts of both input and output speech.

live_transcripts
Client delegation

Emits client delegation events for your application to handle and accepts application-provided results back into the conversation.

client_delegation

Código

Lenguaje

Voz a voz en vivo con el OpenAI SDK

Abre una sesión de GPT-Live, transmite question.pcm (PCM mono de 16 bits a 24 kHz) en tiempo real y guarda la respuesta hablada en reply.pcm.

import { readFile, writeFile } from "node:fs/promises";
import { setTimeout as sleep } from "node:timers/promises";
import OpenAI from "openai";
import { LiveWS } from "openai/resources/live/ws";

const client = new OpenAI({
  apiKey: process.env.ALLMODELS_API_KEY,
  baseURL: "https://api.allmodels.io/oai"
});
const live = new LiveWS(client);
const reply = [];
let quiet;

live.on("session.output_audio.delta", ({ delta }) => reply.push(Buffer.from(delta, "base64")));
live.on("session.output_transcript.delta", () => {
  // End the session two seconds after the reply's transcript goes quiet.
  clearTimeout(quiet);
  quiet = setTimeout(() => live.send({ type: "session.close" }), 2000);
});
live.on("session.closed", async () => {
  await writeFile("reply.pcm", Buffer.concat(reply));
  live.close();
});
live.on("error", console.error);

live.send({
  type: "session.start",
  session: {
    model: "gpt-live-1",
    audio: { format: { type: "audio/pcm", rate: 24000 }, output: { voice: "marin" } },
    delegation: { type: "client" }
  }
});

// Stream 100 ms frames in real time, then two seconds of silence.
const audio = Buffer.concat([await readFile("question.pcm"), Buffer.alloc(2 * 24000 * 2)]);
for (let offset = 0; offset < audio.length; offset += 4800) {
  live.send({ type: "session.input_audio.append", audio: audio.subarray(offset, offset + 4800).toString("base64") });
  await sleep(100);
}