Skip to main content

synth_ai.sdk.pools

Container pools, tasks, rollouts, metrics, artifacts, usage, and events. Access this API through SynthClient().pools. Prefer its task-oriented namespaces:
  • pools.rollouts for rollouts scoped to one pool.
  • pools.agent_rollouts for global rollouts.
  • pools.tasks for pool task definitions.
  • pools.metrics for pool utilization.
Lower-level methods remain available through the pools.raw client. Request and response bodies are backend-owned JSON objects. Rollout creation through either the task-oriented namespaces or their lower-level implementations validates a closed set of request keys. Other raw methods pass backend contracts through without fabricating a second schema authority. Example:
Expected output: Expected output is one line per pool containing its stable ID and the service-owned metrics object. An organization with no pools returns an empty items list. Pagination: limit defaults to 100. Pagination is backend-owned: continue only when a response supplies a distinct continuation token such as next_cursor. The current production service may omit a continuation or echo the supplied cursor; stop in either case to avoid a loop. Errors: The four rollout-creation entry points named above reject unsupported keys locally with ValueError. Service failures raise httpx.HTTPStatusError. Inspect error.response.status_code to distinguish authentication, authorization, validation, capacity, and transient service failures.

Functions

validate_pool_rollout_request

Reject rollout payloads with non-canonical keys.

Classes

PoolTarget

Deployment target substrate for a pool.

ContainerPoolsClient

Manage container pools, tasks, rollouts, and metrics. Args:
  • api_key: Synth API key. Defaults to SYNTH_API_KEY.
  • backend_base: Preferred API base URL override.
  • base_url: Compatibility alias for backend_base.
  • timeout: Default request timeout in seconds. Defaults to 30.
  • timeout_seconds: Preferred timeout override. When supplied, it takes precedence over timeout.
Attributes:
  • rollouts: Pool-scoped rollout operations.
  • agent_rollouts: Global rollout operations.
  • tasks: Pool task operations.
  • metrics: Pool utilization reads.
Raises:
  • ValueError: The API key is missing or a rollout request contains a non-canonical key.
  • httpx.HTTPStatusError: The service rejects an operation.
Methods:

raw

Return self for advanced raw HTTP access.

create_pool

Create one container pool. Args:
  • request: Backend-owned pool definition. Use fields documented by the active pool API contract.
Returns:
  • The created pool JSON object, including its service-assigned ID.
Raises:
  • httpx.HTTPStatusError: Authentication, authorization, validation, conflict, quota, or service errors.

create

Create a container pool (alias for create_pool).

list_pools

List container pools with cursor pagination. Args:
  • state: Optional service-owned lifecycle-state filter. Defaults to no state filter.
  • limit: Maximum page size. Defaults to 100.
  • cursor: Backend-owned continuation token. Defaults to None.
Returns:
  • The backend page object. Stop if its continuation is missing or unchanged.
Raises:
  • httpx.HTTPStatusError: The request is rejected.

list

List container pools (alias for list_pools).

get_pool

Retrieve one pool by ID. Args:
  • pool_id: Stable ID returned by create_pool or list_pools.
Returns:
  • The current pool JSON object.
Raises:
  • httpx.HTTPStatusError: The pool is unavailable or the request is rejected.

get

Retrieve a pool by id (alias for get_pool).

replace_pool

Replace a pool definition.

replace

Replace a pool definition (alias for replace_pool).

update_pool

Patch-update a pool definition.

update

Patch-update a pool (alias for update_pool).

delete_pool

Delete a pool by id.

delete

Delete a pool by id (alias for delete_pool).

get_pool_urls

Return rollout URLs for a pool.

get_urls

Return rollout URLs (alias for get_pool_urls).

get_pool_metrics

Return utilization metrics for a pool.

list_tasks

List tasks configured on a pool.

create_task

Create a task on a pool.

update_task

Replace a pool task definition.

patch_task

Patch-update a pool task.

delete_task

Delete a pool task.

create_rollout

Start one rollout on a pool. Args:
  • pool_id: Target pool ID.
  • request: Rollout request using only CANONICAL_ROLLOUT_REQUEST_KEYS.
Returns:
  • The created rollout JSON object.
Raises:
  • ValueError: request contains a non-canonical key.
  • httpx.HTTPStatusError: The pool cannot accept the rollout or the request is rejected.

get_rollout

Fetch rollout state for a pool.

list_rollouts

List rollouts for one pool. Args:
  • pool_id: Target pool ID.
  • state: Optional service-owned lifecycle-state filter. Defaults to no state filter.
  • limit: Maximum page size. Defaults to 100.
  • cursor: Backend-owned continuation token. Defaults to None.
Returns:
  • The backend page object. Stop if its continuation is missing or unchanged.
Raises:
  • httpx.HTTPStatusError: The request is rejected.

cancel_rollout

Cancel an in-flight pool rollout.

get_rollout_artifacts

List artifacts produced by a pool rollout.

get_rollout_usage

Return usage totals for a pool rollout.

get_rollout_summary

Return a summary document for a pool rollout.

stream_rollout_events

Stream rollout events for a pool.

create_global_rollout

Start a global (non-pool-scoped) rollout.

list_global_rollouts

List global rollouts.

get_global_rollout

Fetch a global rollout by id.

cancel_global_rollout

Cancel a global rollout.

get_global_rollout_artifacts

List artifacts for a global rollout.

get_global_rollout_usage

Return usage totals for a global rollout.

get_global_rollout_summary

Return a summary for a global rollout.

stream_global_rollout_events

Stream events for a global rollout.

get_pool_container_health

Return container health for a pool.

get_task_container_health

Return container health for a pool task.

get_pool_container_info

Return container info for a pool.

get_task_container_info

Return container info for a pool task.

get_pool_container_metadata

Return container metadata for a pool.

get_task_container_metadata

Return container metadata for a pool task.

execute_pool_container_rollout

Execute a one-off container rollout on a pool.

execute_task_container_rollout

Execute a container rollout for a specific task.

get_queue_status

Return global queue saturation status.

get_capabilities

Return backend capability flags for pools.

AsyncContainerPoolsClient

Async adapter over ContainerPoolsClient.