Skip to main content
Deactivating a standalone sampler shuts it down and stops its billing. A paired sampler stops with its run, so to end one, deactivate the run instead; deactivating a paired sampler directly returns a 409 error that names its run. You need the sampler’s ID: the sampler_id property of the sampling client that created it, or the id from List samplers. The Python SDK and the curl examples authenticate with BASETEN_API_KEY. Export your API key first:
To deactivate a standalone sampler:Call deactivate() on the sampling client that created it:
To deactivate a sampler from another script, call deactivate_sampler() on a ServiceClient, replacing <sampler_id> with the sampler’s ID:
Both calls succeed if the sampler is already inactive. Closing the sampling client with close() releases its local connections but doesn’t deactivate the sampler.
To confirm the sampler stopped, request it and check that status.name is INACTIVE:

Next steps