You already build AI features with the Vercel AI SDK. Wren R1 speaks the same OpenAI-compatible protocol, so you change where the provider points and which model you ask for. Your generateText and streamText calls stay the same.

Install the AI SDK and the OpenAI-compatible provider:

npm install ai @ai-sdk/openai-compatible

Create a provider instance for WebWright:

import { createOpenAICompatible } from '@ai-sdk/openai-compatible';

export const webwright = createOpenAICompatible({
  name: 'webwright',
  apiKey: process.env.WEBWRIGHT_API_KEY,
  baseURL: 'https://webwright.ai/v1',
});

Then a buffered completion with the model id wren-r1:

import { generateText } from 'ai';
import { webwright } from './webwright';

const { text } = await generateText({
  model: webwright('wren-r1'),
  prompt: 'Explain an OpenAI-compatible endpoint in one sentence.',
});

console.log(text);

The same provider streams without any other change:

import { streamText } from 'ai';
import { webwright } from './webwright';

const result = streamText({
  model: webwright('wren-r1'),
  prompt: 'Write a short release note for an API change.',
});

for await (const chunk of result.textStream) {
  process.stdout.write(chunk);
}

The two changes that matter are the base URL https://webwright.ai/v1 and the model wren-r1. Your message building, streaming and response handling stay as they are.

What Wren R1 serves

  • One base URL, https://webwright.ai/v1, covers chat completions and audio transcription.
  • Chat model: wren-r1, with a 200K token context window.
  • Published Standard rates: cache $0.10, input $0.40, output $1.60 per 1M tokens.

If you are weighing a second provider or planning a migration, a short call is the fastest way to get a prioritized first use case.

The WebWright Team