Grok client based on the official gRPC API reference from xAI
To ensure the long-term sustainability of this project, users of this package who generate revenue must pay an Open Source Maintenance Fee. While the source code is freely available under the terms of the License, this package and other aspects of the project require adherence to the Maintenance Fee.
To pay the Maintenance Fee, become a Sponsor at the proper OSMF tier. A single fee covers all of Devlooped packages.
This project provides a .NET client for the gRPC API of xAI with full support for all services documented in the official API reference and corresponding proto files.
var builder = Host.CreateApplicationBuilder(args); // or WebApplication.CreateBuilder(args);
builder.Services.AddGrokClient(Environment.GetEnvironmentVariable("XAI_API_KEY")!);
var app = builder.Build();This package leverages the gRPC client factory integration for seamless dependency injection:
class MyService(Chat.ChatClient chat, Documents.DocumentsClient docs, Embedder.EmbedderClient embed)
{
// use clients
}This project contains an automated mechanism to always fetch the latest version of the official .proto files from XAI, ensuring it remains up-to-date with any changes or additions made to the API as soon as they are published.
See for example the introduction of tool output and citations.