AI Services Testing
Validate AI services functionality and credit usage
AI Services Testing
This guide focuses on verifying that the AI services in your platform are functioning correctly and that the credit system is properly tracking usage. We'll test a few representative services to ensure the entire system is working.
Test OCR Service
The Optical Character Recognition (OCR) service is a good first test since it has a clear input/output process and consumes credits.
Access OCR Service
- Sign in to your application
- Navigate to the OCR service in the services menu
- Verify that the service UI loads correctly
Check Initial Credit Balance
Before using the service, note your current credit balance. You'll verify that it decreases after service use.
Upload Test Document
- Prepare a simple text document or image containing text
- Upload the document through the OCR interface
- Submit the document for processing
For testing purposes, a simple PDF or image with a few paragraphs of text is sufficient.
Verify OCR Results
- Wait for the OCR processing to complete
- Check that the extracted text appears in the results
- Verify the accuracy of the text extraction
Verify Credit Deduction
- Check your updated credit balance
- Confirm that credits were deducted based on the service usage
- The deduction should match the credit cost specified for the OCR service
Test Image Generation Service
If your platform includes an image generation service, test it as well:
Access Image Generation Service
- Navigate to the image generation service
- Verify that the service UI loads correctly
Generate an Image
- Enter a text prompt for image generation
- Submit the request
- Wait for the image to be generated
Verify Results and Credits
- Check that the generated image appears and matches your prompt
- Verify that the appropriate number of credits were deducted
Verify Usage Tracking
To ensure that the system is properly tracking service usage:
Check Usage History
- Navigate to your account dashboard or usage history section
- Verify that the services you just used appear in the history
- Check that the timestamp, service type, and credit usage are correctly recorded
Verify in AWS DynamoDB (Optional)
For deeper verification:
- Open the AWS Console
- Navigate to DynamoDB
- Find the service usage table (named like
${STAGE}_${APP_NAME}_table_user_credits
) - Look for entries matching your user ID
- Verify that your service usage is correctly recorded
Next Steps
Now that you've verified the core AI services and credit system functionality, you have successfully tested all the essential components of your AI SaaS platform. Your platform is now ready for use!
If you'd like to enhance your platform with a professional touch, you can optionally proceed to Custom Domain Setup to configure a custom domain for your application.