
Security News
Node.js Moves to Annual Major Releases Starting with Node 27
The project is retiring its odd/even release model in favor of a simpler annual cadence where every major version becomes LTS.
runapy
Advanced tools
Python client for the Run:ai REST API.
from runai.configuration import Configuration
from runai.api_client import ApiClient
from runai.runai_client import RunaiClient
config = Configuration(
client_id="your-client-id",
client_secret="your-client-secret",
runai_base_url="https://your-org.run.ai",
)
client = RunaiClient(ApiClient(config))
# Start making API calls
projects = client.organizations.projects.get_projects()
Jump to our examples section for more detailed examples.
client_id and client_secret credentials. Create a client applicationEnsure your application token has the required role and scope permissions for your intended API operations.
API calls will fail with a 403 error if the token lacks sufficient role or scope.
For SaaS environments or latest Run:ai control-plane:
pip3 install runapy
For self-hosted environments, specify the minor version matching your control-plane version.
For example, with Run:ai 2.19 control-plane:
pip3 install runapy~=1.219.0
To understand the versioning scheme, refer to the Versioning section.
The client provides three client types to suit different use cases:
ApiClient: Standard synchronous client for sequential operationsThreadedApiClient: Thread-safe client for parallel operations in multithreaded environmentsAsyncApiClient: Asynchronous client for async/await supportHere's a basic example using the standard client:
from runai.configuration import Configuration
from runai.api_client import ApiClient
from runai.runai_client import RunaiClient
config = Configuration(
client_id="your-client-id",
client_secret="your-client-secret",
runai_base_url="https://your-org.run.ai",
)
client = RunaiClient(ApiClient(config))
# Start making API calls
projects = client.organizations.projects.get_projects()
See all client configuration options in the Client configuration options
See Examples for quickstart guides
For parallel operations in a multithreaded environment, use ThreadedApiClient:
from runai.api_client import ThreadedApiClient
with RunaiClient(ThreadedApiClient(config)) as client:
# These operations can run concurrently
projects = client.organizations.projects.get_projects()
For async/await support, use AsyncApiClient:
import asyncio
from runai.api_client import AsyncApiClient
async def main():
async with RunaiClient(AsyncApiClient(config)) as client:
projects = await client.organizations.projects.get_projects()
asyncio.run(main())
The client matches the Run:ai REST API documentation structure with three levels of groups:
organizations, authentication_and_authorization)projects, departments under organizations)get_projects, create_project)Example of navigating the API structure:
# List available API groups in the organizations category
client.organizations.options()
# ['projects', 'departments', 'clusters', 'nodes', ...]
# List available methods in the projects group
client.organizations.projects.options()
# ['get_projects', 'create_project', 'delete_project', ...]
Deprecated methods are hidden by default.
To view both supported and deprecated methods, use the include_deprecated flag:
client.organizations.projects.options(include_deprecated=True)
| Parameter | Type | Description |
|---|---|---|
client_id | string | Required: The Run:ai application client ID, usually representing the application name |
client_secret | string | Required: The client secret associated with the Run:ai application |
runai_base_url | string | Required: The base URL for the Run:ai instance your organization uses (e.g., https://myorg.run.ai) |
bearer_token | string | Optional: Bearer token for CLIv2 compatibility. Cannot be used together with client credentials |
verify_ssl | bool | Optional: Whether to verify SSL certificates. Default is True |
ssl_ca_cert | string | Optional: Path to CA certificate file |
cert_file | string | Optional: Path to client certificate file |
key_file | string | Optional: Path to client key file |
pool_maxsize | int | Optional: Maximum number of connections to keep in pool. Default is 4 |
pool_size | int | Optional: Initial number of connections in pool. Defaults to pool_maxsize |
retry_enabled | bool | Optional: Whether to enable request retries. Default is True |
retry_max_retries | int | Optional: Maximum number of retry attempts. Default is 3 |
retry_backoff_factor | float | Optional: Exponential backoff factor between retries. Default is 0.5 |
proxy_url | string | Optional: URL for proxy server |
proxy_headers | dict | Optional: Additional headers for proxy |
proxy_server_name | string | Optional: SNI hostname for TLS connections |
auto_refresh_token | bool | Optional: Whether to auto refresh token before expiry. Default is True |
token_refresh_margin | int | Optional: Seconds before expiry to refresh token. Default is 60 |
debug | bool | Optional: Enable debug logging. Default is False |
The client supports three authentication methods:
Use client ID and secret from your Run:ai application:
config = Configuration(
client_id="your-client-id",
client_secret="your-client-secret",
runai_base_url="https://your-org.run.ai"
)
Direct authentication using a bearer token:
config = Configuration(
bearer_token="your-bearer-token",
runai_base_url="https://your-org.run.ai"
)
The CLIv2 token method is useful for:
Requirements:
runai login completedfrom runai.cliv2_config_loader import CLIv2Config
# Default config path is ~/.runai
config = CLIv2Config()
# Or specify a custom path
config = CLIv2Config(cliv2_config_path="/path/to/.runai")
token = config.token
runai_base_url = config.control_plane_url
cluster_id = config.cluster_uuid
client = RunaiClient(
cluster_id=cluster_id,
bearer_token=token,
runai_base_url=runai_base_url
)
The repo provides Hand-crafted examples showing common use cases.
See here.
The API client include APIs for all Run:ai UI functionalities.
We encourage you to explore the client relevant categories if you attempt to run a task that is not shown in the examples.
Note: There are also auto-generated examples under /examples/generated (may require syntax adjustments to run properly)
The Run:ai API is an integral part of the control-plane microservices.
As the control-plane evolves, APIs may be added, modified, or deprecated.
This version binding ensures that API changes in the client match the control-plane capabilities.
The client follows semantic versioning (X.Y.Z) with a special alignment to Run:ai's control-plane versions:
For example:
1.218.0 # Initial release for control-plane 2.18
1.218.1 # Patch release for control-plane 2.18
1.219.0 # Initial release for control-plane 2.19
This versioning convention ensures that:
This package is an open-source project maintained by the Run:ai Professional Services team.
If you experience any issues or have feature requests, please submit them via the repository’s issue tracker.
This project is licensed under the Apache-2 License.
See the LICENSE file for details.
FAQs
Python client for Run:ai REST API
We found that runapy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The project is retiring its odd/even release model in favor of a simpler annual cadence where every major version becomes LTS.

Research
/Security News
Published late February to early March 2026, these crates impersonate timeapi.io and POST .env secrets to a threat actor-controlled lookalike domain.

Security News
A recent burst of security disclosures in the OpenClaw project is drawing attention to how vulnerability information flows across advisory and CVE systems.