The official Python SDK provides a simple way to integrate with the Stable Sea Terminal API. This guide walks you through installation and common operations.
from stablesea import StableseaClient# Initialize with your API key (sandbox by default)client = StableseaClient(api_key="sk_your_api_key")# List organizationsorganizations = client.organizations.list()# Create an organizationorg = client.organizations.create( name="Acme Corp", contact={"email": "john@acme.com", "first_name": "John", "last_name": "Doe"}, idempotency_key="unique-key-123",)# Create a quote (organization-scoped)quote = client.quotes.create( organization_id="org_01k2cm4r59e5z8k5ggrbbxjcwy", offering_id="off_01k4qph5ezfsga7fkvbygsqq93", payin_amount="100", idempotency_key="quote-key-456",)# Create an order from the quoteorder = client.orders.create( organization_id="org_01k2cm4r59e5z8k5ggrbbxjcwy", quote_id=quote["id"], idempotency_key="order-key-789",)# List liquidity providersproviders = client.liquidity_providers.list()# Get exchange rate for a providerrate = client.liquidity_providers.get_exchange_rate("ALPHA")client.close()
Save the organization id (starts with org_) from org["id"] for subsequent calls. New organizations typically start in COMPLIANCE_HOLD and may need approval before becoming ACTIVE.
from stablesea import StableseaClientclient = StableseaClient(api_key="sk_your_api_key")# List API keysapi_keys = client.api_keys.list()# Create a new API keynew_key = client.api_keys.create( name="Production API", environment="PRODUCTION", permission_level="STANDARD",)# Store new_key["api_key"] securely — it's only returned once!client.close()
API keys are shown only once at creation. Store them securely; they cannot be retrieved from the dashboard later.