Skip to main content

APIClient

The APIClient class provides a Pythonic interface to access ClearML's backend REST API. It is a convenient low-level access tool. Through an APIClient instance, you can access ClearML's REST API services:

  • authentication - Authentication management, authorization and administration for the entire system
  • debug - Debugging utilities
  • projects - Support for defining Projects containing tasks, models, datasets, and/or pipelines
  • queues - Queue management API
  • workers - API for worker machines to report status and retrieve tasks for execution.
  • events - Event (e.g. metrics, debug samples) reporting and retrieval API
  • models - Model management API
  • tasks - Task Management API

Using APIClient

APIClient makes the ClearML Server's REST API endpoints available as Python methods.

To use APIClient, create an instance of it then call the method corresponding to the desired REST API endpoint, with its respective parameters as described in the REST API reference page.

For example, the POST/ projects.get_all call returns all projects in your workspace. The following code uses APIClient to retrieve a list of all projects whose name starts with "example."

from clearml.backend_api.session.client import APIClient

# Create an instance of APIClient
client = APIClient()
project_list = client.projects.get_all(name="example*")
print(project_list)