SpyBara
Go Premium

grpc-api-reference.md 2026-09-03 16:59 UTC to 2026-09-07 22:57 UTC

This page contains 15 additions and 8 deletions.

2026
Mon 7 22:57

gRPC API

Overview

The xAI gRPC API exposes the same models and services as the REST API over gRPC. The base URL for all services is api.x.ai, and every call must carry the header Authorization: Bearer <your xAI API key>.

The protobuf definitions are published in xai-org/xai-proto. The xAI Python SDK (xai-sdk) uses gRPC natively; install it with pip install xai-sdk.

Using buf curl

Clone the proto definitions and use buf curl to call the API:

git clone https://github.com/xai-org/xai-proto.git
cd xai-proto

All buf curl examples in this reference assume you run from inside the cloned xai-proto directory.

Services