Expand description
xAI SDK for Rust
A Rust SDK for xAI’s API, providing type-safe gRPC clients for all xAI services including Grok language models, embeddings, image generation, and more.
Modules§
- api
- API organization module.
- auth
- Authentication service client.
- batch
- Batch processing service client.
- billing
- Billing service client.
- chat
- Chat completion service client.
- documents
- Document processing service client.
- embed
- Embedding service client.
- export
- Re-exports of commonly used types from dependencies.
- files
- File management service client.
- image
- Image generation service client.
- models
- Model information service client.
- shared
- Shared utilities for the xAI SDK.
- tokenize
- Tokenization service client.
- utils
- Utilities module.
- video
- Video generation service client.
Constants§
- XAI_
API_ KEY - Environment variable for the inference API key (
api.x.ai). - XAI_
API_ URL - Default xAI inference API URL (chat, models, embeddings, …).
- XAI_
MANAGEMENT_ API_ KEY - Environment variable for the management API key (
management-api.x.ai). - XAI_
MANAGEMENT_ API_ URL - Default xAI management API URL (billing and team management).
- XAI_
TEAM_ ID - Environment variable for the team UUID (required on management billing RPCs).