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
Remaining Credit Balance
Displays the current amount of credits available in your account.
These credits are used to pay for worker runtime.
2
Estimated Usage Time
Provides an approximate estimate of how long the remaining credits will allow your workers to operate.
Note: This calculation depends on the type of workers you are running and their usage rate, so it is an approximation.
3
Last Payment Date
Shows the date of your most recent payment, helping you track when credits were last added.
4
Adding Credits
Click the "Add Credit" Button
Follow the prompts to enter your payment information
Confirm your payment to complete the transaction.
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.")