Copyleaks provides a comprehensive suite of content integrity services through a flexible, credit-based API. To help you maximize the value of the platform and manage your usage effectively, it is essential to implement smart credit management strategies. Copyleaks offers robust tools to monitor and control your credit consumption, ensuring full transparency and predictability. This guide outlines the available options to help you get started.

Price Check Before Scan

Some applications may not have visibility into document sizes before submission, as end-users directly upload files. This can lead to unintended credit consumption when scanning large documents. To mitigate this, Copyleaks recommends pre-checking the number of credits required for a scan before proceeding. This allows you to decide whether to continue with the scan or abort it, avoiding unnecessary charges.

How to Enable Price Check

To activate the Check-Credits flow, set the properties.action parameter to 1 (Check-Credits) when submitting a document. In the webhook response, you will receive the expected cost of the scan without actually performing it. After receiving the response, you can decide whether to proceed with the scan or not. To start the scan use the Start endpoint.

Confirming Scan Cost After Completion

Once a scan is completed, Copyleaks sends a Completed Webhook to your application, including details about the final cost of the scan. By tracking this information, you can develop insights into your expected service costs and optimize your usage accordingly.
You are only charged for successfully completed scans. If a scan fails due to an error, the credits will be automatically refunded.

Programmatically Monitor Your Remaining Credits

Copyleaks API is designed to provide full automation, reducing the need for manual intervention. You can retrieve your current credit balance to implement various control mechanisms:
  • Set spending limits - Define a threshold (e.g., limit usage to 50% of the budget by mid-month) and configure your system to react accordingly.
  • Trigger alerts - Automatically send notifications when your remaining credits fall below a certain percentage (e.g., below 10%). This can be implemented as a cron job for regular monitoring.

Retrieve Credit Balance

You can check your current credit balance using the Get Credits Balance endpoint. This will return the number of credits available in your account.

Set a Spend Limit on Automatic Refills

To prevent running out of credits during a billing cycle, Copyleaks offers automatic refills, ensuring that scans are never interrupted.

Why Use Automatic Refills?

  • Ensures that ongoing scans are not disrupted.
  • Eliminates the need for manual intervention.
However, uncontrolled automatic refills can lead to unexpected costs, especially if a bug in your application results in excessive scans.
Set a maximum budget for automatic refills to prevent unforeseen expenses.

How to Enable Automatic Refills

You can manage this feature via the billing settings in your Copyleaks account.

Predict Your Usage

To forecast your credit consumption, Copyleaks provides access to historical usage data. By retrieving your usage history, you can generate reports (in CSV format) to analyze past trends and predict future requirements.

Retrieve Usage History

You can programmatically retrieve a detailed history of your credit consumption using the API Usage History endpoint. This allows you to fetch data for specific date ranges, which can then be exported or integrated into your own internal dashboards. By analyzing this historical data, you can identify usage patterns, track costs associated with different projects, and build more accurate forecasts for future credit needs.

Summary

The Copyleaks API offers extensive flexibility to help you manage credits efficiently. By leveraging these features strategically, you can prevent excessive usage, optimize costs, and maintain control over your plagiarism detection workflows. Use these tools to ensure a cost-effective and seamless integration.

Next Steps

Start a Scan

Learn how to initiate a scan after checking the credit cost.

Completed Webhook

Understand the details provided in the completed webhook, including the final scan cost.

Get Credit Balance

Retrieve your current credit balance programmatically.

API Usage History

Access your historical usage data to predict future credit consumption.