Skip to main content

Stable Sea Python SDK

Official Python client for the Stable Sea Terminal API, for managing organizations, quotes, orders, and API keys.

Installation

pip install stablesea

Or install from source:

pip install /path/to/sdk/python

Quickstart

from stablesea import StableseaClient

# Initialize with your API key (sandbox by default)
client = StableseaClient(api_key="sk_your_api_key")

# List organizations
organizations = client.organizations.list()

# Create an organization
org = 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 quote
order = client.orders.create(
    organization_id="org_01k2cm4r59e5z8k5ggrbbxjcwy",
    quote_id=quote["id"],
    idempotency_key="order-key-789",
)

# List API keys
api_keys = client.api_keys.list()

# Create a new API key
new_key = client.api_keys.create(
    name="Production API",
    environment="PRODUCTION",
    permission_level="STANDARD",
)
# Store new_key["api_key"] securely - it's only returned once!

# List liquidity providers
providers = client.liquidity_providers.list()

# Get exchange rate for a provider
rate = client.liquidity_providers.get_exchange_rate("ALPHA")

client.close()

Async Support

For async/await support, use AsyncStableseaClient:

import asyncio
from stablesea import AsyncStableseaClient

async def main():
    async with AsyncStableseaClient(api_key="sk_your_api_key") as client:
        orgs = await client.organizations.list()
        quote = await client.quotes.create(
            organization_id="org_...",
            offering_id="off_...",
            payin_amount="100",
            idempotency_key="unique-key",
        )
        print(orgs, quote)

asyncio.run(main())

Configuration

Parameter Default Description
api_key (required) Your Stable Sea API key
base_url https://api-sandbox.stablesea.com/v1 API base URL (use production URL for live)
timeout 30.0 Request timeout in seconds

API Resources

Resource Methods
client.organizations list(), create(), get()
client.quotes create(), get()
client.orders create(), list(), get()
client.api_keys list(), create(), rotate(), revoke()
client.liquidity_providers list(), get_exchange_rate()
client.offerings create(), get()
client.external_payment_instruments list(), create(), get(), archive()

Error Handling

from stablesea import StableseaClient, APIError

client = StableseaClient(api_key="sk_...")
try:
    client.organizations.create(...)
except APIError as e:
    print(f"API error {e.status_code}: {e.message}")

License

MIT

Metadata

Release files for stablesea 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stablesea 0.1.0
File Size Uploaded
stablesea-0.1.0.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stablesea 0.1.0
File Interpreter ABI Platform
stablesea-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.5 kB

Release files / stablesea-0.1.0.tar.gz

Download URL stablesea-0.1.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
067bfd42af56fde7d8df1a41993553588094be4287dd8df7a7339e341410c9e0
BLAKE2b-256 checksum
How to use checksums
4395e8f0730dc5e8e66b9484c86439d8c1726a935b1c307e9f4fdec6431ba0f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / stablesea-0.1.0-py3-none-any.whl

Download URL stablesea-0.1.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1121d6437fe4fd5c2e307c1d41aae21ba92e8ce63eb73a672a66b4ee8f7467b3
BLAKE2b-256 checksum
How to use checksums
f9ca1ee1034b4a562034c208453a38e01132bee3727144767892acc02d6656a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page