Skip to content

feat: add direct xAI Grok support - #3310

Open
vishalanton16 wants to merge 3 commits into
browserbase:mainfrom
vishalanton16:vishal/xai-grok-support
Open

vishalanton16 wants to merge 3 commits into
browserbase:mainfrom
vishalanton16:vishal/xai-grok-support

Conversation

@vishalanton16

@vishalanton16 vishalanton16 commented Oct 23, 2026 •

Copy link
Copy Markdown

Why

Allow Stagehand operations and agents to use Grok directly with an xAI API key.

What

Add xAI Responses inference, model validation, TypeScript and Python support, integration/eval key lookup and setup docs. Reject missing credentials and unsupported stop sequences.

How

Validated protocol, extension and Python tests, typechecks, SDK build and docs. Mocked HTTP tests cover credentials, images, structured output and function tool calls. Live inference has not been tested.


Summary by cubic

Adds direct xAI Grok support so Stagehand operations and agents can run with an xAI API key across TypeScript and Python.

  • Routes inference through the Responses API via @ai-sdk/xai; Browserbase Model Gateway does not support xAI.
  • Rejects missing xAI API keys even when a gateway session exists, and rejects stop sequences as unsupported.
  • Adds xai/ model validation and XAI_API_KEY env lookup across the TS/Python SDKs, evals, and docs.
  • Go SDK support is excluded from this PR.

Written for commit 89004b2. Summary will update on new commits.

View guided diff

@changeset-bot

changeset-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89004b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@browserbasehq/stagehand-protocol Minor
@browserbasehq/stagehand-extension Patch
@browserbasehq/stagehand-python Minor
@browserbasehq/stagehand Minor
browse Patch
@browserbasehq/stagehand-examples Patch
@browserbasehq/stagehand-integrations-claude-cua-sdk Patch
@browserbasehq/stagehand-integrations Patch
@browserbasehq/eve Patch
@browserbasehq/stagehand-integrations-gemini-cua-sdk Patch
@browserbasehq/stagehand-integrations-example-pi-facade Patch
@browserbasehq/stagehand-integrations-claude-agent-sdk Patch
@browserbasehq/stagehand-integrations-example-claude-code-facade Patch
@browserbasehq/stagehand-integrations-codex-sdk Patch
@browserbasehq/stagehand-integrations-example-codex-facade Patch
@browserbasehq/stagehand-integrations-cursor-sdk Patch
@browserbasehq/stagehand-integrations-example-cursor-facade Patch
@browserbasehq/stagehand-integrations-deepagents-sdk Patch
@browserbasehq/stagehand-integrations-eve-sdk Patch
@browserbasehq/stagehand-integrations-fx-sdk Patch
@browserbasehq/stagehand-integrations-mastra-sdk Patch
@browserbasehq/stagehand-integrations-example-mastra-facade Patch
@browserbasehq/stagehand-integrations-pi-sdk Patch
@browserbasehq/stagehand-integrations-example-vercel-ai-facade Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Oct 23, 2026
@socket-security

socket-security Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​ai-sdk/​xai@​4.0.59711008898100

View full report

@vishalanton16
vishalanton16 marked this pull request as ready for review October 24, 2026 10:01
@vishalanton16
vishalanton16 requested a review from a team as a code owner October 24, 2026 10:01

This branch has not been deployed

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

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant