Synth SDK Logic Specification
1. Canonical Front Door
1.1 Required entry points
The SDK MUST expose exactly two canonical entry points:
synth_ai.SynthClient(sync)synth_ai.AsyncSynthClient(async)
Both clients MUST share the same namespace topology.
1.2 Namespace topology
Both clients expose the following first-class namespaces:
optimizationinferencegraphsverifierspoolstunnelscontainer
1.3 Construction rules
api_keyis required, explicitly or viaSYNTH_API_KEY.base_urldefaults to Synth backend base when omitted.timeoutapplies to network operations.
2. Optimization Model
2.1 Resources
optimization is split into three primitives:
systemsofflineonline
2.2 Systems
systems manages canonical policy-optimization system resources.
Required methods:
creategetlist
2.3 Offline jobs
offline manages batch optimization jobs.
Required methods:
creategetlist
Job instance behavior includes:
statuseventsartifacts- state transitions via
pause/resume/cancel.
2.4 Online sessions
online manages reward-driven online optimization sessions.
Required methods:
creategetlist
Session instance behavior includes:
submit_rewardevents- state transitions via
pause/resume/cancel.
3. Inference Model
3.1 Chat completions
inference.chat.completions.create MUST accept OpenAI-compatible inputs:
modelmessages- standard generation controls (
temperature,max_tokens, etc.)
The request/response model SHOULD remain OpenAI-compatible to support polyglot clients.
3.2 Inference jobs
inference.jobs covers async environment-backed jobs.
Required methods:
createcreate_from_requestcreate_from_pathgetlist_artifactsdownload_artifact
4. First-Class Containers, Pools, Tunnels
4.1 Containers
container is a composed namespace with:
hosted: hosted container CRUDlocal: in-process/local container helperscreate/connect: direct local container entry points
4.2 Container pools
pools is first-class and MUST include structured subclients:
uploadsdata_sourcesassembliesrolloutstasksmetricsagent_rolloutsskills
It MUST provide target-specific templates:
pools.harborpools.openenvpools.horizonspools.arbitrary
Each target adapter MUST support assembling from data source and reassembly.
4.3 Tunnels
tunnels is first-class and MUST include:
tunnels.opentunnels.open_for_apptunnels.synthspecializedSynthTunnel
Backend variants:
SynthTunnelCloudflareQuickTunnelCloudflareManagedTunnelCloudflareManagedLeaseLocalhost
SynthTunnel MUST expose worker_token semantics for container auth in relay mode.
5. Sync/Async Coherence
5.1 Behavioral parity
Sync and async clients MUST maintain parity across canonical resources.
5.2 Naming parity
Method names and argument shape MUST remain equivalent between sync and async variants, except coroutine semantics.
6. Contract Invariants
- Canonical docs and examples MUST use
SynthClient/AsyncSynthClient. - Canonical docs MUST treat
container_urlas the primary container endpoint field. - Reward payloads use canonical reward fields (
reward_info.*), not legacy aliases. - New SDK symbols SHOULD land in canonical namespaces before legacy wrappers.
7. Non-Goals
- This file does not define backend implementation internals.
- This file does not describe deprecated, compatibility-only wrappers.