{
 "kind": "api",
 "slug": "xai-api",
 "path": "apis/xai-api/",
 "name": "xAI API (Grok)",
 "logo": "https://agentgid.com/media/avatars/xai-org.png",
 "maker": "xAI",
 "density": "basic",
 "crumbs": [
  [
   "APIs",
   "apis/"
  ],
  [
   "Model hosting and inference",
   "apis/inference/"
  ]
 ],
 "lead": "Grok models via API with tool calling and configurable reasoning.",
 "chips": [
  {
   "label": "Model hosting and inference",
   "path": "apis/inference/"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "pip install xai-sdk"
 },
 "links": [
  {
   "label": "Website",
   "href": "https://x.ai"
  },
  {
   "label": "Pricing",
   "href": "https://docs.x.ai/docs/models"
  },
  {
   "label": "GitHub",
   "href": "https://github.com/xai-org/xai-sdk-python"
  }
 ],
 "track": "Outages, price changes and new versions on your dashboard",
 "verdicts": [
  {
   "key": "price",
   "label": "Price",
   "value": "Paid",
   "status": "info",
   "sub": "from $2 per 1M input tokens",
   "quote": null,
   "note": "No free tier on the pricing page. As reported on the official pricing page, checked Oct 22, 2026.",
   "src": "https://docs.x.ai/docs/models"
  },
  {
   "key": "commercial",
   "label": "Commercial use",
   "value": "Not checked yet",
   "status": "unknown",
   "sub": "Read the terms before you ship",
   "note": "We have not read this API's terms yet. Until we do, check its terms of service for commercial use and whether it trains on what you send.",
   "src": "https://x.ai"
  },
  {
   "key": "key",
   "label": "Key & sign-up",
   "value": "Not checked yet",
   "status": "unknown",
   "sub": null,
   "note": "We have not read how this API signs you up and issues keys yet.",
   "src": "https://x.ai"
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "info",
   "sub": "llms.txt · OpenAPI · SDK",
   "quote": null,
   "note": " Our agent check: 4 of 6 (Nov 13, 2026).",
   "src": "https://docs.x.ai/llms.txt"
  }
 ],
 "vfoot": "Checked against the maker's official pages, pricing on Oct 22, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What xAI API (Grok) does",
   "parts": [
    {
     "t": "prose",
     "text": "Grok models via API with tool calling and configurable reasoning."
    },
    {
     "t": "list",
     "items": [
      "xAI API (Grok) is one of 42 APIs in the Model hosting and inference category on AgentGid.",
      "It is not among the 13 that can be started for free.",
      "6 of them ship an official MCP server; xAI API (Grok) does not.",
      "Its official SDK is the 7th most downloaded in the category (917K a week)."
     ],
     "muted": true
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "xAI API (Grok) popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "845K",
       "l": "SDK downloads a week",
       "d": "-19.0% on the 4-week average",
       "up": false
      },
      {
       "n": "18",
       "l": "public agent repos use its SDK"
      },
      {
       "n": "622",
       "l": "GitHub stars, xai-org/xai-sdk-python"
      }
     ]
    },
    {
     "t": "small",
     "text": "SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026."
    }
   ]
  },
  {
   "id": "pricing",
   "nav": "Pricing and limits",
   "h2": "Pricing",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free tier",
       "v": "None"
      },
      {
       "l": "Cheapest plan",
       "v": "No monthly plan"
      },
      {
       "l": "Usage price",
       "v": "Grok 4.7: $2.00 per 1M input tokens, $6.00 per 1M output; 500k context"
      }
     ]
    },
    {
     "t": "small",
     "text": "As reported on the official pricing page, checked Oct 22, 2026. Prices change: confirm before you buy.",
     "link": "docs.x.ai/docs/models",
     "href": "https://docs.x.ai/docs/models"
    }
   ]
  },
  {
   "id": "agent",
   "nav": "For agents",
   "h2": "Use it from an agent",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Our agent check",
       "v": "4 of 6: llms.txt yes, OpenAPI yes, SDK yes, MCP no, status page no, AI assistants allowed yes",
       "sub": "Checked Nov 13, 2026."
      },
      {
       "l": "MCP server",
       "v": "None found",
       "sub": null
      },
      {
       "l": "PyPI",
       "v": "pip install xai-sdk",
       "code": true
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "xAI API (Grok)",
       "me": true,
       "facts": [
        "from $2 per 1M input tokens",
        "No free tier"
       ]
      },
      {
       "name": "OpenAI API",
       "why": "GPT models for text, vision, tool calling and agents, priced per 1M tokens.",
       "path": "apis/openai-api/",
       "facts": [
        "from $0.1",
        "No free tier"
       ]
      },
      {
       "name": "Gemini API",
       "why": "Gemini models for text, image, audio and video input, priced per 1M tokens, with a free tier.",
       "path": "apis/google-gemini-api/",
       "facts": [
        "Free plan",
        "Free tier"
       ]
      },
      {
       "name": "Mistral AI API",
       "why": "Mistral's open-weight and commercial models via API, priced per 1M tokens.",
       "path": "apis/mistral-api/",
       "facts": [
        "from $0.5 per million input tokens",
        "No free tier"
       ]
      },
      {
       "name": "Groq (LLM inference)",
       "why": "Fast inference API for open models such as GPT-OSS and Llama, priced per 1M tokens.",
       "path": "apis/groq/",
       "facts": [
        "from $0.075",
        "No free tier"
       ]
      }
     ],
     "more": "All model hosting and inference APIs",
     "more_path": "apis/inference/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install the official SDK.",
     "code": "pip install xai-sdk"
    },
    {
     "t": "gap",
     "text": "No step-by-step start for xAI API (Grok) yet: we have not written its hand-checked card. Its official docs are linked at the top."
    }
   ]
  }
 ],
 "glance": [
  [
   "Maker",
   "xAI"
  ],
  [
   "Category",
   "Model hosting and inference"
  ],
  [
   "Price",
   "from $2 per 1M input tokens"
  ],
  [
   "Official SDK",
   "PyPI xai-sdk"
  ],
  [
   "Agent check",
   "4 of 6"
  ],
  [
   "Pricing checked",
   "Oct 22, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the official site and pricing page, checked Oct 22, 2026; no hand-checked card yet; usage numbers update daily."
}