Staso Docs
Configuration

Configuration

Everything goes through st.init().

Minimal

st.init(api_key="ak_...", agent_id="my-agent")

All Options

st.init(
    api_key="ak_...",                  # Required -- your Staso API key
    agent_id="my-agent",               # Required -- name for this agent
    base_url="https://api.staso.ai",   # Staso backend URL
    environment="production",          # Tag traces by environment
    workspace_slug="my-workspace",     # Workspace identifier
    batch_size=100,                    # Spans buffered before sending
    flush_interval=5.0,                # Max seconds between sends
    max_queue_size=10_000,             # Max buffered spans
    enabled=True,                      # False to disable without removing code
    debug=False,                       # SDK debug logs
    capture_messages=True,             # Capture LLM message content in integrations
)
ParameterTypeDefaultDescription
api_keystrrequiredYour Staso API key
agent_idstrrequiredAgent name, shown on dashboard
base_urlstrhttp://localhost:6999Backend URL
environmentstr"default"Environment tag ("staging", "production")
workspace_slugstr""Workspace identifier
batch_sizeint100Flush after this many spans
flush_intervalfloat5.0Flush after this many seconds
max_queue_sizeint10_000Drops new spans when full
enabledboolTrueKill switch — decorators stay, no data sent
debugboolFalseDebug logging on staso logger
capture_messagesboolTrueInclude LLM message content (e.g. user/assistant messages) in integration spans. Set to False to disable.

Environment Variables

The SDK automatically reads these environment variables. Arguments passed to st.init() take priority.

VariableMaps to
STASO_API_KEYapi_key
STASO_AGENT_IDagent_id
STASO_BASE_URLbase_url
STASO_ENVIRONMENTenvironment
STASO_WORKSPACE_SLUGworkspace_slug
STASO_DEBUGdebug ("1" or "true" to enable)
# Minimal — everything from env vars
st.init()

# Override specific values
st.init(environment="staging")

Disabling

Keep all decorators in your code, send nothing:

st.init(api_key="ak_...", agent_id="my-agent", enabled=False)

Shutdown

Always call before exit:

st.shutdown()

There's an atexit hook as a fallback, but explicit is better.