This guide will walk you through installing the official Rust SDK and running your first scan. In just a few minutes, you’ll be able to check content for plagiarism, AI-generated text, moderation and more directly from your Rust application. Before you start, ensure you have the following:
  • An active Copyleaks account. If you don’t have one, sign up for free.
  • You can find your API key on the API Dashboard.
  • Rust 1.88 or later. The SDK is async and runs on Tokio.

Get Started

1

Installation

Add the official copyleaks crate and Tokio to your project.
2

Quick Example: Scan Text

src/main.rs
3

Understanding the Code

The example code performs four main actions to submit a scan:
  1. Create a client: Client::new() creates the client that sends every request.
  2. Login: It authenticates with your email and API key to get a login token, which is required for all subsequent requests.
  3. Configure Scan: ScanProperties::new takes the webhook URL, and .sandbox(true) turns on sandbox mode for safe testing. FileSubmission::from_bytes takes the content, a filename and the properties; the SDK encodes the content to Base64 for you.
  4. Submit for Scanning: submit_file sends the submission to the Copyleaks API. The process is asynchronous; Copyleaks will notify your webhook URL once the scan is complete.
The request types are #[non_exhaustive], so new API fields can arrive in minor releases. Build them with their constructors and chainable setters, not with struct literals.

Next Steps

GitHub Repository

Check the official Copyleaks Rust SDK repository on GitHub for more examples and details.

crates.io Package

View the official crate on crates.io to see all available versions.

API Reference

Browse every type and method of the SDK on docs.rs.

Check for Plagiarism

Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content.

Detect AI-Generated Content

Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async.

Assess Grammar and Writing Quality

Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs.

Moderate Text

Scan and moderate text content for unsafe or policy-relevant material across 10+ categories.