Providers
grok
xAI Grok — streaming chat + tool calls. OpenAI-compatible API surface.
import { grok } from '@agentskit/adapters'
const adapter = grok({
apiKey: process.env.XAI_API_KEY!,
model: 'grok-4',
})#Options
| Option | Type | Default |
|---|---|---|
apiKey | string | required |
model | string | required |
baseUrl | string | https://api.x.ai/v1 |
fetch | typeof fetch | global |
#Model examples
grok-4 · grok-code-fast-1 · grok-4-fast.
#Env
| Var | Purpose |
|---|---|
XAI_API_KEY | API key from x.ai |
#Notes
- OpenAI-compatible
/chat/completionsendpoint — works with many OpenAI SDK idioms. - Streaming via SSE.
#Related
Explore nearby
- PeerProviders
25 native chat and embedder adapters, plus higher-order adapters that compose candidates. Separate from the 140-provider models catalog.
- PeerChoosing an adapter
Capability decision table and rules of thumb for picking a chat adapter.
- PeerHosted chat adapters
17 managed-LLM adapters. Same contract; swap by changing one import.