SlimeTree-RLM × X Integration (Grok-only)

Wraps the X (formerly Twitter) platform API with RLM pre-filter + Grok delegation. Cuts LLM cost by 60-80%, ships with a SHA-256 audit chain, MIT source.

LLM delegation = Grok (xAI) exclusive ― using other LLMs on X data risks X API access restrictions. Platform-native LLM principle.
Issue a Grok API key at console.x.ai (paid, token-based).

Why X integration is Grok-only

X (owned by xAI) is tightening API governance against X-data processing via competitor LLM providers (OpenAI / Anthropic / Google).
"If you process data on X, use xAI's own Grok" is the access-policy-aligned answer ― this library is therefore designed as X integration = Grok only. For generic prompt processing where vendor choice matters, use the Meta Gateway (Gemini / Claude / OpenAI selectable).

* Architectural principle: "Platform-native LLM" ― Meta = neutral / X = Grok / Google = Gemini / Microsoft (planned) = Azure OpenAI.

Integration routes

Public X API v2 + Grok xAI

▸ Stop a viral-risk Post before it ships

Posts automated posting (µ-prefilter)

RLM pre-judges the draft; on µ, warn before posting. Real posting via X API v2 (POST /2/tweets); Dry-run (curl preview) also supported. Requires X Basic ($200/month) or higher.

Open the demo →

Public X Login + Grok xAI

▸ Operate X safely through an internal AI gateway

X Prompt Gateway

Log in with the X account → in-browser RLM produces a D / µ / R verdict → only R goes to the Grok API. Same shape as the Meta Gateway, specialized for X Login + Grok.

Open the demo →

Public X DM API + Grok xAI

▸ Don't pipe brand-account DM spam through the AI

DM safe bot (D/µ/R pre-filter)

RLM classifies incoming DMs → D=instant FAQ / µ=spam suppression / R=Grok delegation. X DM API requires X Pro ($5,000/month) or higher. Investment solicitation / affiliate spam is screened out deterministically.

Open the demo →

Public X API v2 + Grok xAI

▸ Consistent-quality auto-replies to @-mentions

Mentions auto-reply bot

GET @-mentions → RLM classifies into D/µ/R → D=instant FAQ / µ=silent / R=Grok delegation. Frequent FAQs answered at zero tokens; only nuanced cases reach Grok.

Open the demo →

Public X API v2 generic xAI

▸ Hit any X API endpoint from one UI

X API generic client

X API v2 (Tweets / Users / Spaces / Lists / Trends) from a single panel. Post-stage RLM analysis of response text (via Grok), curl-equivalent display, history.

Open the demo →

Public Spaces / Lists / Trends xAI

▸ Automate community operations

Spaces / Lists integration

Host automation for X Spaces (audio), List management, and Trend monitoring bots. Requires X Pro API; extensible on demand.

Open the demo →

NEXT THEME · 2026-05-30 X = Grok-only grok-3-mini → grok-3 tiering

★ What multi-agent extension changes ✅ X 6/6 B mode shipped (in-Grok)

X integration is Platform-native = Grok-only (aligned with X API access policy).
Within that constraint, within-vendor tiered escalation: grok-3-mini (cheap) → grok-3 (premium) plus role-splitting via system prompts inside the same model makes B / C / D / E work fully. A (cross-validation) / F (voting) are substituted via temperature sampling inside Grok.

X route Matching pattern Concrete use case (Grok-only)
GatewayB Cost-tier (in-Grok)Try all R on grok-3-mini → escalate only insufficient items to grok-3. Stays within X Premium billing; preserves X-native LLM alignment.
Posts botB + A Tiered + verificationgrok-3-mini drafts → grok-3 (high-T) and grok-3 (low-T) double-check; post on agreement. Viral-risk avoidance + cost control.
DM botD Orchestrator-workergrok-3-mini determines intent (sales / complaint / fan / spam) → intent-specific grok-3 generates the long reply. Orchestrator and worker are both Grok.
Mentions botC Specialist routingBy @mention category (product question / complaint / fan reaction / press citation), switch system prompts = virtual 4-specialist agents inside one Grok.
X API genericC + E Routing + critiqueAgents differ by endpoint type; response verification via a grok-3 (proposer) ↔ grok-3 (critic) loop converges quality. In-Grok debate.
Spaces / ListsF Consensus (in-Grok sampling)Sample the same summarization task N times on grok-3 and take the majority answer (single-vendor analogue of voting). Stabilizes long-audio summaries from Spaces and similar.

Design guidance under the Grok-only constraint

  • "In-vendor tiering" is the sweet spot ― xAI offers clear two-tier separation (grok-3-mini and grok-3) plus temperature control. B/D/C/E ride naturally.
  • Cases that demand cross-vendor verification fall outside X integration ― "Verify with both Gemini and Claude" cases belong on Meta integration. Separate roles cleanly.
  • Unified with X Premium / X API tier billing ― Grok ships within X Premium on some plans, so no extra LLM billing is required. An invoice-consolidation win for enterprise.
  • F (consensus) substitutes via N-temperature sampling ― call the same Grok model 3 times at T=0.2 / 0.5 / 0.9 and take the majority answer (weaker than cross-vendor voting, strong enough for stabilization).
Premise of the numbers: the shared cost estimate (10,000 DMs/month with pattern B saves -82.6%) on the service page #multi-agent-saving is based on Gemini Flash unit prices. A Grok-priced version will be appended after xAI publishes updated rates (as of 2026-05, grok-3-mini ≈ $0.30/1M in, $0.50/1M out).

6 patterns in detail → Layered-cut numbers →

Common pattern (all 5 routes)

AuthenticationOAuth 2.0 (X Login) ― scopes tweet.read + tweet.write + users.read + dm.read + dm.write
LLM delegationGrok (xAI) only. Endpoint = https://api.x.ai/v1/chat/completions (OpenAI-compatible, Bearer token)
VerdictD = instant (no Grok call) / μ = suppressed / R = Grok delegation
AuditEvery query chained via SHA-256; exportWAL() emits JSON → archive to S3 etc.
X API tierRead = Free is OK, Post = Basic ($200/month) or higher, DM = Pro ($5,000/month) or higher. See developer.x.com
Grok pricingToken-based (varies by model). Check console.x.ai
LicenseIntegration code = MIT (public) / actual WASM = JAVATEL commercial / X API + Grok = customer's own accounts

Related resources