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 lets you trade programmatically while keeping your strategy, size, and intent private. Build trading bots or automate strategies - all with shielded execution.
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