All services operational
Sallines

Python SDK

sallines-sdk: sync, async, streaming, and errors.

sallines-sdk is the official Python client. It targets https://api.sallines.world/v1, sends sallines_sk_ keys, and returns typed sallines.inference.response objects.

Install

pip install sallines-sdk

Requires Python 3.10 or later. Pin a major version in production (sallines-sdk>=2,<3).

Client

from sallines import Sallines

client = Sallines(
    api_key="sallines_sk_...",
    project_id="prj_legal_001",
    timeout=30.0,
    max_retries=3,
)

Environment variables: SALLINES_API_KEY, SALLINES_PROJECT_ID, SALLINES_BASE_URL. Do not pass a key you committed to git.

Inference

response = client.inference.create(
    model="auto",
    messages=[{"role": "user", "content": "Summarize termination risk."}],
    features=["pii_redaction", "semantic_cache"],
    idempotency_key="contract-summary-4821-v1",
)

print(response.object)  # sallines.inference.response
print(response.sallines.route)  # gpt or gemini
print(response.sallines.cost_usd)
print(response.sallines.region)

Streaming

for chunk in client.inference.stream(
    model="auto",
    project_id="prj_legal_001",
    messages=[{"role": "user", "content": "Draft the notice."}],
):
    delta = chunk.choices[0].delta.content
    if delta:
        print(delta, end="", flush=True)

Async

from sallines import SallinesAsync

async def run() -> None:
    client = SallinesAsync(api_key="sallines_sk_...", project_id="prj_legal_001")
    response = await client.inference.create(
        model="gemini",
        messages=[{"role": "user", "content": "Extract covenants."}],
    )
    await client.close()

Prefer auto unless the workflow is pinned to GPT or Gemini for an eval.

Errors

from sallines.errors import SallinesError, RateLimitError, APIStatusError

try:
    client.inference.create(model="auto", messages=[{"role": "user", "content": "Hello"}])
except RateLimitError as exc:
    print(exc.request_id, exc.reset_at)
except APIStatusError as exc:
    print(exc.status_code, exc.code)
except SallinesError:
    raise

Retries apply to 408, 429, and 503. They require an idempotency_key on POST inference if you also retry in your own code.

Other Resources

client.models.list()
client.usage.retrieve(project_id="prj_legal_001", start="2026-09-01", end="2026-09-30")
client.templates.retrieve("tpl_contract_summary_v3")
client.audit.events.list(project_id="prj_legal_001", start="2026-09-01", end="2026-09-30")

See SDKs, Inference, and Errors.

Production API credentials are issued with an institution workspace. Contact sales if you need access.