ProtectedclientReadonlycurrentCurrent account data.
Protectedeip712ProtectedlistenersGet the account balance of the current account. This method returns the account balance of the current user, including settled, credit, debit, and unclaimed earnings amounts.
ProtectedattributionOptionaloverride: WorkloadAttributionInputOptionalfallbackOperationId: stringCreate a Stripe checkout session to subscribe to a plan.
Returns a url to which the user should be redirected to complete payment.
After a successful checkout Stripe will redirect back to your configured
return URL and the subscription entitlement will become active.
Pass options.startTrial to control free-trial behavior: true starts a
trial when the account is eligible, while false is sent verbatim to
subscribe immediately with no trial even if the account is eligible.
Host applications may pass options.deviceId when their integration
requires the corresponding server-side context.
The plan identifier from getSubscriptionPlans
Billing cadence: 'monthly' or 'annual'
Optional checkout metadata, redirect target, and trial controls.
Create a Stripe customer portal session for managing an existing subscription.
Returns a url to which the user should be redirected. The portal lets
them update payment methods, cancel, or view invoices.
Deposit tokens from wallet to account
account password
amount to transfer
blockchain provider, 'base' or 'etherlink' defaults to 'base'
ProtectedemitFetch the list of available subscription plans.
This is a public endpoint; no authentication is required.
Fetch the current user's subscription entitlement snapshot.
Returns an object describing whether the account has an effective
subscription entitlement, the tier, period boundaries, usage, limits, and
enabled capabilities. When no subscription exists, active is false and
status is 'none'.
Also updates currentAccount.subscription so callers can read the
snapshot from the observable entity without re-fetching.
Fetch the current user's usage for the active billing cycle.
Returns the render/job counters for the subscriber's current billing cycle
(not a calendar month). While the entitlement is 'trialing', the response
also carries trialEndsAt, trialCreditsLimit, and trialCreditsUsed so
you can render "X of N trial credits used" messaging; those fields are
omitted for non-trial subscriptions.
Note: these trial usage fields come from this endpoint, NOT from getSubscriptionStatus — the entitlement snapshot never carries trial usage.
Check whether the current account is eligible to start a free trial.
Returns { eligible, reasonCode }. Use eligible as the decision and
treat reasonCode as an opaque display hint.
Create Ethers.js Wallet instance from username and password. This method is used internally to create a wallet for the user. You can use this method to create a wallet if you need to sign transactions.
Sogni account username
Sogni account password
Login with username and password. WebSocket connection is established after successful login.
Whether to establish a long-lived session. Default is false. Only applicable for cookie-based authentication.
OptionalappSource: stringOptional client app/source label for login attribution. Defaults to the SogniClient connection appSource when configured.
Refresh the balance of the current account.
Usually, you don't need to call this method manually. Balance is updated automatically through WebSocket events. But you can call this method to force a balance refresh. Note that will also trigger updated event on the current account.
Refresh the cached subscription entitlement on currentAccount.
Convenience wrapper around getSubscriptionStatus that makes the intent ("I want to pull fresh entitlement data into the observable account entity") explicit at the call site.
Remove all event listeners, optionally for a specific event
Optionalevent: TProtectedresolveOptionaloverride: WorkloadAttributionInputOptionalfallbackOperationId: stringSwitch between fast and relaxed networks. This will change default network used to process projects. After switching, client will receive list of AI models available for on selected network.
Network type to switch to
Get the transaction history of the current account.
Transaction history query parameters
Transaction history entries and next query parameters
Get the balance of the wallet address.
This method is used to get the balance of the wallet address. It returns $SOGNI and ETH balance.
blockchain provider, 'base' or 'etherlink' defaults to 'base'
Withdraw funds from the current account to wallet.
account password
amount of tokens to withdraw from account to wallet
blockchain provider, 'base' or 'etherlink' defaults to 'base'
Account API methods that let you interact with the user's account. Can be accessed via
sogni.account. Look for more samples below.Example: Retrieve the current account balance