← AI PulseJul 23, 2026

Wire · news · Single-source brief

xAI Recommends Responses API Over Legacy Chat Completions

xAI's new Responses API offers a streamlined interaction method for its models, differing from the legacy Chat Completions API in response format and multi-turn conversation handling.

By Illumora Editorial · Jul 23, 2026

Rewritten from one allowlisted primary — not independent enterprise reporting. Lanes →

Brief drafted by Illumora’s editorial model from the linked primary source. Ops desk reviews flagged pieces. How we write →

Read the source →xAI Docs — Comparison with Chat Completions | SpaceXAI Docs
Save

xAI has introduced the Responses API as the recommended method for interacting with its models, including Grok 4.5. This new API provides an alternative to the legacy Chat Completions API, with key differences in how responses are structured and how multi-turn conversations are managed.

The Responses API returns content within an output array containing typed items. In contrast, the Chat Completions API delivers content in choices[0].message.content.

Key Points

  • The Responses API is the recommended method for interacting with xAI models.
  • The Chat Completions API returns content in choices[0].message.content.
  • The Responses API returns content in an output array with typed items.
  • Multi-turn conversations with the Chat Completions API require resending the entire conversation history with each request.
  • The Responses API allows continuing a conversation using previous_response_id without resending full history.
  • Migration from the Chat Completions API to the Responses API involves updating code to use client.responses.create and renaming messages to input.
  • The Grok 4 model is used in examples for the Responses API.

Context

According to xAI, the Responses API simplifies interaction with their models. The legacy Chat Completions API requires developers to manage conversation history by resending it with each turn. The Responses API introduces a mechanism to reference previous interactions, potentially reducing overhead for multi-turn dialogues.

Why It Matters

Developers working with xAI models can adopt the Responses API to manage conversation state more efficiently and handle structured outputs. This change impacts how applications are built to maintain context across multiple user interactions, potentially simplifying code and reducing token usage for repeated context.

What To Do

  • Review the xAI documentation for the Responses API to understand the new response format.
  • Test the previous_response_id feature in the Responses API for multi-turn conversations.
  • Update existing code from client.chat.completions.create to client.responses.create and rename messages to input where applicable.
  • Note the use of Grok 4 in the provided code examples for the Responses API.

Keep Exploring

/atlas/grok-family