Prime Tunnel SDK
raw JSON → 0.1.6 verified Sat May 09 auth: no python
Python SDK from Prime Intellect to expose local services (e.g. Jupyter, web apps) via secure tunnels. Version 0.1.6, released monthly. Requires Python ≥3.10.
pip install prime-tunnel Common errors
error AttributeError: module 'prime_tunnel' has no attribute 'TunnelClient' ↓
cause Installed wrong package or import path incorrect.
fix
pip uninstall prime-tunnel && pip install prime-tunnel && from prime_tunnel import TunnelClient
error prime_tunnel.exceptions.AuthenticationError: Invalid API key ↓
cause API key missing or incorrect.
fix
Set PRIME_API_KEY environment variable to a valid key from Prime Intellect Console.
Warnings
gotcha API key required for all tunnel operations. Set PRIME_API_KEY environment variable or pass it to the constructor. ↓
fix export PRIME_API_KEY='your_key_here' or use os.environ.get('PRIME_API_KEY', '')
gotcha Tunnel URLs are transient; the service may assign a different URL each time. ↓
fix Persist the URL if needed; re-create tunnels if the URL changes.
Imports
- TunnelClient
from prime_tunnel import TunnelClient
Quickstart
from prime_tunnel import TunnelClient
import os
client = TunnelClient(api_key=os.environ.get('PRIME_API_KEY', ''))
# Expose local port 8888
tunnel = client.create_tunnel(port=8888)
print(f"Tunnel URL: {tunnel.url}")