Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prune-quickstart

Try Prune with any app in about 2 minutes. Prune vaults your provider key, caps spend, cuts your bill through caching and compression, and returns a signed receipt on every call.

This repo is one script and one README. The script makes 15 calls (5 short prompts, repeated over 3 rounds) through Prune's OpenRouter proxy so you see caching on the repeats.

Setup

  1. Create an account at app.withprune.com.
  2. Connect → Providers — vault your OpenRouter key (sk-or-v1-...).
  3. Connect → API Keys — create a Prune key (prune_...). Copy it once.
  4. Copy .env.example to .env and set only the Prune key:
    cp .env.example .env
    
    PRUNE_API_KEY=prune_...
    
    Do not put sk-or-v1-... or prune-sk-or-v1-... in PRUNE_API_KEY. That is the #1 cause of 401 Invalid API key format.
  5. Install and run:
    pip install prune-sdk python-dotenv
    python test_prune.py
    

Round 1 is cache misses; rounds 2–3 should show cache=exact and tokens_saved on repeats. Verify receipts at withprune.com/verify.

If the terminal prints a different key than your .env

python-dotenv used to keep a stale PRUNE_API_KEY from your shell / Windows user environment. This script now calls load_dotenv(override=True). Still stuck? Open a new terminal, or unset the system variable, then rerun.

401 vs 429

Error Meaning Fix
Invalid API key format Wrong key in .env Use prune_... from Connect → API Keys
OpenRouter rejected (429) OpenRouter rate limit / free pool Wait, add credits, or set PRUNE_TEST_MODEL=openai/gpt-4o-mini

Default model is openai/gpt-4o-mini (needs OpenRouter credits or a funded key). For free-only:

PRUNE_TEST_MODEL=meta-llama/llama-3.2-3b-instruct:free

Free models share a congested pool (often 20/min, 50/day).


Text me if you hit any issues: 8291006285

License

Apache-2.0 — see LICENSE.

About

Try Prune with any app in about 2 minutes -- vault your key, cap spend, cut cost, get a signed receipt.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages