xai-grok-api-guide

Integrate xAI Grok API for real-time X/Twitter data in chat completions.

5|Updated May 2, 2026
One-click install
npx skills add https://github.com/nirholas/three-ui --skill xai-grok-api-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xai-grok-api-guide
Source: https://github.com/nirholas/three-ui/tree/main/data/skills/general/xai-grok-api-guide
Command: npx skills add https://github.com/nirholas/three-ui --skill xai-grok-api-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you integrate xAI Grok into your application by explaining how to use the Grok API for real-time X/Twitter-backed responses, including vision and function calling.

Core Features & Use Cases

  • Model selection for Grok (Grok-3, Grok-2, Grok-2-mini): Choose the right model for complex reasoning, fast general tasks, or budget-friendly quick responses.
  • Function calling for tool use: Define callable functions and structured parameters so Grok can trigger your workflows.
  • X/Twitter integration for real-time knowledge: Use Grok’s native X access for searching, sentiment, trending topics, and community pulse analysis.

Quick Start

Use the xAI Grok API to send a chat completion request to model grok-3 using your XAI_API_KEY and ask for trending crypto topics on X in the last 24 hours.

Frequently Asked Questions about xai-grok-api-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use the xAI API to get real-time X Twitter data in chat completions?

To get real-time X Twitter data in chat completions, use the xAI Grok API by sending a request with your XAI_API_KEY to the correct endpoint. Grok natively grounds its responses in real-time X/Twitter data for analytics and queries.

What is the difference between Grok-3, Grok-2, and Grok-2-mini for API model selection?

Grok-3 handles complex reasoning, Grok-2 suits general tasks, and Grok-2-mini provides budget-friendly quick responses. Model selection depends on your specific chat completion needs regarding complexity and speed.

Can I use function calling with the Grok API to trigger external workflows?

Function calling with the Grok API requires structured tool definitions compatible with the OpenAI-style schema. You define callable functions and structured parameters so Grok can trigger your workflows directly.

Do I need an OpenAI-style schema for Grok API vision understanding and tool definitions?

Yes, using an OpenAI-style schema is required for Grok API vision understanding and tool definitions. Correct endpoint usage and structured tool definitions ensure proper function calling and visual analysis.

What are the limitations when integrating Grok for real-time X sentiment analysis?

Limitations include requiring a valid XAI_API_KEY and correct endpoint usage. While Grok natively accesses X for sentiment and trending topics, your structured tool definitions must strictly follow the OpenAI-style schema to function.