---
title: "Grok API Pricing: Grok 4.6 & Grok 4.5 | Inference.net"
description: "Compare live Grok 4.6 and Grok 4.5 API pricing on Inference.net: 500K context, x-grok-conv-id prompt caching, reasoning, and OpenAI or Anthropic SDKs."
url: "https://inference.net/models/grok/"
---

GROK API

# Grok API

Run xAI Grok 4.6 and Grok 4.5 through one Inference.net API key with OpenAI /v1/chat/completions, /v1/responses, and Anthropic /v1/messages support. Compare live standard and >200K long-context per-token pricing, x-grok-conv-id prompt-cache savings, and 500K-token context windows. Because live Grok models route externally to xAI, they follow xAI's upstream data-handling and retention terms (default Zero Data Retention applies to eligible Inference.net-hosted routes).

- Live Grok 4.6 and Grok 4.5 pricing with 500K context and 500K max output
- Prompt caching via x-grok-conv-id (75% savings on Grok 4.6, 85% on Grok 4.5)
- OpenAI /v1/chat/completions, /v1/responses, and Anthropic /v1/messages support
- Vision input, tool calling, structured outputs, and configurable reasoning

[Get Grok API key](https://inference.net/register/?model=grok-4-6) [Estimate monthly cost](https://inference.net/tools/llm-pricing-calculator/) [Full model catalog](https://inference.net/models/)

LIVE CATALOG & PRICING

## All live Grok models on Inference.net

Every rate, context limit, and capability below is pulled directly from the live public catalog. Select any model for full specs, live latency benchmarks, and prompt-caching guidance.

| Model | Context | Max output | Input / 1M | Cached / 1M | Output / 1M | Capabilities | Start |
| --- | --- | --- | --- | --- | --- | --- | --- |
| [Grok 4.6](https://inference.net/models/grok-4-6/) `grok-4.6` | 500K | 500K | $2.00 | $0.50 | $6.00 | Vision, Tools, Reasoning | [Use API](https://inference.net/register/?model=grok-4-6) |
| [Grok 4.5](https://inference.net/models/grok-4-5/) `grok-4.5` | 500K | 500K | $2.00 | $0.30 | $6.00 | Vision, Tools, Reasoning | [Use API](https://inference.net/register/?model=grok-4-5) |

QUICKSTART

## Call Grok over OpenAI or Anthropic SDKs

Use the top live model ID (`grok-4.6`) with the standard OpenAI SDK, curl, or Claude Code over native `/v1/messages`.

QUICKSTART [Get API key](https://inference.net/register/?model=grok-4-6)

```typescript
import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://api.inference.net/v1',
  apiKey: process.env.INFERENCE_API_KEY,
})

const completion = await client.chat.completions.create({
  model: 'grok-4.6',
  messages: [{ role: 'user', content: 'Hello' }],
})
```

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.inference.net/v1",
    api_key=os.environ["INFERENCE_API_KEY"],
)

completion = client.chat.completions.create(
    model="grok-4.6",
    messages=[{"role": "user", "content": "Hello"}],
)
```

```curl
curl https://api.inference.net/v1/chat/completions \
  -H "Authorization: Bearer $INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4.6",
    "messages": [
      { "role": "user", "content": "Hello" }
    ]
  }'
```

CLAUDE CODE & ANTHROPIC /V1/MESSAGES

Point Claude Code or any Anthropic SDK client at Inference.net with zero proxy setup and full prompt-cache support.

```bash
export ANTHROPIC_BASE_URL="https://api.inference.net"
export ANTHROPIC_AUTH_TOKEN="$INFERENCE_API_KEY"
export ANTHROPIC_MODEL='grok-4.6'
export ANTHROPIC_DEFAULT_OPUS_MODEL='grok-4.6'
export ANTHROPIC_DEFAULT_SONNET_MODEL='grok-4.6'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='grok-4.6'
export CLAUDE_CODE_SUBAGENT_MODEL='grok-4.6'
export CLAUDE_CODE_MAX_CONTEXT_TOKENS="500000"
claude
```

[Claude Code setup guide](https://inference.net/docs/integrations/claude-code/) [Anthropic SDK docs](https://inference.net/docs/api/anthropic-sdk/)

COMPARISONS, GUIDES & TOOLS

## Benchmark, compare, and model Grok costs

Verify unit economics across prompt-cache hit rates, compare providers, and explore engineering guides for Grok.

[COMPARISON Inference.net vs OpenRouter Compare calling Grok 4.6 and open-weight models through one 0% markup Inference.net API key. Read comparison](https://inference.net/compare/inference-net-vs-openrouter/) [COMPARISON Inference.net vs OpenAI API Compare multi-model access across Grok 4.6, GPT, and open-weight models from one SDK. Read comparison](https://inference.net/compare/inference-net-vs-openai-api/) [COMPARISON Inference.net vs Anthropic API Compare calling Grok 4.6 and open models over OpenAI /v1/chat/completions or Anthropic /v1/messages. Read comparison](https://inference.net/compare/inference-net-vs-anthropic-api/) [GUIDE OpenRouter Alternatives Guide Compare unified multi-model APIs for frontier and open-weight models. Read guide](https://inference.net/guides/openrouter-alternatives/) [GUIDE Inference Economics Guide Model standard vs long-context token spend and prompt-cache savings at scale. Read guide](https://inference.net/guides/inference-economics/) [GUIDE Best Open-Source LLMs Guide Compare proprietary frontier models like Grok 4.6 against lower-cost open-weight alternatives. Read guide](https://inference.net/guides/best-open-source-llms/) [CALCULATOR LLM Pricing Calculator Estimate monthly token spend across live Grok models and sibling open-weight tiers. Open calculator](https://inference.net/tools/llm-pricing-calculator/) [CALCULATOR Prompt Cache Calculator Model 50%, 75%, and 90% cache hit-rate savings for multi-turn coding agents and RAG workflows. Calculate savings](https://inference.net/tools/prompt-cache-calculator/) [INTEGRATION Claude Code Integration Connect Claude Code directly to Grok models on Inference.net using native /v1/messages. Read docs](https://inference.net/docs/integrations/claude-code/)

MODEL FAMILIES

## Explore other open-weight model families

Switch across DeepSeek, Kimi, GLM, and the full catalog with one API key and one OpenAI-compatible client.

[DEEPSEEK API DeepSeek API DeepSeek V4.1 Flash, V4 Pro, and V3.2 with up to 1M context and automatic prompt caching on supported V4.1 and V4 Pro routes, plus default ZDR on hosted routes. Explore DeepSeek models](https://inference.net/models/deepseek/) [KIMI API Kimi API Kimi K3.1 Pro, K3, K3 Fast, and K2.6 for agentic coding, multimodal reasoning, and up to 1M context on K3 models. Explore Kimi models](https://inference.net/models/kimi/) [GLM API GLM API GLM-5.3, GLM-5.3 Flash, and GLM-5.2 for low-cost coding agents, tool calling, and up to 1M context. Explore GLM models](https://inference.net/models/glm/) [QWEN API Qwen API Qwen 3.7 Plus, Qwen 3 30B A3B, and Qwen 3 14B with up to 1M context, multimodal input, and implicit caching on Qwen 3.7 Plus. Explore Qwen models](https://inference.net/models/qwen/) [SCHEMATRON API Schematron API Schematron V2 Turbo and V2 Small for high-throughput HTML-to-JSON structured extraction with 128K context, US residency, and default ZDR. Explore Schematron models](https://inference.net/models/schematron/) [FULL CATALOG All Models & Pricing Search, sort, and compare every live open-weight and frontier model on Inference.net. Browse all models](https://inference.net/models/)

FAQ

## Frequently asked questions.

Quick answers to help you get started

### How much does the Grok API cost on Inference.net?

Inference.net currently serves 2 live Grok models with transparent pay-as-you-go per-token billing. Input rates start at $2.00 per 1M input tokens ($6.00 per 1M output tokens) on Grok 4.6. Prompts exceeding 200K input tokens on Grok 4.6 and Grok 4.5 use the long-context tier ($4.00/1M input, $12.00/1M output, and $1.00/1M cached on Grok 4.6 or $0.60/1M cached on Grok 4.5). Every rate in the comparison table above pulls directly from the live public catalog.

### Does Inference.net support prompt caching for Grok models?

Yes. Pass a stable x-grok-conv-id request header across turns in the same conversation while keeping repeated system instructions, tool schemas, and context byte-identical (prompts above 200K input tokens use the long-context cached-read tier). On Grok 4.6, cached input reads are $0.50 per 1M tokens (75% less than standard input). Estimate multi-turn savings with the Prompt Cache Calculator.

### Can I call Grok models with the OpenAI SDK, Anthropic SDK, or Claude Code?

Yes. Point the official OpenAI TypeScript or Python SDK to https://api.inference.net/v1 with your INFERENCE_API_KEY and set model to "grok-4.6". All live Grok catalog models support /v1/chat/completions, /v1/responses, and native Anthropic /v1/messages for Anthropic SDK apps and Claude Code.

### Does Inference.net offer Zero Data Retention for the Grok API?

No. Because Grok 4.6 and Grok 4.5 route externally to xAI rather than running on Inference.net GPUs, they are excluded from Inference.net's Zero Data Retention (ZDR) policy and follow xAI's upstream data-handling and retention terms. Default ZDR under SOC 2 Type II controls applies to eligible Inference.net-hosted routes; review our [ZDR policy](https://inference.net/zero-data-retention/) for full details. Live Grok routes run over the global https://api.inference.net/v1 endpoint.

### What context windows and capabilities do Grok models support?

Live Grok models on Inference.net scale up to a 500K-token context window (500,000 tokens) and up to 500K output tokens on Grok 4.6. Context limits and caching vary by checkpoint, so check each model row above for exact specs and multimodal capabilities.

GET STARTED

## Start calling Grok in minutes

Create a project API key with Zero Data Retention enabled by default on eligible Inference.net-hosted routes and route requests to `grok-4.6` with pay-as-you-go billing.

[Create free API key](https://inference.net/register/?model=grok-4-6) [API quickstart docs](https://inference.net/docs/api/quickstart/)
