xAI (Grok)
Access xAI’s Grok models through NotPixel. Grok is designed for real-time knowledge and witty, engaging responses.
Setup
1. Get API Key
- Go to xAI
- Sign up for API access
- Create an API key
2. Configure Environment
.env
XAI_API_KEY=xai-...Usage
import Ads from 'notpixel';
const ads = new Ads({
publisherId: 'pub_xxx',
model: 'xai/grok-2',
input: 'What happened in tech news today?',
});
const response = await ads.offer();
console.log(response.text);Available Models
| Model | Description |
|---|---|
xai/grok-2 | Latest Grok model |
xai/grok-2-mini | Faster, smaller variant |
Grok has access to real-time information from X (formerly Twitter), making it particularly useful for current events and trending topics.
Environment Variable
| Variable | Description |
|---|---|
XAI_API_KEY | Your xAI API key |