Built with Grok's feedback. Real compute. Free memory. Planet Research.
Grok/X powers English and Japanese X intelligence in Planet Research — the most advanced research system on the internet, synthesizing across 5 global providers.
Enable Agent Mode with one header. Add a session_id for persistent memory across calls. The enhanced response envelope handles the rest automatically.
The Slopshop client handles the xAI-compatible request format, session management, and the Agent Mode response envelope automatically.
Set the header on every request. Slopshop returns the enhanced envelope with suggestions, cache_fingerprint, and auto-persisted memory.
Pass a session_id in the request body. Slopshop automatically saves tool results to that session's memory namespace — no extra calls needed.
Three headers control how Slopshop behaves in Grok's Agent Mode. Each unlocks a different part of the enhanced response envelope.
Or pass mode="grok" and session_id in the request body — headers and body params are interchangeable.
Agent Mode returns a richer envelope. suggestions tells Grok what to do next. cache_fingerprint lets Grok skip re-fetching. persisted confirms memory was written.
{
"valid": true,
"expires": "2026-09-12",
"issuer": "Let's Encrypt",
"days_left": 170,
"_engine": "real"
}{
"valid": true,
"expires": "2026-09-12",
"issuer": "Let's Encrypt",
"days_left": 170,
"_engine": "real",
"_agent": {
"mode": "grok",
"session_id": "sess_grok_a1b2c3d4",
"persisted": true,
"cache_fingerprint": "sha256:9f3a...",
"suggestions": [
"check dns-lookup for this host",
"run http-request to verify HSTS"
],
"credits_used": 2
}
}Complete example using the xAI-compatible API. Agent Mode enabled, session_id for persistence, enhanced envelope for Grok's multi-step reasoning.
# Slopshop + Grok: Agent Mode with session persistence # Uses xAI-compatible request format + enhanced response envelope import os, json, uuid, requests from openai import OpenAI # xAI API is OpenAI-compatible # xAI client (Grok) grok = OpenAI( api_key=os.environ["XAI_API_KEY"], base_url="https://api.x.ai/v1" ) SLOP_KEY = os.environ["SLOPSHOP_API_KEY"] SLOP_URL = "https://slopshop.gg" SESSION_ID = f"sess_grok_{uuid.uuid4().hex[:12]}" def call_slopshop_agent(tool_name: str, args: dict) -> dict: """Call Slopshop in Agent Mode — returns enhanced envelope.""" slug = tool_name.replace("_", "-") resp = requests.post( f"{SLOP_URL}/v1/{slug}", headers={ "Authorization": f"Bearer {SLOP_KEY}", "Content-Type": "application/json", "X-Agent-Mode": "grok", # Enable Agent Mode "X-Session-Id": SESSION_ID, # Bind to session "X-Auto-Persist": "true" # Auto-save to memory }, json={**args, "session_id": SESSION_ID, "mode": "grok"} ) result = resp.json() # Log what Agent Mode gave us if agent_meta := result.get("_agent"): print(f" [agent] persisted={agent_meta['persisted']}") print(f" [agent] fingerprint={agent_meta['cache_fingerprint'][:16]}...") if agent_meta.get("suggestions"): print(f" [agent] suggestions: {agent_meta['suggestions']}") return result def run_grok_agent(task: str) -> str: """Run Grok in Agent Mode with Slopshop tools.""" # Fetch tools as OpenAI-compatible function definitions tools_resp = requests.get( f"{SLOP_URL}/v1/openapi.json", headers={"Authorization": f"Bearer {SLOP_KEY}"} ) # ... (convert to OpenAI tool format, see integrate-openai.html) messages = [{"role": "user", "content": task}] print(f"Session: {SESSION_ID}") while True: response = grok.chat.completions.create( model="grok-3", messages=messages, tools=tools, # Slopshop tools tool_choice="auto" ) msg = response.choices[0].message messages.append(msg) if msg.tool_calls: for tc in msg.tool_calls: print(f"Grok calling: {tc.function.name}") result = call_slopshop_agent( tc.function.name, json.loads(tc.function.arguments) ) messages.append({ "role": "tool", "tool_call_id": tc.id, "content": json.dumps(result) }) else: return msg.content # All tool results are auto-persisted to SESSION_ID memory namespace answer = run_grok_agent( "Audit api.x.ai — DNS records, SSL cert grade, and HTTP security headers" ) print(answer)
Grok's Agent Mode is designed for multi-step autonomous execution. Slopshop is the execution layer that makes each step real.
DNS, SSL, HTTP, crypto, code execution, data transforms, document generation. All real compute. _engine: "real" on every response.
Session-scoped memory with session_id. Auto-persist writes tool results to memory without extra API calls. Free tier never expires.
Enhanced response envelope with suggestions, cache_fingerprint, and auto-persist. Built specifically for Grok's agentic flow.
Audit logs, per-session tracing, credit usage per tool call. Every tool Grok calls is logged with the session_id, inputs, outputs, and latency.
Run Slopshop on your infrastructure. Zero external dependencies. Air-gapped environments supported. Same Agent Mode envelope.