Recent candidate changes
import OpenAI from "openai" ; const client = new OpenAI ({ apiKey: process.env. XAI_API_KEY , baseURL: "https://api.x.ai
normalized
docs_update / 96% / docs_only_change
import { xai } from '@ai-sdk/xai' ; import { streamText } from 'ai' ; const { fullStream } = streamText ({ model: xai. r
normalized
docs_update / 96% / docs_only_change
import os from openai import OpenAI client = OpenAI( api_key = os.getenv( "XAI_API_KEY" ), base_url = "https://api.x.ai/
normalized
docs_update / 96% / docs_only_change
import os from xai_sdk import Client from xai_sdk.chat import user from xai_sdk.tools import web_search, x_search, code_
normalized
docs_update / 96% / docs_only_change
curl https://api.x.ai/v1/responses \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $XAI_API_KEY " \ -d
normalized
docs_update / 96% / docs_only_change
Custom functions you define that the model can invoke
normalized
docs_update / 87% / docs_only_change
Function Calling - Define custom tools the model can call
normalized
docs_update / 87% / docs_only_change
Processes results and continues until sufficient information is gathered
normalized
docs_update / 87% / docs_only_change
Executes the tool (for built-in tools) or returns a tool call request (for function calling)
normalized
docs_update / 76% / docs_only_change
Decides what to do next : Make a tool call, or provide a final answer
normalized
docs_update / 76% / docs_only_change
Analyzes the query and determines what information or actions are needed
normalized
docs_update / 76% / docs_only_change
The API automatically returns source URLs for information gathered via tools. See Citations for details on accessing and
normalized
docs_update / 87% / docs_only_change