Skip to main content

Quick Start

Get started with xAI in under 2 minutes:

Add Provider in Model Catalog

Before making requests, add xAI to your Model Catalog:
  1. Go to Model Catalog → Add Provider
  2. Select xAI
  3. Enter your xAI API key
  4. Name your provider (e.g., x-ai)

Complete Setup Guide

See all setup options and detailed configuration instructions

xAI Capabilities

Tool Calling (Function Calling)

Vision

Process images with Grok’s vision capabilities:

Supported Models

xAI offers powerful models through Grok:
ModelContext LengthDescription
grok-beta131,072 tokensLatest Grok model with enhanced capabilities
grok-2-121232,768 tokensPrevious generation Grok model
Check xAI’s documentation for the latest model information.

Next Steps

Gateway Configs

Add fallbacks, load balancing, and more

Observability

Monitor and trace your xAI requests

Guardrails

Enforce input/output checks on requests

Prompt Library

Manage and version your prompts
For complete SDK documentation:

SDK Reference

Complete Portkey SDK documentation

FAQs

Sign up at xAI and generate your API key from the console.
xAI typically provides free credits to start. Contact their support team for additional credits.
Check your current rate limits in the xAI console. Use Portkey’s load balancing to distribute requests across multiple providers.
Last modified on April 8, 2026