Is your feature request related to a problem? Please describe.
The custom endpoints docs show model.baseURL for OpenAI-shaped hosts. Default wire is still Responses (openaiEndpointFormat omitted). A Chat Completions-only host then fails in a way that looks like a bad baseURL.
PR #2347 added openaiEndpointFormat: "chat". That flag is easy to miss next to baseURL.
Describe the solution you'd like
A worked example next to the existing OpenAI baseURL snippet that sets openaiEndpointFormat: "chat" for a Chat Completions-only host.
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_…). POST /v1/chat/completions is the working path. POST /v1/responses exists (401 without a key, not 404) but this host is Chat Completions-first for agent tools.
import { Stagehand } from "@browserbasehq/stagehand";
const stagehand = new Stagehand({
env: "LOCAL",
model: {
modelName: "openai/deepseek-v4-flash",
apiKey: process.env.PZERO_API_KEY,
baseURL: "https://api.pzero.studio/v1",
openaiEndpointFormat: "chat",
},
});
modelName keeps the openai/ provider prefix. baseURL is the /v1 root, not /v1/chat/completions. Omit openaiEndpointFormat and Stagehand talks Responses.
Do not point Stagehand STT/TTS or embeddings at this host unless those routes are verified.
Describe alternatives you've considered
A custom llmClient with @ai-sdk/openai-compatible also works. The model object is the shorter path already documented for OpenAI baseURL.
Are you willing to contribute to implementing this feature or fix?
No first-party plugin asked. If a named vendor subsection is too much, the gotcha is openaiEndpointFormat: "chat"; the block is a worked example for searchers.
Is your feature request related to a problem? Please describe.
The custom endpoints docs show
model.baseURLfor OpenAI-shaped hosts. Default wire is still Responses (openaiEndpointFormatomitted). A Chat Completions-only host then fails in a way that looks like a badbaseURL.PR #2347 added
openaiEndpointFormat: "chat". That flag is easy to miss next tobaseURL.Describe the solution you'd like
A worked example next to the existing OpenAI
baseURLsnippet that setsopenaiEndpointFormat: "chat"for a Chat Completions-only host.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_…).POST /v1/chat/completionsis the working path.POST /v1/responsesexists (401 without a key, not 404) but this host is Chat Completions-first for agent tools.modelNamekeeps theopenai/provider prefix.baseURLis the/v1root, not/v1/chat/completions. OmitopenaiEndpointFormatand Stagehand talks Responses.Do not point Stagehand STT/TTS or embeddings at this host unless those routes are verified.
Describe alternatives you've considered
A custom
llmClientwith@ai-sdk/openai-compatiblealso works. Themodelobject is the shorter path already documented for OpenAIbaseURL.Are you willing to contribute to implementing this feature or fix?
No first-party plugin asked. If a named vendor subsection is too much, the gotcha is
openaiEndpointFormat: "chat"; the block is a worked example for searchers.