Skip to content

Add no_inline_citations support to Responses API include option (xai)#13201

Open
jdiogoc wants to merge 1 commit intovercel:mainfrom
jdiogoc:fix/add-no_incline_citations-to-grok-provider
Open

Add no_inline_citations support to Responses API include option (xai)#13201
jdiogoc wants to merge 1 commit intovercel:mainfrom
jdiogoc:fix/add-no_incline_citations-to-grok-provider

Conversation

@jdiogoc
Copy link

@jdiogoc jdiogoc commented Mar 7, 2026

Background

The xAI Responses API supports "no_inline_citations" in the include field to disable inline citation markdown ([N]) from being inserted into response text. This is documented by xAI, but the AI SDK's @ai-sdk/xai provider doesn't currently allow passing this value, the include option only accepts 'file_search_call.results'.

Summary

Added 'no_inline_citations' as a valid value for the include provider option in the Responses API. This lets users disable inline citations when using xai.responses() with server-side search tools like web_search and x_search.

Two changes:

  • Added 'no_inline_citations' to the XaiResponsesIncludeValue type in xai-responses-api.ts
  • Added 'no_inline_citations' to the Zod enum for the include field in xai-responses-options.ts

Manual Verification

Tested against the xAI Responses API with web_search enabled. Without this change, the response text contains inline citation markdown like [1]. With include: ['no_inline_citations'], the response text is returned without citation markdown, matching the behavior described in xAI's documentation.

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Future Work

The Chat API has a separate searchParameters.returnCitations option that controls citations for Live Search. It may be worth documenting the distinction between the two approaches (Chat API vs Responses API) more clearly.

Related Issues

@tigent tigent bot added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label feature New feature or request provider/xai labels Mar 7, 2026
@jdiogoc jdiogoc changed the title Adds no_inline_citations to grok provider Add no_inline_citations support to Responses API include option (xai) Mar 7, 2026
@jdiogoc jdiogoc marked this pull request as ready for review March 7, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label feature New feature or request provider/xai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant