Truthscan.ImageDetector.Client
20260525.1.0
dotnet add package Truthscan.ImageDetector.Client --version 20260525.1.0
NuGet\Install-Package Truthscan.ImageDetector.Client -Version 20260525.1.0
<PackageReference Include="Truthscan.ImageDetector.Client" Version="20260525.1.0" />
<PackageVersion Include="Truthscan.ImageDetector.Client" Version="20260525.1.0" />
<PackageReference Include="Truthscan.ImageDetector.Client" />
paket add Truthscan.ImageDetector.Client --version 20260525.1.0
#r "nuget: Truthscan.ImageDetector.Client, 20260525.1.0"
#:package Truthscan.ImageDetector.Client@20260525.1.0
#addin nuget:?package=Truthscan.ImageDetector.Client&version=20260525.1.0
#tool nuget:?package=Truthscan.ImageDetector.Client&version=20260525.1.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
The NuGet package id is Truthscan.ImageDetector.Client.
dotnet add package Truthscan.ImageDetector.Client
Or add to your .csproj:
<PackageReference Include="Truthscan.ImageDetector.Client" Version="20260525.0.0" />
Quick start
using Truthscan.ImageDetection.Client;
var apiKey = Environment.GetEnvironmentVariable("TRUTHSCAN_API_KEY") ?? "YOUR_API_KEY";
var client = new Client(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.Client;
using Truthscan.ImageDetection.Logging;
var client = new Client(
apiKey: "YOUR_API_KEY",
baseUrl: null, // optional API base URL
timeoutSeconds: 60,
logger: new DefaultConsoleLogger(LogLevel.Info)
);
API reference
Client
| 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 | |
|---|---|---|---|
| 20260525.1.0 | 108 | 5/25/2026 | |
| 20260525.0.0 | 92 | 5/25/2026 | |
| 20260521.3.0 | 91 | 5/22/2026 |