Skip to content

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

Description

@cursor

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_…).

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions