Account

Your account: its plan, balance, month's spend, counts, limits and defaults (Account.get), changing its defaults (update), the account at a glance with what waits and what failed (status), the public endpoints a publishable key may call, what an id or key prefix names (resolve), and a one-tap payment link for its owner.

class Account

The account at a glance (GET /v1/account): its plan's plan_tier, balance (remaining_usd, None when it can't be read, never 0), this month's spend, how many of each thing it has (counts), its limits and features, its default_region and the default a paused user is told (spending_paused), and what the platform offers (scopes, explicit_scopes). The signed-in owner also reads email, spend_cap and console_key_id; one of the account's own secret keys reads the rest.

Attributes
idstr
emailstr | None
ownerdict[str, str] | None

Who owns it, as NoClick knows them (name, email, phone, each only when known): the signed-in owner's view only.

plan_tierstr | None
balancedict[str, Any]
monthdict[str, Any]
spend_capdict[str, Any] | None
countsdict[str, int]
limitsdict[str, int]
featuresdict[str, bool]
default_regionstr | None
spending_pausedPausedSpendingDefault | None
console_key_idstr | None
scopeslist[str]

What a key with every scope (*) holds.

explicit_scopeslist[str]

The scopes a key holds only when it names them.

rawdict[str, Any]

The response JSON exactly as the API sent it.

getclassmethodasync

noclick.Account.get(*, client=None) -> Account

Read the account: the signed-in owner, or one of the account's own secret keys acting for it (a key acting for one of its users gets noclick.PermissionDenied).

Parameters
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
Account

The account.

Usage
account = noclick.Account.get()
print(account.plan_tier, account.balance["remaining_usd"])

updateclassmethodasync

noclick.Account.update(
    *, default_region=..., spending_paused=..., spend_cap_usd=..., client=None
) -> Account

Change the account's defaults: only the fields given; None clears one. default_region is the region new resources take when a call names none; spending_paused what a paused user is told without a message (a PausedSpendingDefault); spend_cap_usd the monthly spending cap in whole dollars. The signed-in owner's alone.

Parameters
default_regionAnyomit to leave it unchanged
spending_pausedAnyomit to leave it unchanged
spend_cap_usdAnyomit to leave it unchanged
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
Account

The account as it is now.

Usage
noclick.Account.update(default_region="eu", spend_cap_usd=200)

statusstaticasync

noclick.Account.status(*, client=None) -> AccountStatus

The account at a glance, as the key calling sees it: which account (or which of its users the key acts for), its plan, balance, this month's spend against its caps, approvals waiting on a person, what failed in the last day and what ran last. A user's session is refused.

Parameters
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
AccountStatus

The status.

Usage
status = noclick.Account.status()
print(status.account.get("name") or status.account["id"], status.balance.get("remaining_usd"))

public_endpointsstaticasync

noclick.Account.public_endpoints(*, client=None) -> list[PublicEndpoint]

What a publishable key may list: the account's public endpoints (a shared agent's page, a published workflow), each by kind and id. The signed-in owner's alone.

Parameters
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
list[PublicEndpoint]
Usage
for endpoint in noclick.Account.public_endpoints():
    print(endpoint.kind, endpoint.name, endpoint.url)

resolvestaticasync

noclick.Account.resolve(ref, *, client=None) -> ObjectRef

What ref names in the account: an object's id, a key's prefix (nk_live_ab12…) or one of your users' ids. Nothing it names raises noclick.NotFound. The signed-in owner's alone.

Parameters
refstrrequired
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
ObjectRef

Its type and id, and the user it belongs to.

Usage
found = noclick.Account.resolve("nk_live_ab12")
print(found.type, found.id)

AccountStatus

class AccountStatus

The account at a glance (Account.status): account (its id, name, email, or acting_for: the user a key acts for), user_id, its plan, balance, month, caps with what each spent, the approvals waiting on a person (approvals_pending), what failed in the last day (failing) and what ran last (operations).

Attributes
accountdict[str, Any]
user_idstr | None
plandict[str, Any] | None
balancedict[str, Any]
monthdict[str, Any]
capslist[dict[str, Any]]
approvals_pendinglist[dict[str, Any]]
failinglist[dict[str, Any]]
operationsdict[str, Any]
rawdict[str, Any]

The response JSON exactly as the API sent it.

ObjectRef

class ObjectRef

What Account.resolve found: the object's type and id, and the user it belongs to (None: the account).

Attributes
typestr
idstr
user_idstr | None
rawdict[str, Any]

The response JSON exactly as the API sent it.

PausedSpendingDefault

class PausedSpendingDefault

What a paused user is told when a pause names no message (message), and the button with it (action: {"label", "url"}).

Attributes
messagestr | None
actiondict[str, str] | None

PublicEndpoint

class PublicEndpoint

Something the owner made public that a publishable key may call; name and url are None once it stopped being public.

Attributes
kindstr
idstr
namestr | None
urlstr | None
user_idstr | None
rawdict[str, Any]

The response JSON exactly as the API sent it.