Skip to main content
Install synth-ai in a Python environment:
uv add synth-ai
For one-off commands:
uvx synth-ai --help

API key

Set SYNTH_API_KEY:
export SYNTH_API_KEY="sk_..."
Then construct the client:
from synth_ai import SynthClient

client = SynthClient()
You can also pass the key explicitly:
client = SynthClient(api_key="sk_...")

Base URL

The SDK uses the production backend by default. Use base_url for local, staging, or private backend targets.
client = SynthClient(
    api_key="sk_...",
    base_url="http://127.0.0.1:8000",
)
The CLI accepts --backend-url and also reads SYNTH_BACKEND_URL.
synth-ai containers list --backend-url http://127.0.0.1:8000

Smoke test

from synth_ai import SynthClient

client = SynthClient()
print(client.tunnels.health())
If auth fails, check that SYNTH_API_KEY is present and belongs to the expected workspace.