Sonny Labs Docs
SDK ReferencePython

Constructor options

Constructor arguments for SonnyLabsClient — api_key, base_url, api_version, timeout_s, max_retries, and the httpx transport injection point.

SonnyLabsClient takes one positional argument (api_key) and a small set of keyword-only arguments for tuning. Only api_key is required; everything else has a sensible default chosen for the SaaS endpoint.

import os
from sonnylabs import SonnyLabsClient

client = SonnyLabsClient(
    api_key=os.environ["SONNY_API_KEY"],
    base_url="https://sonny.internal.example.com",  # self-hosted
    max_retries=5,
    timeout_s=30.0,
)

Arguments

Prop

Type

The transport argument is intended for tests — pass an httpx.MockTransport (or your own httpx.BaseTransport) to drive requests through a fixture instead of the network. Production callers should leave it at its default (None).

On this page