LatticaAI Documentation
  • Welcome to LatticaAI
  • Conceptual Guide
  • Architecture Overview
    • Management Client
    • Query Client
  • Platform Workflows
    • Account Management
    • Model Management
    • User Access Management
    • Query Submission
    • Credit Management
    • Worker Management
  • How-To Guides
    • Client Installation
      • How-To: Install Management Client
      • How-To: Install Query Client
    • Model Lifecycle
      • How-To: Deploy AI model
      • How-To: Modify AI Model Settings
    • Access Control
      • How-To: Create User Access Token
      • How-To: Modify User Access Token Setting
      • How-To: Remove Token's Assignment
      • How-To: Assign Token to Model
      • How-To: See List of Tokens
    • Resource Management
      • How-To: Start Worker
      • How-To: Stop Worker
      • How-To: Monitor Worker Performance
    • Secure Query Processing
      • How To: Upload Evaluation Key
      • How-To: Encrypt Input Message
      • How To: Execute Query
      • How-To: Decrypt Output Data
      • How-To: Encrypt, Execute, and Decrypt in One Step
    • Account and Finance Operations
      • How-To: View Payment Transaction History
      • How-To: Update Account Information
      • How-To: View Credit Balance and Add Credit to Your Account
      • How-To: Monitor Balance and Usage
  • Demo Tutorials
    • Image Sharpening with LatticaAI Demo Tutorial
    • Sentiment Analysis with LatticaAI Demo Tutorial
    • Health Analysis with LatticaAI Demo Tutorial
    • Digit Recognition with LatticaAI Demo Tutorial
    • Zooming Into Each Step of Demo Run with LatticaAI flow
Powered by GitBook
On this page

Was this helpful?

  1. How-To Guides
  2. Account and Finance Operations

How-To: View Credit Balance and Add Credit to Your Account

PreviousHow-To: Update Account InformationNextHow-To: Monitor Balance and Usage

Last updated 3 months ago

Was this helpful?

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:

  1. Main Page of the Console

    • Log in to the web console, and your credit balance will be prominently displayed on the main page.

  2. 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.")

Balance