Do Grok's Responses API and Python SDK enable inline citations identically?

The Citead team, updated

In short. The Responses API enables inline citations by default, while the xAI Python SDK requires include=["inline_citations"].

Definition: No. xAI documents inline citations as enabled by default for the Responses API and as disabled by default for the xAI Python SDK's gRPC chat API. The SDK requires an explicit include value to turn them on.

Key facts

  • xAI's citation documentation defines inline citations as markdown-style links inserted into response text where the model references sources.
  • The same page lists the Responses API clients as cURL against /v1/responses, the Python OpenAI SDK, the JavaScript AI SDK through xai.responses(), and the JavaScript OpenAI SDK.
  • For the Responses API, inline citations are enabled by default. The xAI Python SDK's default is disabled, and xAI documents include=["inline_citations"] as the enabling value.
  • The xAI SDK changelog records an include field for optional outputs, including inline citations, in its 26 November 2025 entry.
  • The same changelog records property methods for inline citations on streaming and unary responses in its 4 December 2025 entry.

What differs between the two interfaces?

xAI's citation documentation describes two interfaces with different defaults. A request sent to the Responses API can include the web_search tool and receive inline citation links without an additional citation setting. The page groups cURL, the Python OpenAI SDK, the JavaScript AI SDK through xai.responses(), and the JavaScript OpenAI SDK under that behavior.

The xAI Python SDK uses a gRPC chat API. Its default leaves inline citation links disabled. To request them, pass the string inline_citations in the chat request's include list. The documented opt-out value for the Responses API is no_inline_citations.

chat = client.chat.create(
    tools=[
        web_search(),
        x_search(),
    ],
    include=["inline_citations"],
)

What does the SDK expose after enabling them?

The xAI Python SDK changelog dates the include request field and InlineCitation support to version 1.4.1, released on 26 November 2025. It describes the field as a way to request optional outputs, including inline citations, and says that agentic search outputs gained InlineCitation support.

The next relevant changelog entry is version 1.5.0, dated 4 December 2025. It adds property methods for convenient access to inline citations on both streaming and unary responses and adds an end_index field to InlineCitation. These are SDK response conveniences; the citation default remains a request configuration documented separately by xAI.

What appears in the response text and metadata?

When enabled, xAI documents markdown-style links in the form [[N]](url). N is the sequential display number starting from 1, while url is the source URL. The same source keeps its original citation number when it appears again later in the response.

The Responses API also returns structured metadata. xAI says each output_text content block includes an annotations array with the URL, character offsets, and label. If inline links are disabled, the annotations field may still list sources encountered during search, but it does not provide positional references into the response text. xAI also documents that streaming accumulates inline citations on the final response.

FAQ

Do I need to add an inline citation setting to the Responses API request?

No. xAI documents inline citations as enabled by default for the Responses API. You can pass include=["no_inline_citations"] when the response should omit inline citation links.

What should I add to an xAI Python SDK chat request?

Pass include=["inline_citations"] to chat.create(). The SDK changelog describes this as an optional output and exposes inline citation properties on streaming and unary responses.

Does enabling the setting force a citation into every answer?

No. xAI states that the model decides when and where to include citations based on the context and nature of the query.

Sources

  1. xAI, "Citations", 25 August 2026
  2. xAI, "xai-sdk-python CHANGELOG.md", 24 September 2026

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark