Quick Start
Get started with xAI in under 2 minutes:Add Provider in Model Catalog
Before making requests, add xAI to your Model Catalog:- Go to Model Catalog → Add Provider
- Select xAI
- Enter your xAI API key
- 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:| Model | Context Length | Description |
|---|---|---|
| grok-beta | 131,072 tokens | Latest Grok model with enhanced capabilities |
| grok-2-1212 | 32,768 tokens | Previous generation Grok model |
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
SDK Reference
Complete Portkey SDK documentation
FAQs
How do I get an xAI API key?
How do I get an xAI API key?
Sign up at xAI and generate your API key from the console.
Is the xAI API free to use?
Is the xAI API free to use?
xAI typically provides free credits to start. Contact their support team for additional credits.
How do I handle xAI rate limits?
How do I handle xAI rate limits?
Check your current rate limits in the xAI console. Use Portkey’s load balancing to distribute requests across multiple providers.

