continuous-labs
Python SDK for the Continuous API.
Speakeasy generates this SDK from the public Continuous API contract. The API reference documents every operation. Report SDK and API problems in this repository.
Summary
Continuous API: Start API Boxes, Web Boxes and MCP Boxes from Snapshots. Authenticate every request with an API key sent as a Bearer token.
Table of Contents
SDK Installation
[!NOTE]
Python version upgrade policy
Once a Python version reaches its official end of life date, a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
The SDK can be installed with uv, pip, or poetry package managers.
uv
uv is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.
uv add continuous-labs
PIP
PIP is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
pip install continuous-labs
Poetry
Poetry is a modern tool that simplifies dependency management and package publishing by using a single pyproject.toml file to handle project metadata and dependencies.
poetry add continuous-labs
Shell and script usage with uv
You can use this SDK in a Python shell with uv and the uvx command that comes with it like so:
uvx --from continuous-labs python
It's also possible to write a standalone Python script without needing to set up a whole project like so:
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "continuous-labs",
# ]
# ///
from continuous import Continuous
sdk = Continuous(
# SDK arguments
)
# Rest of script here...
Once that is saved to a file, you can run it with uv run script.py where
script.py can be replaced with the actual file name.
IDE Support
PyCharm
Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.
SDK Example Usage
Example
# Synchronous Example
from continuous import Continuous
import os
with Continuous(
api_key_auth=os.getenv("CONTINUOUS_API_KEY_AUTH", ""),
) as c_client:
res = c_client.apiboxes.list(limit=50)
while res is not None:
# Handle items
res = res.next()
The same SDK client can also be used to make asynchronous requests by importing asyncio.
# Asynchronous Example
import asyncio
from continuous import Continuous
import os
async def main():
async with Continuous(
api_key_auth=os.getenv("CONTINUOUS_API_KEY_AUTH", ""),
) as c_client:
res = await c_client.apiboxes.list_async(limit=50)
while res is not None:
# Handle items
res = res.next()
asyncio.run(main())
Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name |
Type |
Scheme |
Environment Variable |
api_key_auth |
http |
HTTP Bearer |
CONTINUOUS_API_KEY_AUTH |
To authenticate with the API the api_key_auth parameter must be set when initializing the SDK client instance. For example:
from continuous import Continuous
import os
with Continuous(
api_key_auth=os.getenv("CONTINUOUS_API_KEY_AUTH", ""),
) as c_client:
res = c_client.apiboxes.list(limit=50)
while res is not None:
# Handle items
res = res.next()
Available Resources and Operations
- list - List API Box Snapshots
- create - Create API Box Snapshot
- delete - Delete API Box Snapshot
- get - Get API Box Snapshot
- update - Update API Box Snapshot
- cancel - Cancel API Box Snapshot build
- clone - Clone API Box Snapshot
- resume - Resume API Box Snapshot build
- list - List credentials
- create - Create credential
- delete - Delete credential
- get - Get credential
- update - Update credential
- list - List MCP Box Snapshots
- create - Create MCP Box Snapshot
- delete - Delete MCP Box Snapshot
- get - Get MCP Box Snapshot
- update - Update MCP Box Snapshot
- cancel - Cancel MCP Box Snapshot build
- clone - Clone MCP Box Snapshot
- resume - Resume MCP Box Snapshot build
- list - List Web Box Snapshots
- create - Create Web Box Snapshot
- delete - Delete Web Box Snapshot
- get - Get Web Box Snapshot
- update - Update Web Box Snapshot
- cancel - Cancel Web Box Snapshot build
- clone - Clone Web Box Snapshot
- resume - Resume Web Box Snapshot build
Pagination
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned response object will have a Next method that can be called to pull down the next group of results. If the
return value of Next is None, then there are no more pages to be fetched.
Here's an example of one such pagination call:
from continuous import Continuous
import os
with Continuous(
api_key_auth=os.getenv("CONTINUOUS_API_KEY_AUTH", ""),
) as c_client:
res = c_client.apiboxes.list(limit=50)
while res is not None:
# Handle items
res = res.next()
File uploads
Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
[!TIP]
For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
from continuous import Continuous
import os
with Continuous(
api_key_auth=os.getenv("CONTINUOUS_API_KEY_AUTH", ""),
) as c_client:
res = c_client.apibox_snapshots.create(request={})
# Handle response
print(res)
Retries
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply provide a RetryConfig object to the call: