docs: openaiEndpointFormat chat example for Chat Completions-only hosts
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- documentation
Research direction
Start at the custom endpoints documentation page and locate the existing OpenAI baseURL snippet. Add a nearby worked example using the supplied model configuration and openaiEndpointFormat: "chat" for a Chat Completions-only host; done means the example clearly shows the /v1 baseURL and chat setting.
Written by the indexing model from the issue text.
Description
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?
- Yes, I can submit a PR
- Yes, but I need guidance
- No, I cannot contribute at this time
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.
- Dominant language
- TypeScript
- Stars
- 24.6k
- Forks
- 1.7k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 62
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from browserbase/stagehand
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
browserbase/stagehand#2918 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
browserbase/stagehand#2910 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
browserbase/stagehand#2735 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
browserbase/stagehand#2734 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
browserbase/stagehand#2733 ·
All issues in browserbase/stagehand
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100