xAI (Grok)

Configure xAI Grok models in BraceKit.

xAI (Grok)

xAIโ€™s Grok models offer frontier-level reasoning with exceptional cost efficiency. BraceKit supports both chat and image generation.

Setup

1. Get an API Key

  1. Go to console.x.ai
  2. Sign in or create an account
  3. Navigate to API Keys
  4. Create a new key

2. Configure in BraceKit

  1. Open Settings โ†’ AI Provider
  2. Select xAI from the provider dropdown
  3. Paste your API key
  4. Select a model

Settings are saved automatically as you type.

Available Models

Current Flagship

ModelBest ForContextNotes
grok-4.6Coding, agentic tasks500KCurrent flagship, configurable reasoning
grok-4.5Coding, agentic tasks500KPrevious flagship, configurable reasoning
grok-4.3Balanced workloads1MStrong reasoning + tool use

Grok 4.20 Series

ModelBest ForContextNotes
grok-4.20-0309-reasoningComplex reasoning1MExtended thinking (alias grok-4.20)
grok-4.20-0309-non-reasoningFast responses1MQuick, no reasoning (alias grok-4.20-non-reasoning)
grok-4.20-multi-agent-0309Multi-agent workflows1MCoordinated agent runs

Coding & Media

ModelBest ForNotes
grok-build-0.1Agentic codingCode-first model
grok-imagine-imageImage generationStandard quality
grok-imagine-image-proImage generationHigher quality
grok-imagine-image-qualityImage generationQuality-tuned

Features

Reasoning Mode

Grok 4.x models are reasoning models that show their thinking process:

  1. Click the brain icon (๐Ÿง ) in the toolbar
  2. Send your message
  3. View the reasoning in a collapsible section

Note: Reasoning can be toggled per request. Use the -non-reasoning variants (e.g. grok-4.20-0309-non-reasoning) for quick responses without extended thinking.

Image Generation

Generate images with Grok:

  1. Select an image model (e.g., grok-imagine-image)
  2. Choose an aspect ratio in the toolbar
  3. Describe the image
  4. Image appears in the response
You: Generate a futuristic city skyline at sunset

BraceKit: [Generated image appears here]

See Image Generation for details.

Function Calling

Grok models support tool calling for:

  • MCP server tools
  • Built-in tools (Google Search)

Vision

Grok Vision models can analyze images:

  • Attach images to messages
  • Ask questions about them

Model Parameters

Configure in Settings โ†’ AI Provider under the Advanced section:

ParameterRangeEffect
Temperature0-2Higher = more creative
Max Tokens1-131KMaximum response length

Note: Reasoning models (Grok 4.x) donโ€™t support presencePenalty, frequencyPenalty, or stop parameters.

Image Generation Settings

Aspect RatioBest For
autoModel selects best (xAI only)
1:1Profile pictures, icons
16:9Banners, headers
9:16Stories, mobile
3:2Photography
2:3Portrait photography

Pricing

xAI pricing (per 1M tokens):

ModelInputOutputContext
grok-4.6$2.00$6.00500K
grok-4.5$2.00$6.00500K
grok-4.3$1.25$2.501M
grok-4.20-0309-reasoning$1.25$2.501M
grok-4.20-0309-non-reasoning$1.25$2.501M

Note: Check xAI pricing for current rates. Image generation priced separately.

Troubleshooting

โ€œAPI key invalidโ€

  • Verify your key is correct
  • Check the key hasnโ€™t been revoked
  • Ensure you have credits in your account

โ€œParameter not supportedโ€

  • Reasoning models donโ€™t support presencePenalty, frequencyPenalty, stop
  • Remove these parameters from your request

Image generation slow

  • Image generation takes 10-30 seconds
  • Complex prompts take longer
  • Try simpler prompts for faster results

Model not available

  • Some models require API tier upgrade
  • Check xAI Console for your access