Pura

v1.1.0

Cut your OpenClaw agent's LLM costs 40-60%. Automatic model selection routes simple tasks to cheap providers, complex tasks to premium ones. Free for 5,000 r...

0· 142·0 current·0 all-time
byErik@espetey

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for espetey/pura.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Pura" (espetey/pura) from ClawHub.
Skill page: https://clawhub.ai/espetey/pura
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required env vars: PURA_API_KEY
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install pura

ClawHub CLI

Package manager switcher

npx clawhub@latest install pura
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description claim a routing/gateway that selects cheaper models; the skill only requires a single PURA_API_KEY and (optionally) PURA_GATEWAY_URL, which matches the claimed functionality. The included scripts and SDK examples all call the Pura gateway, which is coherent with the described purpose.
Instruction Scope
SKILL.md instructs the agent to send all LLM requests (prompts, messages) to https://api.pura.xyz (or the optional PURA_GATEWAY_URL). This stays within the skill's stated purpose but has an important privacy/security implication: sensitive prompts and context will be transmitted to and processed by the external service (and the skill's verify/report scripts perform real requests). The instructions do not access unrelated local files or other credentials.
Install Mechanism
No install spec; the skill is instruction-plus-scripts only. The bundled shell scripts are plain and readable, call the gateway endpoints, and do not download/execute external code. No archive downloads or 3rd-party installs are present.
Credentials
Only one primary environment variable (PURA_API_KEY) is required and optional PURA_GATEWAY_URL is declared in metadata; the scripts use only those. The requested env access is proportionate to a gateway/proxy service that needs an API key.
Persistence & Privilege
The skill does not request always:true, does not modify other skills or system-wide settings, and contains only small helper scripts that read/send via network. It does not request elevated or persistent system privileges.
Assessment
This skill is internally consistent: it changes your agent's base URL so all LLM requests go through Pura. That is the expected behavior, but it means Pura will receive full prompts, context, and any sensitive data in requests — and the PURA_API_KEY grants the gateway permission to act on your behalf and bill usage. Before installing, confirm you trust https://api.pura.xyz (review their privacy policy, logging/retention, and security practices), restrict use to non-sensitive workloads if you have concerns, rotate and monitor the API key, and consider using a self-hosted gateway if you cannot accept sending prompts to a third party. The included scripts are readable and only call the gateway; there is no hidden or obfuscated code in the bundle.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

Clawdis
EnvPURA_API_KEY
Primary envPURA_API_KEY
latestvk976mfdzzf8dbzfhwqy7ygrh4583rfc0
142downloads
0stars
2versions
Updated 1mo ago
v1.1.0
MIT-0

Pura — cut your agent's LLM costs 40-60%

Your OpenClaw agent probably sends every request to GPT-4o. Most of those requests are simple enough for a model that costs 10x less. Pura sits between your agent and the LLM providers, scores each request's complexity, and routes it to the cheapest model that can handle it.

Cascade routing: tries Groq first ($0.00059/1K tokens). If the response looks weak (too short, hedging language, refusal), it escalates to Gemini, then OpenAI, then Anthropic. Your agent gets a good answer. You pay the minimum.

Drop-in OpenAI-compatible. One env var change.

What you get

  • 4 providers (Groq, Gemini, OpenAI, Anthropic) behind one endpoint
  • Automatic complexity scoring — no manual model selection
  • Cascade routing — cheapest sufficient tier per request
  • Per-request cost headers so your agent tracks spend
  • Daily cost reports and income statements
  • Free tier: 5,000 requests, no credit card

Setup

Get an API key:

curl -s -X POST https://api.pura.xyz/api/keys \
  -H "Content-Type: application/json" \
  -d '{"label":"my-agent"}' | python3 -m json.tool

Save the returned key (starts with pura_):

export PURA_API_KEY="pura_your_key_here"

Sending requests

Pura is OpenAI SDK-compatible. Change your base URL and you're done:

from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.pura.xyz/v1",
    api_key=os.environ["PURA_API_KEY"]
)

response = client.chat.completions.create(
    model="auto",  # Pura picks the cheapest capable model
    messages=[{"role": "user", "content": "Hello"}]
)

Or with curl:

curl -s -X POST https://api.pura.xyz/v1/chat/completions \
  -H "Authorization: Bearer $PURA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Hello"}], "stream": false}'

Response headers

Every response includes routing metadata:

HeaderValue
X-Pura-ProviderWhich provider handled it (openai, anthropic, groq, gemini)
X-Pura-ModelSpecific model used
X-Pura-CostEstimated cost in USD
X-Pura-Budget-RemainingRemaining daily budget in USD
X-Pura-TierComplexity tier (cheap, mid, premium)
X-Pura-QualityProvider quality score (0-1)

Cost reports

# 24h spend breakdown
curl -s https://api.pura.xyz/api/report \
  -H "Authorization: Bearer $PURA_API_KEY" | python3 -m json.tool

# Formatted income statement
curl -s https://api.pura.xyz/api/income \
  -H "Authorization: Bearer $PURA_API_KEY" | python3 -m json.tool

Lightning wallet

5,000 free requests included. After that, fund a Lightning wallet:

# Get a funding invoice
curl -s -X POST https://api.pura.xyz/api/wallet/fund \
  -H "Authorization: Bearer $PURA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount": 10000}' | python3 -m json.tool

# Check balance
curl -s https://api.pura.xyz/api/wallet/balance \
  -H "Authorization: Bearer $PURA_API_KEY" | python3 -m json.tool

Model behavior

Set model="auto" or omit the model field entirely — both trigger cascade routing, where Pura scores your request's complexity and picks the cheapest provider that can handle it.

If you specify a model name directly (e.g. gpt-4o, claude-sonnet-4-20250514), Pura skips the cascade and routes straight to that provider.

Explicit model routing

Override auto-routing by specifying a model:

# Force GPT-4o
curl -s -X POST https://api.pura.xyz/v1/chat/completions \
  -H "Authorization: Bearer $PURA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-4o", "messages": [{"role":"user","content":"Hello"}], "stream": false}'

Supported models: gpt-4o, claude-sonnet-4-20250514, llama-3.3-70b-versatile, gemini-2.0-flash.

Routing hints

Influence provider selection without forcing a specific model:

{
  "messages": [{"role": "user", "content": "..."}],
  "routing": {
    "quality": "high",
    "prefer": "anthropic",
    "maxCost": 0.01,
    "maxLatency": 5000
  }
}

How routing works

Pura scores each request's complexity based on message length, code blocks, reasoning triggers, and conversation depth. Simple tasks go to Groq or Gemini. Complex reasoning goes to Anthropic or OpenAI. Quality scores (derived from recent success rate and latency) weight the selection so underperforming providers get fewer requests until they recover.

Cascade routing adds a second layer: if the cheapest provider's response looks bad (too short, hedging, refusal, incomplete), Pura automatically retries at the next tier up. You only pay premium prices when the cheap answer was genuinely insufficient.

Typical cost savings

Request typeDirect GPT-4o costPura cascade costSavings
Simple Q&A ("What is X?")$0.005$0.00059 (Groq)88%
Code explanation$0.005$0.00125 (Gemini)75%
Complex reasoning$0.005$0.005 (GPT-4o)0%
Long-context analysis$0.005$0.003 (Claude)40%

In practice, 70-80% of agent requests are simple enough for the cheapest tier.

Security note

Your API keys for OpenAI, Anthropic, Groq, and Gemini stay on the Pura server. They never touch your agent or the OpenClaw runtime. If you are running an OpenClaw agent with plugins from untrusted sources, routing through Pura means those plugins cannot access your provider API keys.

Links

Comments

Loading comments...