Skip to main content

xAI Grok

Sinaptic® DROID+ supports xAI's Grok models via the xAI API, which is OpenAI-compatible.

Setup

  1. Get an API key from console.x.ai
  2. Add it to your environment or .env file:
export GROK_API_KEY=xai-...
  1. Configure in droid.yaml:
grok:
base_url: "https://api.x.ai/v1"
api_key: "${GROK_API_KEY}"

Agent Config

name: "grok-agent"
model:
provider: "grok"
name: "grok-2"
max_tokens: 2048
temperature: 0.7

Available Models

ModelBest forContext
grok-2General purpose, strong reasoning128K
grok-2-miniFast, cost-effective128K

Check xAI's documentation for the latest models.

Notes

  • The xAI API is OpenAI-compatible, so Grok works seamlessly with Sinaptic® DROID+ function calling and tools.
  • Grok models have real-time knowledge capabilities depending on the model version.
  • Sinaptic® DROID+ routes requests to the xAI endpoint when an agent specifies provider: "grok".