All posts
Vercel AI SDK + TokenRex
Tutorials 5 min read· Aug 7, 2026· By Guides

Vercel AI SDK + TokenRex

Use the AI SDK's OpenAI provider with a custom base URL.

The Vercel AI SDK's @ai-sdk/openai provider takes a baseURL override. Everything else — streamText, generateObject, tool calls — works identically.

typescript
import { createOpenAI } from "@ai-sdk/openai";

const tokenrex = createOpenAI({
  apiKey: process.env.TOKENREX_API_KEY!,
  baseURL: "https://tokenrex.ai/api/public/v1",
});

const { text } = await generateText({ model: tokenrex("gpt-5.4-mini"), prompt });

Models in this article

Review current prices, specifications and source-linked benchmarks.

Build this with TokenRex

TokenRex is an LLM marketplace by Asirex Labs. Choose an enabled model, create a private API key and use the supported endpoint shown in Docs. Check live prices before your first request.