Add xAI Tools to OCI Responses API

OCI Generative AI now supports xAI-compatible tools with xAI models through the OCI Responses API. These tools enable models to access real-time data, analyze external content, and perform computations as part of agent workflows.

Although xAI models are accessed through the OCI Responses API, which is compatible with the OpenAI Responses API, the supported tools are provided by xAI and use xAI-specific tool settings and limits.

Supported xAI-Compatible Tools
  • X Search (x_search): Search posts, users, and threads on X (formerly Twitter). Example use case: monitoring customer and market signals, such as sentiment, product complaints, and emerging trends from selected X handles.
  • Code Execution (code_interpreter): Run Python code for calculations, data analysis, and other compute tasks. Example use case: financial and business analysis, such as retrieving live data, running calculations, and generating computed summaries or scenario comparisons.
Key Features
  • Real-time data access: Retrieve and analyze live social media content.
  • Code execution: Run Python code within the Responses API for computation and data processing.
  • Citations support: X Search can return source URLs through response.citations for traceability.
  • xAI tool settings and limits: Use xAI-specific options and limits instead of OpenAI tool settings.
  • Domain and handle controls: Filter search results by allowed or excluded domains or X handles.
  • Multimodal understanding: Analyze images and videos returned by XSearch tool when enabled.
X Search Tool Highlights
  • Supports filtering by allowed or excluded X handles.
  • Supports date-based filtering.
  • Supports image and video understanding.

For supported models, regions, and examples, see xAI-Compatible Tools. For information about the service, see the Generative AI documentation.