xAI
Overview
xAI builds Grok, a family of large language models with strong reasoning capabilities. Floopy proxies requests to xAI’s OpenAI-compatible API, supporting both reasoning and non-reasoning modes.
Supported Models
| Model | Context Window | Notes |
|---|---|---|
grok-4.20-reasoning | 131K | Flagship reasoning model |
grok-4.20-non-reasoning | 131K | Flagship model, standard mode |
grok-4.20-multi-agent | 131K | Optimized for multi-agent workflows |
grok-4-1-fast-reasoning | 131K | Cost-efficient reasoning model |
grok-4-1-fast-non-reasoning | 131K | Cost-efficient standard model |
Setup
- Go to Settings > Providers in the dashboard.
- Click Add provider and select xAI.
- Paste your xAI API key and click Save.
Usage
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.floopy.ai/v1", apiKey: process.env.FLOOPY_API_KEY,});
const response = await client.chat.completions.create({ model: "grok-4.20-reasoning", messages: [{ role: "user", content: "Explain quantum computing." }],});from openai import OpenAI
client = OpenAI(base_url="https://api.floopy.ai/v1", api_key=os.environ["FLOOPY_API_KEY"])
response = client.chat.completions.create( model="grok-4.20-reasoning", messages=[{"role": "user", "content": "Explain quantum computing."}],)curl https://api.floopy.ai/v1/chat/completions \ -H "Authorization: Bearer $FLOOPY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "grok-4.20-reasoning", "messages": [{"role": "user", "content": "Explain quantum computing."}]}'Provider-Specific Features
- Reasoning modes — Grok 4.20 supports both reasoning and non-reasoning modes. Use the
-reasoningsuffix for complex tasks requiring chain-of-thought, or-non-reasoningfor faster general-purpose responses. - Cached input discount — xAI offers 90% discount on cached input tokens, reducing cost for repeated contexts.
- Multi-agent support — The
grok-4.20-multi-agentvariant is optimized for orchestrating multi-agent workflows.