xAI Grok provider summary
xAI powers the Grok family of models. Bifrost delegates to the OpenAI implementation with standard parameter filtering, vision support, and reasoning on select models.
Key features:
- Full OpenAI compatibility — chat, text completion, and responses
- Vision support — image URLs and base64 for multimodal models
- Streaming — Server-Sent Events with delta-based updates
- Reasoning — extended thinking on grok-3-mini via reasoning_effort
- Tool calling — function definitions and execution
Common xAI Grok model IDs used in Bifrost routes:
grok-3-20250415(Latest)grok-3-mini-20250415(Efficient, reasoning enabled)grok-2-vision-1212(Vision)
| Property | Details |
|---|---|
| Description | xAI's Grok models for chat, reasoning, vision, and image generation. |
| Provider route on Bifrost | xai/<model> |
| Provider doc | xAI |
| API endpoint for provider | https://api.x.ai |
| Supported endpoints | /v1/chat/completions, /v1/responses, /v1/completions, /v1/images/generations, /v1/models |
Supported operations
Embeddings, Speech, Transcriptions, Files, and Batch return UnsupportedOperationError. See Supported operations in Bifrost docs.
| Operation | Non-streaming | Streaming | Upstream endpoint |
|---|---|---|---|
| Chat Completions | Yes | Yes | /v1/chat/completions |
| Responses API | Yes | Yes | /v1/responses |
| Text Completions | Yes | Yes | /v1/completions |
| Image Generation | Yes | — | /v1/images/generations |
| List Models | Yes | — | /v1/models |
| Embeddings | No | No | - |
| Speech (TTS) | No | No | - |
| Transcriptions (STT) | No | No | - |
| Files | No | No | - |
| Batch | No | No | - |
Supported OpenAI parameters
Quick reference of OpenAI parameters accepted when routing through xAI Grok via Bifrost.
[ "stream", "temperature", "top_p", "max_tokens", "max_completion_tokens", "stop", "tools", "tool_choice", "user", "reasoning", "response_format" ]
Supported xAI Grok models
Use the provider prefix xai/ in Bifrost model routes for deterministic provider targeting.
| Family | Model ID | Bifrost route | Typical usage |
|---|---|---|---|
| Grok 3 | grok-3-20250415 | xai/grok-3-20250415 | Latest model |
| Grok 3 Mini | grok-3-mini-20250415 | xai/grok-3-mini-20250415 | Efficient variant |
| Grok 2 Vision | grok-2-vision-1212 | xai/grok-2-vision-1212 | Vision capabilities |
API reference
OpenAI-compatible endpoints routed to xAI via Bifrost.
1) Chat Completions
Primary path at /v1/chat/completions. xAI supports standard OpenAI chat parameters. See Chat Completions in Bifrost docs and OpenAI Chat Completions.
Filtered parameters
| Parameter | Reason | Notes |
|---|---|---|
| prompt_cache_key | Not supported | Removed for xAI compatibility |
| verbosity | Anthropic-specific | Removed for xAI compatibility |
| store | Not supported | Removed for xAI compatibility |
| service_tier | Not supported | Removed for xAI compatibility |
Reasoning support
grok-3-mini supports extended reasoning via reasoning_effort (e.g. high). Other Grok-3 and Grok-4 models error if this parameter is set. Bifrost converts the internal Reasoning structure to xAI's string format.
Vision support
Vision models accept image URLs, base64-encoded images, and multiple images per message.
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-2-vision-1212",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}
]
}]
}'{
"model": "xai/grok-3-mini",
"messages": [{"role": "user", "content": "Solve this step by step"}],
"reasoning_effort": "high"
}2) Responses API
Forwarded directly to /v1/responses (not chat fallback). Same parameters and message handling as Chat Completions. Full streaming support. See Responses API in Bifrost docs.
ResponsesRequest → /v1/responses → ResponsesResponse
curl -X POST http://localhost:8080/v1/responses \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-3-20250415",
"input": "Hello",
"max_output_tokens": 1024
}'3) Text Completions
Legacy format at /v1/completions. Supports streaming via stream: true. See Text Completions in Bifrost docs.
| Parameter | Mapping | Notes |
|---|---|---|
| prompt | Direct pass-through | |
| max_tokens | max_tokens | |
| temperature | Direct pass-through | |
| top_p | Direct pass-through | |
| stop | Stop sequences | |
| frequency_penalty | Penalty parameters | |
| presence_penalty | Penalty parameters |
curl -X POST http://localhost:8080/v1/completions \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-3-20250415",
"prompt": "Hello, my name is",
"max_tokens": 50
}'4) Image Generation
OpenAI-compatible format at /v1/images/generations. Conversion matches OpenAI Image Generation. Responses unmarshal into BifrostImageGenerationResponse. Streaming not supported. See Image Generation in Bifrost docs.
quality, size, and style are not supported by xAI at this time.
curl -X POST http://localhost:8080/v1/images/generations \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-2-image",
"prompt": "A serene mountain landscape at sunset",
"n": 1
}'5) List Models
GET /v1/models — lists available xAI models with capabilities and context lengths. No request parameters required. See List Models in Bifrost docs.
curl http://localhost:8080/v1/models
Unsupported features
These operations are not offered by the upstream xAI API. Bifrost returns UnsupportedOperationError.
| Feature | Reason |
|---|---|
| Embeddings | Not offered by xAI API |
| Speech/TTS | Not offered by xAI API |
| Transcription/STT | Not offered by xAI API |
| Batch operations | Not offered by xAI API |
| File management | Not offered by xAI API |
Implementation caveats
| Caveat | Impact | Severity |
|---|---|---|
| Reasoning model-specific | Only grok-3-mini supports reasoning_effort; other Grok models error | High |
| Image generation parameters | quality, size, style parameters not supported | Low |
| Vision limited to specific models | Only vision-capable models accept image content | Medium |
| Embeddings unsupported | Embeddings operation returns UnsupportedOperationError | Low |
Authoritative references
- Bifrost xAI provider reference: docs.getbifrost.ai/providers/supported-providers/xai
- xAI API documentation: docs.x.ai
- Bifrost provider support overview: docs.getbifrost.ai/providers/supported-providers/overview