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. Click xAI in the provider grid
  3. Paste your API key
  4. Select a model

Settings are saved automatically as you type.

Available Models

Grok 4.1 Series (Latest)

ModelBest ForContextNotes
grok-4-1-fast-reasoningComplex reasoning2MExtended thinking, best quality
grok-4-1-fast-non-reasoningFast responses2MQuick, capable, cost-efficient

Grok 4 Series

ModelBest ForContextNotes
grok-4Complex tasks131KReasoning model
grok-4-fast-reasoningReasoning2MFaster reasoning variant
grok-4-fast-non-reasoningGeneral use2MFast, no reasoning

Grok 3 Series

ModelBest ForContextNotes
grok-3General use131KBalanced performance
grok-3-miniQuick tasks131KFaster, cheaper

Image Generation

ModelBest ForNotes
grok-2-image-1212Image generationLatest image model
grok-imagine-imageImage generationStandard quality
grok-imagine-image-proImage generationHigher quality

Features

Reasoning Mode

Grok 4 and 4.1 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: Grok 4 and 4.1 always use reasoning โ€” thereโ€™s no non-reasoning mode for the base models. Use grok-4-1-fast-non-reasoning or grok-4-fast-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, Grok 4.1) 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-1-fast-reasoning$0.20$0.502M
grok-4-0709$3.00$15.00131K
grok-3$3.00$15.00131K
grok-3-mini$0.30$0.50131K

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