SDKs

Python SDK

ourseams-sdk. the same operations, imported as seams.

cli
pip install ourseams-sdk    # uv add ourseams-sdk

The 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"])
ArgumentDefaultFor
api_keyrequiredYour sk_ customer token
base_urlhttps://api.ourseams.comPointing at a local quickstart
http_clienta new httpx.ClientYour 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":
        ...
    raise

Money

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