New version available

Refresh to update

Could not apply changes

Grok 4.6

openrouter
x-ai/grok-4.6

xAI flagship reasoning model for coding, agentic tasks, and visual work. Supports image input, function calling, and structured output through the Cloudflare AI model catalog.

Quick start

TypeScript
cURL
import OpenAI from 'openai'

const openai = new OpenAI({
  apiKey: process.env.CODEPLATFORM_API_KEY,
  baseURL: 'https://ai.codeplatform.net/v1',
})

const response = await openai.chat.completions.create({
  model: 'x-ai/grok-4.6',
  messages: [{
    role: 'user',
    content: 'Hello world',
  }],
})

API details

Send requests to the OpenAI-compatible /v1/chat/completions endpoint.

Capabilities

Pricing

Input tokens (per 1M)$2.00
Output tokens (per 1M)$6.00
Cached input (per 1M)$0.50

Limits

Context length500,000 tokens
Max output500,000 tokens