Skip to main content
The Client class provides session management, authentication, and access to CVAT server APIs.

Creating a Client

Basic Initialization

The URL can be specified with or without a protocol:
  • "cvat.example.com" - Auto-detects HTTPS/HTTP
  • "https://cvat.example.com" - Explicit HTTPS
  • "http://localhost:8080" - Explicit HTTP with port

Using make_client Helper

The make_client function provides a convenient way to create and authenticate a client:

Authentication

The SDK supports two authentication methods: password-based and token-based.

Password Authentication

Authenticate with username and password:

Token Authentication

Authenticate with a Personal Access Token (PAT):
Token authentication is recommended for automation and CI/CD pipelines.

Checking Authentication Status

Logging Out

Configuration

Customize client behavior with the Config class:

Configuration Options

float
default:"5"
Interval in seconds between status checks for long-running operations (uploads, exports, etc.)
bool
default:"True"
Whether to allow connection to unsupported CVAT server versions. If False, raises IncompatibleVersionException.
bool | None
default:"None"
SSL certificate verification. Set to False to disable (not recommended for production).
Path
default:"~/.cache/cvat-sdk"
Directory for caching server data (used by datasets and PyTorch adapters).

Context Manager

Use the client as a context manager for automatic cleanup:
Manual cleanup:

API Access

The client provides access to various CVAT resources through repository properties:

Tasks Repository

Projects Repository

Jobs Repository

Users Repository

Organizations Repository

Issues and Comments

Organization Context

Set an organization context for all operations:

Low-Level API Access

Access the underlying auto-generated API client:

Server Version Checking

The SDK checks server version compatibility on initialization:
Supported server versions are typically the current and next minor version relative to the SDK version.

Waiting for Long Operations

Some operations (uploads, exports) are asynchronous. Use wait_for_completion to wait for them:

Logging

The client uses Python’s standard logging module:

API URL Construction

The client provides URL construction utilities:

Exception Handling

Next Steps