Grok is a conversational AI assistant developed by xAI, designed to provide helpful and informative responses with real-time knowledge. Grok models are known for their strong reasoning capabilities and up-to-date information access.
The sgcWebSockets library provides a Delphi component TsgcHTTP_API_Grok to interact with the Grok API.
The Grok API provides access to Grok models for building AI-powered applications. The API supports text generation, vision (image understanding), streaming, and model listing.
The Grok API uses API keys for authentication. Visit your xAI Console to retrieve the API key you'll use in your requests.
Remember that your API key is a secret! Do not share it with others or expose it in any client-side code.
This API Key must be configured in the GrokOptions.ApiKey property of the component.
Grok := TsgcHTTP_API_Grok.Create(nil);
Grok.GrokOptions.ApiKey := 'YOUR_API_KEY';
Send a structured list of input messages with text content, and the model will generate the next message in the conversation.
Grok can understand images passed as base64-encoded content within messages.
List the available Grok models.