Build With X
Best practices and patterns for xAI's Grok API and X (Twitter) API
Welcome to Build With X! This guide provides comprehensive documentation for working with xAI's Grok API and the X (Twitter) API.
Getting Started
CLI Tool
Install the CLI for quick access to documentation:
bunx build-with-x list # List all topics
bunx build-with-x show <topic> # Show specific topic
bunx build-with-x setup # Clone examples to .reference/xai/Topics
xAI Grok API
| Topic | Description |
|---|---|
| Authentication | API keys, environment setup |
| Text Generation | Chat completions, streaming, function calling |
| Image Generation | Aurora image generation API |
| Voice Agent | WebSocket-based text-to-speech |
X (Twitter) API
| Topic | Description |
|---|---|
| X API Basics | Timeline fetching, posting tweets |
| X API OAuth | OAuth 2.0 PKCE authentication |
| X Search Tool | Grok's x_search function |
General
| Topic | Description |
|---|---|
| Best Practices | Error handling, rate limits, patterns |