Skip to content

chore(provider/xai): deprecate searchParameters (live search) in favor of web_search/x_search tools#15713

Merged
gr2m merged 1 commit into
mainfrom
josh/deprecate-xai-search-parameters
May 29, 2026
Merged

chore(provider/xai): deprecate searchParameters (live search) in favor of web_search/x_search tools#15713
gr2m merged 1 commit into
mainfrom
josh/deprecate-xai-search-parameters

Conversation

@dancer
Copy link
Copy Markdown
Collaborator

@dancer dancer commented May 29, 2026

background

xAI has deprecated Live Search. the search_parameters field on chat completions now returns 410 Gone with:

Live search is deprecated. Please switch to the Agent Tools API: https://docs.x.ai/docs/guides/tools/overview

verified live against api.x.ai across grok-4.3 / grok-3-latest and all search modes. through the SDK the option is broken either way:

  • xai.chat(modelId) → serializes search_parameters, xAI returns 410 Gone
  • xai(modelId) / xai.responses(modelId) → the responses model never read searchParameters, so it is silently dropped and no search runs (a no-op)

so the option is non-functional on every path. the working replacement is the web_search / x_search agent tools on the responses endpoint, already supported via xai.tools.webSearch() / xai.tools.xSearch().

summary

  • mark searchParameters as @deprecated in xai-chat-language-model-options.ts, pointing users to xai.tools.webSearch() / xai.tools.xSearch() with xai.responses(modelId). follows the same JSDoc-on-zod-field convention already used in the file (xHandles) and other providers (black-forest-labs, google interactions)
  • the serialization is intentionally left in place (no breaking change) — the option still exists, it's just flagged
  • remove the two now-dead example files (generate-text/xai/search.ts, stream-text/xai/search.ts). they used the default xai() callable (responses), so they were silently no-op'ing even before the deprecation. their replacements already exist: responses-web-search.ts, web-search-image-understanding.ts, x-search-video-understanding.ts

verification

  • raw curl: search_parameters returns 410 on grok-4.3 / grok-3-latest, modes auto and on
  • via SDK: xai.chat(...) with searchParameters410 Gone; xai(...) (responses) → option silently dropped (no search_parameters in request body)
  • replacement examples run live against xAI and return real cited results (responses-web-search.ts, web-search-image-understanding.ts)
  • xai package tests pass, type-check and build clean

related

@dancer dancer added the backport Admins only: add this label to a pull request in order to backport it to the prior version label May 29, 2026
@gr2m gr2m merged commit 23f9d72 into main May 29, 2026
52 checks passed
@gr2m gr2m deleted the josh/deprecate-xai-search-parameters branch May 29, 2026 22:27
github-actions Bot added a commit that referenced this pull request May 29, 2026
…r of web_search/x_search tools (#15713)

## background

xAI has deprecated Live Search. the `search_parameters` field on chat
completions now returns `410 Gone` with:

> `Live search is deprecated. Please switch to the Agent Tools API:
https://docs.x.ai/docs/guides/tools/overview`

verified live against `api.x.ai` across grok-4.3 / grok-3-latest and all
search modes. through the SDK the option is broken either way:

- `xai.chat(modelId)` → serializes `search_parameters`, xAI returns `410
Gone`
- `xai(modelId)` / `xai.responses(modelId)` → the responses model never
read `searchParameters`, so it is silently dropped and no search runs (a
no-op)

so the option is non-functional on every path. the working replacement
is the `web_search` / `x_search` agent tools on the responses endpoint,
already supported via `xai.tools.webSearch()` / `xai.tools.xSearch()`.

## summary

- mark `searchParameters` as `@deprecated` in
`xai-chat-language-model-options.ts`, pointing users to
`xai.tools.webSearch()` / `xai.tools.xSearch()` with
`xai.responses(modelId)`. follows the same JSDoc-on-zod-field convention
already used in the file (`xHandles`) and other providers
(black-forest-labs, google interactions)
- the serialization is intentionally left in place (no breaking change)
— the option still exists, it's just flagged
- remove the two now-dead example files (`generate-text/xai/search.ts`,
`stream-text/xai/search.ts`). they used the default `xai()` callable
(responses), so they were silently no-op'ing even before the
deprecation. their replacements already exist:
`responses-web-search.ts`, `web-search-image-understanding.ts`,
`x-search-video-understanding.ts`

## verification

- raw curl: `search_parameters` returns `410` on grok-4.3 /
grok-3-latest, modes `auto` and `on`
- via SDK: `xai.chat(...)` with `searchParameters` → `410 Gone`;
`xai(...)` (responses) → option silently dropped (no `search_parameters`
in request body)
- replacement examples run live against xAI and return real cited
results (`responses-web-search.ts`, `web-search-image-understanding.ts`)
- xai package tests pass, type-check and build clean

## related

- #12827
@github-actions github-actions Bot removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ Backport PR created: #15718

dancer pushed a commit that referenced this pull request May 30, 2026
…h) in favor of web_search/x_search tools (#15718)

This is an automated backport of #15713 to the release-v6.0 branch. FYI
@dancer

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
@ai-sdk/google 4.0.0-canary.75 github npm
@ai-sdk/google-vertex 5.0.0-canary.98 github npm
@ai-sdk/mcp 2.0.0-canary.56 github npm
@ai-sdk/react 4.0.0-canary.162 github npm
@ai-sdk/xai 4.0.0-canary.69 github npm

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants