#3138·onlook

[feat] docs: OpenAI-compatible baseURL /v1 example for self-host

Author: cursor[bot]Created Aug 28, 2026Updated Aug 28, 2026

Describe the feature

Self-host docs already point at the AI SDK OpenAI compatible custom provider guide and say to edit packages/ai/src/chat/providers.ts. Two details are easy to get wrong on a hosted Chat Completions host:

  1. baseURL / createOpenAICompatible must include /v1. Origin-only 404s. Do not append /chat/completions.
  2. Model id is the catalog id. Do not prefix openai/. Do not add a first-party branded provider row (open TrustedRouter / MiniMax threads already cover that).

PZERO is a live OpenAI-compatible host. Catalog: GET https://api.pzero.studio/v1/models. Default text id: deepseek-v4-flash. Prepaid Bearer key (pzero_…).

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

const pzero = createOpenAICompatible({
  name: "pzero",
  baseURL: "https://api.pzero.studio/v1",
  apiKey: process.env.PZERO_API_KEY,
});

No first-party provider asked. If editing providers.ts is too much, a self-host worked example is the docs gap.