← AI PulseAug 20, 2026

Deep · news · Multi-source brief

xAI Introduces Structured Output Mode and Collections for API Users

xAI has launched a structured output mode for its API, enabling responses in defined formats like JSON objects, alongside a new Collections service for managing and searching document sets.

By Illumora Editorial

Source · Aug 20, 2026, 3:13 PM · On Illumora · Aug 20, 2026, 4:07 PM

Media from the primary source — shown here so you can stay on Illumora.

Synthesized from multiple allowlisted primaries on the same event. 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 — Structured Outputs | SpaceXAI Docs
Save

xAI has introduced a structured output mode for its API, allowing responses to be returned in specific formats rather than free-form text. This feature is designed to assist with tasks such as document parsing, entity extraction, and report generation. The company also launched its Collections service, which provides persistent document storage with semantic search capabilities across multiple documents.

For structured outputs, the grok-4.6 model can return responses guaranteed to match a user-defined schema when supported schema features are utilized. The Collections service is intended to help users integrate enterprise requirements and internal knowledge bases with the xAI API, supporting applications like RAG (Retrieval Augmented Generation).

Key Points

  • xAI's structured output mode allows the API to return responses in a specific format, such as a JSON object matching a defined schema.
  • The primary method for requesting structured outputs is via the response_format parameter, setting response_format.type to "json_schema" or "json_object".
  • Structured outputs are also supported through tool calling, where xAI models generate tool call arguments that conform to the tool's input JSON Schema.
  • Schemas can be defined using libraries like Pydantic or Zod, with Draft 2020-12 JSON Schema working best, and Draft-07 also accepted.
  • The Collections service enables users to upload and search through documents by adding them to collections, supporting various UTF-8 encoded text files and specific MIME types.
  • Collections provide persistent document storage with an embedding index for efficient retrieval and semantic search across documents.
  • Users can manage collections and upload documents through the xAI Console interface or programmatically using the SDK and REST API.

Context

According to xAI, the structured output mode ensures that API responses adhere to a specified format, which is particularly useful for automated processing. The response_format parameter offers flexibility, allowing users to request a specific JSON schema or any well-formed JSON object. When defining tools, xAI models implicitly enforce strict conformance to the tool's input JSON Schema. The documentation notes that additionalProperties defaults to false and must be explicitly set to true if desired. Certain format keywords like date, time, and email are enforced, while others are accepted but not structurally enforced.

The Collections service, as described by xAI, differentiates itself from simply attaching files to chat messages by offering persistent storage and semantic search. It supports metadata fields for enhanced retrieval and data integrity, allowing users to define fields with options like required, unique, and inject_into_chunk. The service does not use user data stored in Collections for model training purposes.

Why It Matters

These features offer builders more control over API output formats and enhanced capabilities for managing and leveraging proprietary data. Structured outputs can streamline integration with downstream systems by guaranteeing response formats, reducing the need for extensive parsing or validation. The Collections service provides a foundational component for developing RAG applications and other knowledge-intensive AI systems, allowing developers to integrate custom data for more relevant model responses.

What To Do

  • Review the xAI Docs on Structured Outputs to understand the response_format parameter and its options.
  • Experiment with defining JSON schemas using libraries like Pydantic or Zod for structured output requests.
  • Explore the xAI Docs for Collections to learn about creating and managing document collections.
  • Test the semantic search capabilities of Collections with your own documents to evaluate its retrieval accuracy.