If you already call OpenAI from Node with the official openai package, you can point the same client at Wren R1
without changing your call sites. The client takes a baseURL, so the endpoint becomes a configuration value.
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.WEBWRIGHT_API_KEY,
baseURL: 'https://webwright.ai/v1',
}); The model WebWright serves is wren-r1. You can confirm it
from the same client:
const models = await client.models.list();
console.log(models.data.map((m) => m.id)); // ['wren-r1'] A chat completion. The chat endpoint accepts the standard OpenAI chat payload, so the request you already write works here.
const completion = await client.chat.completions.create({
model: 'wren-r1',
messages: [{ role: 'user', content: 'Reply with the single word: ready' }],
});
console.log(completion.choices[0].message.content); Streaming. The chat endpoint supports streaming responses over
Server-Sent Events. Set stream: true and read the chunks.
const stream = await client.chat.completions.create({
model: 'wren-r1',
messages: [{ role: 'user', content: 'Count from one to three.' }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
} Transcribing audio. The transcription endpoint takes a multipart
upload and returns the transcript as JSON by default. It also returns text, srt, vtt, or verbose_json when you set response_format.
import fs from 'node:fs';
const transcript = await client.audio.transcriptions.create({
file: fs.createReadStream('meeting.mp3'),
model: 'whisper-large-v3-turbo',
});
console.log(transcript.text); Where the values come from:
- Base URL:
https://webwright.ai/v1. - Model:
wren-r1(also readable fromGET /v1/models). - Transcription model:
whisper-large-v3-turbo. - Key: create one in the WebWright dashboard. A 4-day trial is available; it converts to the Hobby plan.
Because the endpoint is OpenAI-compatible, the same openai client and the same request shapes cover chat,
streaming, and transcription. The only change is the baseURL, the key, and the model name.
The WebWright Team