jpskill.com
🛠️ 開発・MCP コミュニティ

xai-models

xAIのGrokモデルについて、タスクに合わせて最適なモデルを選んだり、機能比較やコスト最適化をしたりする際に役立つ情報を提供するSkill。

📜 元の英語説明(参考)

xAI Grok model selection and capabilities guide. Use when choosing the right Grok model for your task, comparing model features, or optimizing costs.

🇯🇵 日本人クリエイター向け解説

一言でいうと

xAIのGrokモデルについて、タスクに合わせて最適なモデルを選んだり、機能比較やコスト最適化をしたりする際に役立つ情報を提供するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o xai-models.zip https://jpskill.com/download/9532.zip && unzip -o xai-models.zip && rm xai-models.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9532.zip -OutFile "$d\xai-models.zip"; Expand-Archive "$d\xai-models.zip" -DestinationPath $d -Force; ri "$d\xai-models.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して xai-models.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → xai-models フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

xAI Grok モデルガイド

適切な Grok モデルをユースケースに合わせて選択するための完全なガイドです。価格と機能の比較も含まれています。

モデルクイックリファレンス

モデル 最適な用途 入力 $/1M 出力 $/1M コンテキスト
grok-4-1-fast ツール呼び出し、エージェント $0.20 $0.50 2M
grok-4 複雑な推論 $3.00 $15.00 256K
grok-3-fast 一般的なタスク $0.20 $0.50 131K
grok-3-mini 軽量なタスク $0.30 $0.50 131K
grok-2-vision 画像分析 $2.00 $10.00 32K

モデル選択デシジョンツリー

主なニーズは何ですか?
│
├─► ツール呼び出し / エージェントワークフロー
│   └─► grok-4-1-fast ($0.20/$0.50)
│
├─► 複雑な推論 / 分析
│   └─► grok-4 ($3.00/$15.00)
│
├─► 一般的なチャット / 簡単なタスク
│   └─► grok-3-fast ($0.20/$0.50)
│
├─► 大量処理 / コスト重視
│   └─► grok-3-mini ($0.30/$0.50)
│
└─► 画像/ビジョンタスク
    └─► grok-2-vision ($2.00/$10.00)

詳細なモデルプロファイル

grok-4-1-fast (ほとんどの用途に推奨)

最適な用途: ツール呼び出し、エージェントワークフロー、リアルタイム検索

# X 検索とセンチメント分析に最適な選択肢
response = client.chat.completions.create(
    model="grok-4-1-fast",
    messages=[{"role": "user", "content": "Search X for AAPL sentiment"}]
)

特徴:

  • 200万トークンのコンテキストウィンドウ
  • ツール呼び出しに最適化
  • 高速な応答時間
  • 最高の価格/性能比

バリアント:

  • grok-4-1-fast-reasoning - 最大限の知能
  • grok-4-1-fast-non-reasoning - 即時の応答

grok-4

最適な用途: 深い分析、複雑な推論、研究

# 複雑な複数ステップの分析に使用
response = client.chat.completions.create(
    model="grok-4",
    messages=[{"role": "user", "content": "Analyze market trends..."}]
)

特徴:

  • 最高の推論能力
  • 複雑なタスクに最適
  • 256K のコンテキストウィンドウ

grok-3-fast

最適な用途: 汎用、バランスの取れたパフォーマンス

# ほとんどのタスクに適したデフォルトの選択肢
response = client.chat.completions.create(
    model="grok-3-fast",
    messages=[{"role": "user", "content": "Summarize this..."}]
)

特徴:

  • 高速な応答
  • 131K のコンテキスト
  • スピード/品質の良好なバランス

grok-3-mini

最適な用途: 大量処理、コスト重視のアプリケーション

# 大量処理に使用
response = client.chat.completions.create(
    model="grok-3-mini",
    messages=[{"role": "user", "content": "Classify: ..."}]
)

特徴:

  • 最小のレイテンシ
  • 最も費用対効果が高い
  • 簡単なタスクに適しています

grok-2-vision

最適な用途: 画像分析、チャート、スクリーンショット

import base64

# 画像をエンコード
with open("chart.png", "rb") as f:
    image_data = base64.b64encode(f.read()).decode()

response = client.chat.completions.create(
    model="grok-2-vision",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "Analyze this chart"},
            {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_data}"}}
        ]
    }]
)

コスト最適化戦略

1. 適切なモデルを使用する

# フィルタリング/分類には mini を使用
filter_response = client.chat.completions.create(
    model="grok-3-mini",
    messages=[{"role": "user", "content": f"Is this relevant? {text}"}]
)

# 分析には fast を使用
if is_relevant:
    analysis = client.chat.completions.create(
        model="grok-4-1-fast",
        messages=[{"role": "user", "content": f"Analyze: {text}"}]
    )

2. キャッシュを活用する

キャッシュされた入力トークンは 75% 安価です。

  • 通常: $0.20/1M
  • キャッシュ: $0.05/1M

3. 類似のリクエストをバッチ処理する

# 10 回の個別の呼び出しの代わりに、バッチ処理します
texts = ["text1", "text2", "text3"]
batch_prompt = "Analyze these texts:\n" + "\n".join(texts)

response = client.chat.completions.create(
    model="grok-3-fast",
    messages=[{"role": "user", "content": batch_prompt}]
)

ツール呼び出しのコスト

ツール 1,000 回の呼び出しあたりのコスト
X Search $5.00
Web Search $5.00
Code Execution $5.00
Document Search $2.50

コンテキストウィンドウの比較

モデル コンテキスト テキストのページ数 オーディオの時間
grok-4-1-fast 2M ~6,000 ~50
grok-4 256K ~800 ~6
grok-3-fast 131K ~400 ~3
grok-2-vision 32K ~100 ~1

モデル機能マトリックス

機能 4.1 Fast 4 3 Fast 3 Mini 2 Vision
ツール呼び出し ⭐⭐⭐ ⭐⭐
推論 ⭐⭐ ⭐⭐⭐ ⭐⭐ ⭐⭐
スピード ⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐ ⭐⭐
コスト ⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐ ⭐⭐
ビジョン ⭐⭐⭐
X Search ⭐⭐⭐ ⭐⭐ ⭐⭐

推奨構成

金融センチメントパイプライン

MODELS = {
    "filter": "grok-3-mini",      # 高速フィルタリング
    "analyze": "grok-4-1-fast",   # ツール呼び出し + 分析
    "deep": "grok-4"              # 複雑な推論 (まれ)
}

大量処理

MODELS = {
    "bulk": "grok-3-mini",
    "quality_check": "grok-3-fast"
}

研究 & 分析

MODELS = {
    "search": "grok-4-1-fast",
    "analyze": "grok-4",
    "summarize": "grok-3-fast"
}

API 使用例

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("XAI_API_KEY"),
    base_url="https://api.x.ai/v1"
)

# 利用可能なモデルをリスト表示
models = client.models.list()
for model in models.data:
    print(f"{model.id}")

# 特定のモデルを使用
response = client.chat.completions.create(
    model="grok-4-1-fast",
    messages=[{"role": "user", "content": "Hello!"}],
    max_tokens=100
)

関連スキル

  • xai-auth - 認証設定
  • xai-agent-tools - ツール呼び出し
  • xai-sentiment - センチメント分析

参考文献

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

xAI Grok Models Guide

Complete guide to selecting the right Grok model for your use case, with pricing and capability comparisons.

Model Quick Reference

Model Best For Input $/1M Output $/1M Context
grok-4-1-fast Tool calling, agents $0.20 $0.50 2M
grok-4 Complex reasoning $3.00 $15.00 256K
grok-3-fast General tasks $0.20 $0.50 131K
grok-3-mini Lightweight tasks $0.30 $0.50 131K
grok-2-vision Image analysis $2.00 $10.00 32K

Model Selection Decision Tree

What's your primary need?
│
├─► Tool calling / Agent workflows
│   └─► grok-4-1-fast ($0.20/$0.50)
│
├─► Complex reasoning / Analysis
│   └─► grok-4 ($3.00/$15.00)
│
├─► General chat / Simple tasks
│   └─► grok-3-fast ($0.20/$0.50)
│
├─► High volume / Cost sensitive
│   └─► grok-3-mini ($0.30/$0.50)
│
└─► Image/Vision tasks
    └─► grok-2-vision ($2.00/$10.00)

Detailed Model Profiles

grok-4-1-fast (Recommended for Most Uses)

Best for: Tool calling, agentic workflows, real-time search

# Best choice for X search and sentiment analysis
response = client.chat.completions.create(
    model="grok-4-1-fast",
    messages=[{"role": "user", "content": "Search X for AAPL sentiment"}]
)

Features:

  • 2 million token context window
  • Optimized for tool calling
  • Fast response times
  • Best price/performance ratio

Variants:

  • grok-4-1-fast-reasoning - Maximum intelligence
  • grok-4-1-fast-non-reasoning - Instant responses

grok-4

Best for: Deep analysis, complex reasoning, research

# Use for complex multi-step analysis
response = client.chat.completions.create(
    model="grok-4",
    messages=[{"role": "user", "content": "Analyze market trends..."}]
)

Features:

  • Highest reasoning capability
  • Best for complex tasks
  • 256K context window

grok-3-fast

Best for: General purpose, balanced performance

# Good default choice for most tasks
response = client.chat.completions.create(
    model="grok-3-fast",
    messages=[{"role": "user", "content": "Summarize this..."}]
)

Features:

  • Fast responses
  • 131K context
  • Good balance of speed/quality

grok-3-mini

Best for: High-volume, cost-sensitive applications

# Use for bulk processing
response = client.chat.completions.create(
    model="grok-3-mini",
    messages=[{"role": "user", "content": "Classify: ..."}]
)

Features:

  • Lowest latency
  • Most cost-effective
  • Good for simple tasks

grok-2-vision

Best for: Image analysis, charts, screenshots

import base64

# Encode image
with open("chart.png", "rb") as f:
    image_data = base64.b64encode(f.read()).decode()

response = client.chat.completions.create(
    model="grok-2-vision",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "Analyze this chart"},
            {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_data}"}}
        ]
    }]
)

Cost Optimization Strategies

1. Use the Right Model

# For filtering/classification - use mini
filter_response = client.chat.completions.create(
    model="grok-3-mini",
    messages=[{"role": "user", "content": f"Is this relevant? {text}"}]
)

# For analysis - use fast
if is_relevant:
    analysis = client.chat.completions.create(
        model="grok-4-1-fast",
        messages=[{"role": "user", "content": f"Analyze: {text}"}]
    )

2. Leverage Caching

Cached input tokens are 75% cheaper:

  • Regular: $0.20/1M
  • Cached: $0.05/1M

3. Batch Similar Requests

# Instead of 10 separate calls, batch them
texts = ["text1", "text2", "text3"]
batch_prompt = "Analyze these texts:\n" + "\n".join(texts)

response = client.chat.completions.create(
    model="grok-3-fast",
    messages=[{"role": "user", "content": batch_prompt}]
)

Tool Calling Costs

Tool Cost per 1,000 calls
X Search $5.00
Web Search $5.00
Code Execution $5.00
Document Search $2.50

Context Window Comparison

Model Context Pages of Text Hours of Audio
grok-4-1-fast 2M ~6,000 ~50
grok-4 256K ~800 ~6
grok-3-fast 131K ~400 ~3
grok-2-vision 32K ~100 ~1

Model Capabilities Matrix

Capability 4.1 Fast 4 3 Fast 3 Mini 2 Vision
Tool Calling ⭐⭐⭐ ⭐⭐
Reasoning ⭐⭐ ⭐⭐⭐ ⭐⭐ ⭐⭐
Speed ⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐ ⭐⭐
Cost ⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐ ⭐⭐
Vision ⭐⭐⭐
X Search ⭐⭐⭐ ⭐⭐ ⭐⭐

Recommended Configurations

Financial Sentiment Pipeline

MODELS = {
    "filter": "grok-3-mini",      # Fast filtering
    "analyze": "grok-4-1-fast",   # Tool calling + analysis
    "deep": "grok-4"              # Complex reasoning (rare)
}

High-Volume Processing

MODELS = {
    "bulk": "grok-3-mini",
    "quality_check": "grok-3-fast"
}

Research & Analysis

MODELS = {
    "search": "grok-4-1-fast",
    "analyze": "grok-4",
    "summarize": "grok-3-fast"
}

API Usage Example

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("XAI_API_KEY"),
    base_url="https://api.x.ai/v1"
)

# List available models
models = client.models.list()
for model in models.data:
    print(f"{model.id}")

# Use specific model
response = client.chat.completions.create(
    model="grok-4-1-fast",
    messages=[{"role": "user", "content": "Hello!"}],
    max_tokens=100
)

Related Skills

  • xai-auth - Authentication setup
  • xai-agent-tools - Tool calling
  • xai-sentiment - Sentiment analysis

References