or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

actors.mdbuilds.mdindex.mdlogging.mdrequest-queues.mdruns.mdschedules.mdstorage.mdstore.mdtasks.mdusers.mdwebhooks.md

users.mddocs/

0

# User Management

1

2

User account information, usage monitoring, and account limit management. Provides access to account details, billing information, and usage statistics.

3

4

## Capabilities

5

6

### User Operations

7

8

```python { .api }

9

class UserClient:

10

def get(self) -> dict | None:

11

"""Get user account information including profile and subscription details."""

12

13

def monthly_usage(self) -> dict | None:

14

"""Get monthly usage summary including compute units and data transfer."""

15

16

def limits(self) -> dict | None:

17

"""Get account limits summary including quotas and restrictions."""

18

19

def update_limits(

20

self,

21

*,

22

max_monthly_usage_usd: int | None = None,

23

data_retention_days: int | None = None

24

) -> None:

25

"""Update account limits.

26

27

Args:

28

max_monthly_usage_usd: Maximum monthly spending limit in USD

29

data_retention_days: Data retention period in days

30

"""

31

32

class UserClientAsync:

33

"""Async version of UserClient with identical methods."""

34

```

35

36

## Usage Examples

37

38

```python

39

from apify_client import ApifyClient

40

41

client = ApifyClient('your-api-token')

42

43

# Get current user information

44

user = client.user().get()

45

print(f"User: {user['username']}")

46

print(f"Plan: {user['plan']}")

47

48

# Check monthly usage

49

usage = client.user().monthly_usage()

50

print(f"Compute units used: {usage['computeUnits']}")

51

print(f"Data transfer: {usage['dataTransfer']} MB")

52

53

# Get account limits

54

limits = client.user().limits()

55

print(f"Max actors: {limits['maxActors']}")

56

print(f"Max runs per month: {limits['maxRunsPerMonth']}")

57

58

# Update spending limit

59

client.user().update_limits(max_monthly_usage_usd=100)

60

```