Overview

The official Python SDK provides synchronous and `asyncio` clients for the Synapse routing fabric. It includes native Pydantic types for structured outputs and automatic exponential backoff for rate limits.

Quickstart

Instantiate the async client and pass your fallback routing chain.

python
1
import asyncio
2
from synapse import AsyncClient
3
client = AsyncClient(api_key="sk_live_...")
4
async def main():response = await client.route.create(model_chain=["gpt-4o", "claude-3-opus"],prompt="Analyze this telemetry data.")print(response.latency_ms)
5
asyncio.run(main())

Installation

pip
$pip install synapse-python

DEPLOY / SYNAPSE OS

Start building with Synapse OS.

Two ways in — pick your path.

01

For humans

Get started with our Next.js and Python SDKs in seconds.

02

For agents

Tools to connect your autonomous agents to our edge infrastructure.

$npm install @synapse/sdk

Aquire $129

Aquire $129

Aquire $129

Create a free website with Framer, the website builder loved by startups, designers and agencies.