Route requests to
Grok 3 Mini
with Merge Gateway

Apply your own routing policies, reduce token costs automatically, and see every routing decision in real time with Merge Gateway.

What Grok 3 Mini costs to run

| Vendor | Input / 1M tokens | Output / 1M tokens | Zero data retention | | --- | ---: | ---: | --- | | xAI | $0.3000 | $0.5000 | Yes |

Test Grok 3 Mini
with Gateway’s Simulator

See a prompt's output, token spend, latency, and more with Grok 3 Mini.

Route requests to Grok 3 Mini in minutes

To get started in seconds, add our Gateway Implementation skill to your project, or pick your preferred SDK below. Check out our other quick start skills here.
Install the Merge Gateway SDK
Python
Copied!
1$ pip install merge-gateway-sdk
Send a request
Python
Copied!
1from merge_gateway import MergeGateway
2
3client = MergeGateway(api_key="YOUR_API_KEY")
4
5response = client.responses.create(
6    model="openai/gpt-5.2",
7    input=[
8        {"type": "message", "role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
9        {"type": "message", "role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
10    ],
11)
12
13print(response.output[0].content[0].text)
Try a diffrent model
Swap the model string to route to a different provider. No other code changes needed.
Anthropic
Copied!
1response = client.responses.create(
2    model="anthropic/claude-sonnet-4-20250514",
3    input=[
4        {"type": "message", "role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
5        {"type": "message", "role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
6    ],
7)
Point to Gateway
Python
Copied!
1from openai import OpenAI
2
3client = OpenAI(
4    api_key="YOUR_API_KEY",
5    base_url="https://api-gateway.merge.dev/v1/openai",
6)
Send a request
Use the standard chat.completions.create method. No provider prefix needed on the model name.
Python
Copied!
1response = client.chat.completions.create(
2    model="gpt-5.2",
3    messages=[
4        {"role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
5        {"role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
6    ],
7)
8
9print(response.choices[0].message.content)
Install packages
Copied!
1npm install merge-gateway-ai-sdk-provider ai
Create the provider
TypeScript
Copied!
1import { createMergeGateway } from "merge-gateway-ai-sdk-provider";
2
3const gateway = createMergeGateway({
4  apiKey: "YOUR_API_KEY",
5});
Send a request
Use generateText to send a request. Model names use the provider/model format.
TypeScript
Copied!
1import { generateText } from "ai";
2
3const { text } = await generateText({
4  model: gateway("openai/gpt-4o"),
5  prompt: "Explain the concept of recursion in programming with a simple set of examples.",
6});
7
8console.log(text);
If you already have @ai-sdk/openai installed, point it at Gateway with a base URL change:
TypeScript
Copied!
1import { createOpenAI } from "@ai-sdk/openai";
2
3const gateway = createOpenAI({
4  apiKey: "YOUR_API_KEY",
5  baseURL: "https://api-gateway.merge.dev/v1/ai-sdk",
6});
7
8// All generateText/streamText calls work unchanged
Install the Merge Gateway SDK
Anthropic SDK
Copied!
1from anthropic import Anthropic
2
3client = Anthropic(
4    api_key="YOUR_API_KEY",
5    base_url="https://api-gateway.merge.dev/v1/anthropic",
6)
7
8message = client.messages.create(
9    model="claude-sonnet-4-20250514",
10    max_tokens=1024,
11    messages=[
12        {"role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
13    ],
14)
15
16print(message.content[0].text)

Explore other models available in Merge Gateway

model logo
Amazon Nova 2 Lite
model logo
Amazon Nova 2 Sonic
model logo
Amazon Nova Lite
model logo
Amazon Nova Micro
model logo
Amazon Nova Premier
model logo
Amazon Nova Pro
model logo
Claude 3.7 Sonnet
model logo
Claude Haiku 4.5 (20251001)
model logo
Claude Opus 4.6
model logo
Claude Opus 4.7
model logo
Claude Opus 4.8
model logo
Claude Sonnet 4.5
model logo
Claude Sonnet 4.6
model logo
Claude Sonnet 5
model logo
Codestral
model logo
Codestral 25.08
model logo
Command R 08-2024
model logo
Command R+ 08-2024
model logo
Command R7B 12-2024
model logo
DeepSeek R1
model logo
DeepSeek V3
model logo
DeepSeek V3.2
model logo
DeepSeek V4 Flash
model logo
DeepSeek V4 Pro

Grok 3 Mini FAQ

In case you have any other questions on Grok 3 Mini, we've answered a few more below. Note that the information below was written in June, 2026 and is subject to change.

Heading

What other models does xAI offer?

xAI develops the Grok model family, covering non-reasoning general-purpose models and reasoning-capable variants across multiple capability tiers. Here are some other models xAI supports:

  • Grok 3: Grok 3 is xAI's primary non-reasoning general-purpose model, priced at $4.00 per 1M input tokens and $20.00 per 1M output tokens, with a 1 million token context window and text-plus-image output capability, positioned for high-quality text generation where extended reasoning is not required
  • Grok 4: Grok 4 is xAI's current flagship reasoning model, priced at $5.50 per 1M input tokens and $27.50 per 1M output tokens, with a 256k-token context window and image input support, targeting complex multi-step reasoning tasks at the top of xAI's capability tier
  • Grok 4.3 (non-reasoning): Grok 4.3 is the latest non-reasoning model in xAI's lineup, priced at a $0.64 blended rate per 1M tokens, supporting a 1 million token context window and offering updated performance for general-purpose inference

How does Grok 3 Mini differ from xAI's other models?

Grok 3 Mini is xAI's cost-efficient reasoning model, designed for high-throughput workloads where chain-of-thought quality is needed but the full cost of Grok 3 or Grok 4 is not justified.

  • Pricing: Grok 3 Mini is priced at $0.30 per 1M input tokens and $0.50 per 1M output tokens, with a blended rate of $0.16 per 1M tokens and cache hits discounted to $0.075 per 1M tokens. Grok 3 costs $4.00 input and $20.00 output, making Grok 3 Mini roughly one-thirteenth the cost per output token for applications where the smaller model's reasoning quality is sufficient
  • Context window: Grok 3 Mini supports a 1 million token context window, matching Grok 3 and exceeding Grok 4's 256k-token limit, making it the most context-capable option in xAI's lineup at the lowest price point
  • Speed: Grok 3 Mini generates approximately 93.5 tokens per second, ranking #68 of 161 comparable models. This is below average for its class, though its time-to-first-token of 0.63 seconds is described as very competitive
  • Reasoning capability: Grok 3 Mini is a reasoning model with extended chain-of-thought processing. Grok 3 is a non-reasoning model, making Grok 3 Mini the entry point for deliberative inference within xAI's lineup without paying Grok 4 pricing
  • Intelligence ranking: Grok 3 Mini scores 32 on the Artificial Analysis Intelligence Index, ranking #46 of 161 comparable models, described as above average among reasoning models
  • Modality: Grok 3 Mini accepts text input only. Grok 4 accepts image input, and Grok 3 produces image output; Grok 3 Mini does not handle any non-text modalities

Grok 3 Mini is the right choice when you need reasoning capability from xAI at a fraction of the cost of Grok 3 or Grok 4, and your workload is text-only within a 1 million token context window.

What models should I consider using alongside Grok 3 Mini?

No single model is optimal for every task. Here are models worth pairing with Grok 3 Mini depending on what your product needs:

  • Grok 4 (xAI): For requests that require xAI's highest reasoning depth, such as complex multi-step problem solving or adversarial logic tasks, routing up to Grok 4 provides the full reasoning capability without changing providers or credentials
  • GPT-4o mini (OpenAI): For lightweight classification, extraction, and short-form generation tasks that do not require reasoning, GPT-4o mini provides a well-supported, broadly available option at a comparable cost tier, and its multimodal capability covers image inputs that Grok 3 Mini cannot handle
  • DeepSeek R1 (DeepSeek): For open-weight reasoning workloads where self-hosting or provider redundancy is a goal, DeepSeek R1 competes on reasoning benchmarks with Grok 3 Mini and offers flexible deployment options as a fallback when xAI is unavailable
  • Claude Sonnet 4 (Anthropic): For tasks requiring precise instruction following, structured data extraction, or consistent output formatting across varied prompts, Claude Sonnet 4 provides strong benchmark performance and broad enterprise support that complements Grok 3 Mini's reasoning capability
  • MiniMax M2.5 (MiniMax): For latency-sensitive reasoning pipelines where throughput is critical, MiniMax M2.5's 191 tokens per second output speed is approximately twice Grok 3 Mini's, making it a high-throughput reasoning alternative for time-sensitive use cases

What are the challenges of using Grok 3 Mini in my product?

Like any production LLM, Grok 3 Mini comes with tradeoffs worth planning for:

  • Verbose output behavior: Grok 3 Mini generated 100 million output tokens during Intelligence Index evaluation, compared to a peer average of 27 million, indicating significantly verbose generation patterns. Applications that do not apply output length constraints will incur higher-than-expected costs and longer response times
  • Below-average throughput: At 93.5 tokens per second, Grok 3 Mini ranks below the median for its model class. For real-time streaming applications or high-concurrency workloads, this throughput may create latency issues without careful request batching or parallelism
  • Text-only input: Grok 3 Mini does not accept image input. Any multimodal workflow in your product will require routing vision tasks to a separate model, adding integration and routing complexity
  • Provider dependency: xAI does not operate through a major cloud platform's model marketplace, meaning all Grok 3 Mini traffic flows through xAI's own infrastructure. An outage, rate limit change, or API policy update directly affects your application with no built-in provider fallback
  • Cost at scale: While Grok 3 Mini is inexpensive at the per-token level, its verbose generation tendencies mean actual output token volumes can run significantly higher than comparable models. At high request volumes, the combination of verbosity and throughput constraints may require active prompt engineering and cost monitoring

Why should I use Merge Gateway to route LLM requests with Grok 3 Mini and every other model?

Using Grok 3 Mini through Merge Gateway gives you access to the model itself and the infrastructure layer around it:

  • One API, every provider: Access Grok 3 Mini and every other major LLM through a single endpoint and API key. Change providers by swapping the model string, with no application code changes required
  • Intelligent routing and automatic failover: Merge routes around xAI outages automatically. Because all Grok 3 Mini traffic flows through xAI's own infrastructure, an automatic failover layer is especially valuable for maintaining uptime when the provider is unavailable
  • Cost governance: Set hard or soft project budgets so Grok 3 Mini spend stays within plan. Given the model's verbose output tendencies, budget controls and per-project attribution in a unified billing dashboard are particularly useful for keeping spend predictable
  • Build Your Own Router: Define what "best" means for your traffic by selecting from curated ML benchmarks or adding your own eval scores. The router scores each available model against your weights and picks the winner per request, with a plain-language explanation of every decision
  • Security and compliance controls: Apply DLP rules and prompt injection protection before every request reaches xAI. Enforce per-project model and region policies without adding that logic to your application

How can I start routing requests to Grok 3 Mini via Merge Gateway?

Getting Grok 3 Mini running through Merge Gateway takes a few minutes:

1. Create an account and get your API key from the dashboard.

2. Install the Merge Gateway SDK: run pip install merge-gateway-sdk (Python) or npm install merge-gateway-sdk (Node). Alternatively, if you're already using the OpenAI SDK, set base_url = "https://api-gateway.merge.dev/v1/openai" and your existing code works as-is.

3. Make your first request using the provider/model format. For Grok 3 Mini, the model string is xai/grok-3-mini. Swap the model string to route to any other provider without changing anything else.

4. Configure a routing policy in the dashboard to set failover behavior, cost limits, and optimization strategy. Your first policy can be as simple as naming Grok 3 Mini as primary with Grok 4 as a quality escalation path and a non-reasoning model as a cost fallback for simple requests.

Full setup instructions and SDK references are in the Merge Gateway docs.

Try Grok 3 Mini through Merge Gateway

Route, observe, and control AI requests across providers from one API.