Quickstart
Welcome to the Copyleaks Quickstart! This guide will walk you through the essential steps to get you up and running with the Copyleaks API in just a few minutes. Let’s begin.
🚀 Let’s Get You Started
Section titled “🚀 Let’s Get You Started”-
Create Your Account
Section titled “Create Your Account”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.
-
Installation
Section titled “Installation”Choose your preferred method for making API calls.
You can interact with the API using any standard HTTP client.
For a quicker setup, we provide a Postman collection. See our Postman guide for instructions.
Terminal window sudo apt-get install curlDownload it from curl.se.
Terminal window brew install curlTerminal window pip install copyleaksTerminal window npm install plagiarism-checker -
To perform a scan, we first need to generate an access token. For that, we will use the login endpoint. The API key can be found on the Copyleaks API Dashboard.
Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the Authorization: Bearer
<TOKEN>
header. This token remains valid for 48 hours.POST https://id.copyleaks.com/v3/account/login/apiHeadersContent-Type: application/jsonBody{"key": "00000000-0000-0000-0000-000000000000"}Terminal window export COPYLEAKS_API_KEY="your-api-key-here"curl --request POST \--url https://id.copyleaks.com/v3/account/login/api \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data "{\"email\": \"${COPYLEAKS_EMAIL}\",\"key\": \"${COPYLEAKS_API_KEY}\"}"from copyleaks.copyleaks import CopyleaksAPI_KEY = "your-api-key-here"# Login to Copyleaksauth_token = Copyleaks.login(EMAIL_ADDRESS, API_KEY)print("Logged successfully!\nToken:", auth_token)const { Copyleaks } = require('plagiarism-checker');const API_KEY = "your-api-key-here";async function login() {const copyleaks = new Copyleaks();const loginResult = await copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY);console.log('Logged successfully!\nToken:', loginResult);return loginResult;}import com.copyleaks.sdk.api.Copyleaks;String API_KEY = "00000000-0000-0000-0000-000000000000";// Login to Copyleakstry {String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY);System.out.println("Logged successfully!\nToken: " + authToken);} catch (CommandException e) {System.out.println("Failed to login: " + e.getMessage());System.exit(1);}Response
{"access_token": "<ACCESS_TOKEN>",".issued": "2025-07-31T10:19:40.0690015Z",".expires": "2025-08-02T10:19:40.0690016Z"} -
Detect AI-Generated Text
Section titled “Detect AI-Generated Text”Now let’s test some text. We’ll start with a sample that’s clearly AI-generated:
POST https://api.copyleaks.com/v2/writer-detector/my-first-scan/checkAuthorization: Bearer your-access-token-hereContent-Type: application/json{"text": "Artificial intelligence has revolutionized numerous industries by automating complex tasks and providing data-driven insights. Machine learning algorithms can analyze vast datasets to identify patterns that humans might miss. In healthcare, AI assists with diagnosis and drug discovery.","sandbox": true}Terminal window curl --location "https://api.copyleaks.com/v2/writer-detector/my-first-scan/check" \--header "Content-Type: application/json" \--header "Authorization: Bearer <ACCESS_TOKEN>" \--data "{\"text\": \"Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey. Lions are known for their strength, teamwork, and complex social structures.\",\"sandbox\": true}"from copyleaks.models.submit.ai_detection_document import NaturalLanguageDocumentscan_id = "my-first-scan"sample_text = "Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey. Lions are known for their strength, teamwork, and complex social structures."document = NaturalLanguageDocument(sample_text)document.set_sandbox(True)response = Copyleaks.AiDetectionClient.submit_natural_language(auth_token, scan_id, document)print("Response:")print(response)print("AI Score:")print(str(response['summary']['ai']*100) + "%")const { CopyleaksNaturalLanguageSubmissionModel } = require('plagiarism-checker');function logSuccess(response) {console.log('Success', response);console.log('AI Score:', response.summary.ai*100, '%');}function logError(error) {console.error('Error', error);}async function detect(loginResult) {const copyleaks = new Copyleaks();const sampleText ="Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey. Lions are known for their strength, teamwork, and complex social structures.";const submission = new CopyleaksNaturalLanguageSubmissionModel(sampleText);submission.sandbox = true;copyleaks.aiDetectionClient.submitNaturalTextAsync(loginResult, Date.now() + 1, submission).then((response) => {logSuccess(response);}).catch((error) => {logError(error);});}async function main() {const loginResult = await login();await detect(loginResult);}main()import com.copyleaks.sdk.api.models.AiDetectionDocument;import com.copyleaks.sdk.api.models.AiDetectionResponse;String scanId = "my-first-scan";String sampleText = "Artificial intelligence has revolutionized numerous industries by automating complex tasks and providing data-driven insights. Machine learning algorithms can analyze vast datasets to identify patterns that humans might miss.";AiDetectionDocument submission = new AiDetectionDocument(sampleText);submission.setSandbox(true);try {AiDetectionResponse response = Copyleaks.aiDetectionClient.submitNaturalLanguage(authToken, scanId, submission);System.out.println("AI Score: " + response.getSummary().getAi());} catch (CommandException e) {System.out.println("Error: " + e.getMessage());}Response
AI Detection Results {"summary": {"ai": 0.95, // 95% likely to be AI-generated"human": 0.05 // 5% likely to be human-written},"results": [{"classification": 2, // 2 = AI-generated, 1 = human-written"probability": 0.95}]}
🎉 Congratulations!
Section titled “🎉 Congratulations!”You have just:
- ✅ Authenticated with the Copyleaks API
- ✅ Made your first AI detection request
- ✅ Interpreted the results
What’s Next?
Section titled “What’s Next?”Ready to scale beyond the basics?
Get a personalized demo and discover how to process thousands of documents seamlessly, integrate Copyleaks into your existing systems, and achieve enterprise-grade accuracy for your specific use case.