Skip to content

Build AI Agents with xAI

Elon Musk's AI company offering Grok models with real-time information access.

Available xAI Models

ModelID
Grok 2grok-2
Grok 2 Minigrok-2-mini
Grok Betagrok-beta

Why use xAI for AI agents?

Real-time information
Unfiltered responses
X/Twitter integration potential
Strong reasoning

Best use cases

  • News-aware agents
  • Real-time analysis
  • Social media monitoring
  • Trend analysis

Quick start code

agent.py
from agno.agent import Agent
from agno.models.xai import xAI

agent = Agent(
    name="My xAI Agent",
    model=xAI(id="grok-2"),
    instructions=["You are a helpful assistant."],
    markdown=True,
)

agent.print_response("Hello! What can you help me with?")

Install: pip install agno Then set XAI_API_KEY

Contact Us

Press Ctrl+Enter to send