Python SDK
The official Python client for SpaceRouter Proxy. Sync, async, and on-chain payment in one package.
Install
pip install spacerouterSynchronous client
from spacerouter import SpaceRouter
from spacerouter.payment import SpaceRouterSPACE
consumer = SpaceRouterSPACE(
gateway_url="https://gateway.spacerouter.org",
proxy_url="http://gateway.spacerouter.org:8080",
private_key="0xYOUR_PRIVATE_KEY",
)
with SpaceRouter(
consumer.address.lower(), # wallet address as first positional arg
gateway_url="http://gateway.spacerouter.org:8080",
payment=consumer,
auto_settle=True,
region="KR",
ip_type="residential",
) as router:
response = router.get("https://httpbin.org/ip")
print(response.json())Constructor
HTTP methods
Per-request routing override
Async client
Manual signing (advanced)
Errors
Class
HTTP
Raised when
Configuration via environment
Variable
Purpose
Last updated
Was this helpful?