How-To: View Credit Balance and Add Credit to Your Account
This guide explains how to view your credit balance and add credits to your account using the web console.
Accessing the Credit Balance
You can access your credit balance from two locations in the web console:
Main Page of the Console
Log in to the web console, and your credit balance will be prominently displayed on the main page.
Finance Dashboard
Navigate to the Finance Page and access the Finance Dashboard for a detailed view of your financial activity.
On either page, you’ll find the following credit-related information:

1
2
3
import lattica_common.auth_local_state as auth
import lattica_common.app_api as agent_app
# Notice your account token expires every 30 days and it's up to you to renew it
auth.set_session_token("your_account_token_you_got_in_your_email")
credits = agent_app.account.get_credits_balance()
if credits < 100:
try:
# Add credits to the account
agent_app.account.add_credits(200)
print(f"Added {CREDITS_TO_ADD} credits to your account successfully.")
except Exception as e:
# Handle any errors that occur during the credit addition
print(f"Failed to add credits: {e}")
else:
print("Sufficient credits available. No need to add more credits.")
Last updated
Was this helpful?