sonar-pro  ·  OpenAI-compatible  ·  real-time search + compute

Slopshop for
Perplexity API

Perplexity searches the web in real-time. Slopshop executes compute. real tools across 82 categories — DNS, SSL, HTTP, crypto — that Perplexity can call via its OpenAI-compatible function calling format.
Free memory. Every result verified.

422
Real Tools
sonar
Search Model
OAI
Compatible
100%
Verified Results

The Combination

Search + compute: what each layer does

Perplexity and Slopshop cover different problem spaces. Combined, they handle virtually any research-and-action task an agent might face.

Perplexity handles

Real-time web search with citations. Current events, news, documentation lookups, product research, anything that requires fresh internet data.

Slopshop handles

Deterministic compute — DNS resolution, SSL validation, HTTP requests, cryptographic operations, data transforms, persistent memory. Results verified with _engine: real.


Quickstart

Three steps. Perplexity has tools.

Perplexity's API is OpenAI-compatible. Use the openai SDK with base_url="https://api.perplexity.ai" and Slopshop tools in the tools array.

Step 01 — Install

pip install openai

Perplexity uses the OpenAI SDK with a different base_url. No separate package — just set your Perplexity API key and endpoint.

pip install openai requestsclick to copy
Step 02 — Configure

Point at api.perplexity.ai

Create an OpenAI client with base_url="https://api.perplexity.ai" and your Perplexity API key. Fetch Slopshop tools.

base_url="https://api.perplexity.ai"
Step 03 — Run

Search + execute in one loop

Perplexity uses sonar-pro for search grounding. Add Slopshop tools to the same request — the model decides when to search vs. compute.

search grounding + real compute tools across 82 categories

Code Example

sonar-pro with Slopshop compute tools

Perplexity's sonar-pro model gets web search built-in. Add Slopshop's compute tools to the same call — the agent can search for current info and immediately validate it against live infrastructure.

perplexity_agent.py python
import os, json, requests
from openai import OpenAI

# Perplexity is OpenAI-compatible — swap base_url
client = OpenAI(
    api_key=os.environ["PERPLEXITY_API_KEY"],
    base_url="https://api.perplexity.ai"
)

SLOP_KEY = os.environ["SLOPSHOP_API_KEY"]
SLOP_URL = "https://slopshop.gg"

# Fetch Slopshop compute tools (not search — Perplexity has search built-in)
def get_compute_tools(slugs: list[str]) -> list[dict]:
    schema = requests.get(
        f"{SLOP_URL}/v1/openapi.json",
        headers={"Authorization": f"Bearer {SLOP_KEY}"}
    ).json()
    tools = []
    for slug in slugs:
        path = schema["paths"].get(f"/v1/{slug}", {}).get("post", {})
        if path:
            tools.append({
                "type": "function",
                "function": {
                    "name": slug,
                    "description": path.get("summary", ""),
                    "parameters": path["requestBody"]["content"]["application/json"]["schema"]
                }
            })
    return tools

def call_tool(name: str, args: dict) -> str:
    res = requests.post(
        f"{SLOP_URL}/v1/{name}", json=args,
        headers={"Authorization": f"Bearer {SLOP_KEY}"}
    )
    return json.dumps(res.json())

def run_agent(user_message: str) -> str:
    # Slopshop compute tools — Perplexity adds web search on top
    tools = get_compute_tools([
        "dns-lookup", "ssl-check", "http-request",
        "whois", "hash", "memory-set", "memory-get"
    ])
    messages = [{"role": "user", "content": user_message}]

    while True:
        response = client.chat.completions.create(
            model="sonar-pro",  # search-grounded model
            messages=messages,
            tools=tools,
            tool_choice="auto"
        )
        msg = response.choices[0].message

        if response.choices[0].finish_reason == "stop":
            return msg.content

        messages.append(msg)
        for tc in (msg.tool_calls or []):
            result = call_tool(tc.function.name, json.loads(tc.function.arguments))
            messages.append({
                "role": "tool",
                "tool_call_id": tc.id,
                "content": result
            })

# The agent searches for current security advisories for slopshop.gg
# AND validates live DNS/SSL with Slopshop compute in the same response
answer = run_agent(
    "Search for recent news about slopshop.gg, then verify its current DNS and SSL cert status"
)
print(answer)

What You Get

Search + execute in one agent loop

Perplexity brings real-time web grounding. Slopshop brings deterministic compute. Together they cover research and execution in a single request chain.

🀅

422 Compute Tools

DNS, SSL, HTTP, crypto, hashing, code execution, data transforms. Deterministic, verified results alongside Perplexity's search output.

🧠

Free Persistent Memory

Perplexity agents can save search results and computed data to Slopshop's key-value store at zero credit cost. Persists across sessions.

🔗

OpenAI-Compatible

Same openai SDK you already use. Change base_url to api.perplexity.ai and add Slopshop tools. That's the entire integration.

👀

Full Observability

Audit logs for every Slopshop tool call. Know exactly what the agent executed alongside its search queries.

🏠

Self-Hostable

Run Slopshop on your own infrastructure. Only Perplexity's API calls go external — your compute stays private.


Perplexity searches. Slopshop executes.

Real-time search grounding + real compute tools across 82 categories. Free memory. Every result verified.
The complete research-and-action stack.

Get Started Free OpenAPI Schema Browse Browse All Tools
→ Full Docs → Browse Tools → Agent Templates → Savings Calculator