Python SDK
warning
The Silhouette API and SDK are in beta and under active development. More operations and features will be added.
The official Python SDK provides programmatic access to the Silhouette API. All requests route through shielded execution, so strategy, size, and intent are not attributable to the user's wallet on the public orderbook.
Installation
pip install silhouette-python-sdk
The package is available on PyPI.
Quick Start
import os
from silhouette import SilhouetteApiClient
# Initialize the client with your private key
# Never hardcode your private key - use environment variables
client = SilhouetteApiClient(
base_url="https://api.silhouette.exchange",
private_key=os.environ["SILHOUETTE_PRIVATE_KEY"],
auto_auth=True,
)
# Check your balances
balances = client.user.get_balances()
print(balances)
# Place an order
order = client.order.create_order(
side="buy",
order_type="limit",
base_token="HYPE",
quote_token="USDC",
amount="1.0",
price="0.001",
)
print(f"Order placed: {order['orderId']}")
Resources
- PyPI package
- API Reference - All available operations
- Authentication - Details on the SIWE authentication flow
- Quick Start - Set up prerequisites and make your first API call
- Troubleshooting - Common errors and solutions
- OpenAPI Specification - Generate typed clients in other languages