Truthscan.ImageDetection
20260526.4.0
dotnet add package Truthscan.ImageDetection --version 20260526.4.0
NuGet\Install-Package Truthscan.ImageDetection -Version 20260526.4.0
<PackageReference Include="Truthscan.ImageDetection" Version="20260526.4.0" />
<PackageVersion Include="Truthscan.ImageDetection" Version="20260526.4.0" />
<PackageReference Include="Truthscan.ImageDetection" />
paket add Truthscan.ImageDetection --version 20260526.4.0
#r "nuget: Truthscan.ImageDetection, 20260526.4.0"
#:package Truthscan.ImageDetection@20260526.4.0
#addin nuget:?package=Truthscan.ImageDetection&version=20260526.4.0
#tool nuget:?package=Truthscan.ImageDetection&version=20260526.4.0
TruthScan Image Detection — .NET Client
.NET client for the TruthScan AI Image Detection API. Detect whether images are AI-generated, real, digitally edited, or AI-edited.
Installation
dotnet add package Truthscan.ImageDetection
Or add to your .csproj:
<PackageReference Include="Truthscan.ImageDetection" Version="20260525.0.0" />
Quick start
using Truthscan.ImageDetection;
var apiKey = Environment.GetEnvironmentVariable("TRUTHSCAN_API_KEY") ?? "YOUR_API_KEY";
var client = new ImageDetectionClient(apiKey);
// Detect AI-generated content in an image (full workflow: presign, upload, detect, poll)
var result = await client.Detect("/path/to/image.jpg");
Console.WriteLine($"Status: {result.Status}");
Console.WriteLine($"Result: {result.Result}"); // Confidence score
Console.WriteLine($"Final: {result.ResultDetails?.FinalResult}"); // e.g. "AI Generated", "Real"
// Check user credits
var credits = await client.CheckUserCredits();
Console.WriteLine($"Credits: {credits.Credits}");
Configuration
using Truthscan.ImageDetection;
using Truthscan.ImageDetection.Logging;
var client = new ImageDetectionClient(
apiKey: "YOUR_API_KEY",
baseUrl: null, // optional API base URL
timeoutSeconds: 60,
logger: new DefaultConsoleLogger(LogLevel.Info)
);
API reference
ImageDetectionClient
| Method | Description |
|---|---|
Detect(imagePath, email?, generatePreview?, maxPollAttempts?, pollIntervalSeconds?) |
Full workflow: presign, upload, detect, poll until done. Returns QueryResponse. |
CheckUserCredits() |
Returns credit balance for the API key. |
ImageDetectionService (low-level)
For advanced use cases, use ImageDetectionService directly:
| Method | Description |
|---|---|
GetPresignedUrl(fileName) |
Get presigned URL for upload. |
Upload(presignedUrl, filePath, mimeType?) |
Upload file to presigned URL. |
Detect(fileUrl, email?, generatePreview) |
Submit image for detection. |
Query(detectId) |
Query detection status and results. |
PollForResult(detectId, maxAttempts?, sleepSeconds?) |
Poll until done or failed. |
CheckUserCredits() |
Check user credits. |
Supported file formats
JPG, JPEG, PNG, WebP, JFIF, HEIC, HEIF, AVIF, BMP, TIFF, TIF, GIF, SVG, PDF
File size limits: 1 KB – 10 MB
Note: Remove spaces from filenames before uploading.
Running the test application
The test console app mirrors the Node.js batch test script:
cd dotnet
export TRUTHSCAN_API_KEY=your_api_key
dotnet run --project Undetectable.AI.ImageDetection.Tests
dotnet run --project Undetectable.AI.ImageDetection.Tests -- /path/to/images
Results are written to api_client_test_results.json.
Exceptions
| Exception | When thrown |
|---|---|
PresignException |
Failed to get presigned URL |
UploadException |
File upload failed |
DetectException |
Detect request failed |
QueryException |
Query failed or polling timeout |
CreditCheckException |
Credit check failed |
Build
cd dotnet
dotnet build
dotnet pack # Create NuGet package
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 20260526.4.0 | 72 | 5/26/2026 |