You already have a Java client built on the official OpenAI SDK. Wren R1 speaks the same OpenAI-compatible protocol, so you change where the client points and which model it asks for. Nothing else in your request code changes.

Add the SDK to your build:

<dependency>
  <groupId>com.openai</groupId>
  <artifactId>openai-java</artifactId>
  <version>4.81.0</version>
</dependency>

Build the client with WebWright as its base URL, and set the model to wren-r1:

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.chat.completions.ChatCompletion;
import com.openai.models.chat.completions.ChatCompletionCreateParams;

OpenAIClient client = OpenAIOkHttpClient.builder()
    .baseUrl("https://webwright.ai/v1")
    .apiKey(System.getenv("WEBWRIGHT_API_KEY"))
    .build();

ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
    .model("wren-r1")
    .addUserMessage("Say this is a test")
    .build();

ChatCompletion completion = client.chat().completions().create(params);
System.out.println(completion.choices().get(0).message().content());

The two changes that matter are baseUrl("https://webwright.ai/v1") and model("wren-r1"). Your existing message building, tool calls, and response handling stay as they are.

If you would rather keep the client configuration out of code, the SDK also reads the standard environment variables:

export OPENAI_BASE_URL=https://webwright.ai/v1
export OPENAI_API_KEY=your-webwright-key

Then construct the client with OpenAIOkHttpClient.fromEnv().

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