April 1, 2026 · xAI
Cost Tracking
Every API response now includes the exact cost of the request via a cost_in_usd_ticks field in the usage object. Works across chat completions, Responses API, image generation, video generation, and streaming. For more details, see the Cost Tracking docs.