dickless
Official Rust SDK for the dickless.io API platform.
Installation
Add to your Cargo.toml:
[]
= "0.1"
= { = "1", = ["full"] }
Quick Start
use DicklessClient;
async
You can optionally override the base URL for self-hosted or staging environments:
let client = new
.with_base_url;
Modules
Content Moderation
Analyze text and images for toxicity, hate speech, violence, NSFW content, and more.
// Text moderation
let result = client.moderate_text.await?;
println!; // true | false
println!; // 0.0 - 1.0
for cat in &result.categories
// Image moderation (base64-encoded image)
let result = client.moderate_image.await?;
println!;
PII Redaction
Strip personally identifiable information from text. Optionally specify which entity types to target.
let result = client.redact.await?;
println!; // "Contact me at [EMAIL] or [PHONE]"
println!; // 2
for entity in &result.entities
Supported entity types: email, phone, ssn, credit_card, name, address, ip_address, date_of_birth.
AI Gateway
Send chat completion requests through a unified gateway that supports OpenAI, Anthropic, and Google models.
use ;
let response = client.chat.await?;
println!;
println!;
You can set a default gateway mode that applies to all chat requests:
let client = new
.with_default_gateway_mode;
Credits
Check your credit balance and transaction history for dedicated gateway mode.
let balance = client.get_credit_balance.await?;
println!;
let transactions = client.get_credit_transactions.await?;
for tx in &transactions
Prompt Sanitizer
Detect and neutralize prompt injection attacks before they reach your LLM.
let result = client.sanitize.await?;
println!; // false
println!; // cleaned prompt string
println!;
for threat in &result.threats
URL Shortener
Create short URLs with optional custom codes and QR code generation.
// Create a short URL
let link = client.shorten.await?;
println!; // "https://dickless.io/s/my-link"
if let Some = &link.qr_code
// Get click analytics
let stats = client.get_short_url_stats.await?;
println!;
println!;
Roast Tool
Generate AI-powered roasts for resumes, landing pages, code, LinkedIn profiles, or any text.
let result = client.roast.await?;
println!;
println!;
PDF Generation
Generate PDFs from HTML content or a URL.
use PdfOptions;
let pdf = client.generate_pdf.await?;
println!;
Email Verification
Verify an email address for deliverability and validity.
let result = client.verify_email.await?;
println!; // true
println!; // false
DNS / WHOIS Lookup
Look up DNS records and optionally retrieve WHOIS data for a domain.
let result = client.dns_lookup.await?;
println!;
println!;
IP Geolocation & Threat Intel
Get geolocation and threat intelligence for an IP address.
let result = client.ip_intel.await?;
println!; // "US"
println!; // "Mountain View"
Webhook Delivery
Deliver a webhook to a URL with retry and HMAC signing support.
use WebhookOptions;
let result = client.deliver_webhook.await?;
println!;
HTML/Markdown Sanitizer
Sanitize HTML or Markdown by stripping dangerous tags and attributes.
use HtmlSanitizeOptions;
let result = client.sanitize_html.await?;
println!; // "<p>Hello</p>"
Error Handling
All methods return Result<T, DicklessError>. You can match on the error variants:
use ;
let client = new;
match client.moderate_text.await
License
MIT