SDKs
Python SDK
ourseams-sdk. the same operations, imported as seams.
cli
pip install ourseams-sdk # uv add ourseams-sdkThe distribution is ourseams-sdk; the import is seams. Models are pydantic, generated from the same OpenAPI document the TypeScript client is generated from.
Constructing it
python
import os
from seams import Seams
seams = Seams(api_key=os.environ["SEAMS_API_KEY"])| Argument | Default | For |
|---|---|---|
api_key | required | Your sk_ customer token |
base_url | https://api.ourseams.com | Pointing at a local quickstart |
http_client | a new httpx.Client | Your own timeouts, retries or transport |
Shape of a call
Path parameters are positional, everything else is a keyword argument. Names are the operation id in snake_case, and the response is a pydantic model.
python
seams.users.create("alice", email="[email protected]", bundle="pro")
key = seams.keys.mint(end_user_id="alice", bundle="pro")
seams.keys.cap(key.id, cap_micros="5000000")
usage = seams.usage(end_user_id="alice")
session = seams.portal.link(external_id="alice")
print(usage.totals.calls, session.url)Async
AsyncSeams is the same surface with awaitable methods, over httpx.AsyncClient. Both are context managers, which is the tidy way to close the connection pool.
python
from seams import AsyncSeams
async with AsyncSeams(api_key=token) as seams:
users = await seams.users.list()Errors
python
from seams import SeamsError
try:
seams.keys.mint(end_user_id="alice", bundle="pro")
except SeamsError as error:
if error.code == "invalid_api_key":
...
raiseMoney
Amounts are integer micro-dollars as strings. Use int, or Decimal if you are formatting; never float.
python
from decimal import Decimal
usd = Decimal(usage.totals.billed_micros) / 1_000_000