Skip to main content

Python SDK for the TrustOriginality.ai AI-content detection and provenance API

Project description

TrustOriginality.ai — Python SDK

Thin wrapper around the TrustOriginality.ai REST API for AI-content detection, composite KYC verification and the signed provenance registry.

Install

pip install trustoriginality
# Local dev from repo: pip install ./sdk/python

Quick start

from trustoriginality import TrustOriginality

client = TrustOriginality(api_key="to_live_...")  # create keys in the panel under API Keys

# Text
res = client.analyze_text("The content you want to analyze...")
print(res["isAIGeneratedLikely"], res["score"])

# Image — from a local file or a public URL
res = client.analyze_image(file="photo.jpg", name="Campaign visual")
res = client.analyze_image(url="https://example.com/photo.jpg")

# Audio / video work the same way
res = client.analyze_audio(file="voice.mp3")
res = client.analyze_video(url="https://example.com/clip.mp4")

# Composite KYC: ID document + selfie (+ optional voice)
res = client.verify_kyc(document="id-card.jpg", selfie="selfie.jpg", voice="sample.wav")
print(res["riskLevel"], res["recommendation"])

# Provenance registry
res = client.register_provenance(file="original.png", declaration="human-created")
print(res["contentHash"], res["verifyUrl"])
record = client.get_provenance(res["contentHash"])

Errors

All non-2xx responses raise TrustOriginalityError with status_code and the parsed API payload:

from trustoriginality import TrustOriginality, TrustOriginalityError

try:
    client.analyze_image(url="https://example.com/missing.jpg")
except TrustOriginalityError as e:
    print(e.status_code, e.payload)

Self-hosted / on-prem (TrustOriginality Box)

Point the client at your Box instead of the cloud panel:

client = TrustOriginality(api_key="unused", base_url="http://box.local:8080")

Note: Box endpoints use /analyze/image style paths; cloud-specific features (credits, provenance) are panel-only. See TrustOriginality_Box/README.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trustoriginality-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trustoriginality-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file trustoriginality-0.1.0.tar.gz.

File metadata

  • Download URL: trustoriginality-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for trustoriginality-0.1.0.tar.gz
Algorithm Hash digest
SHA256 662193b3a4b07bb1a6c3009706de2ec113d0301cb09ff22579aeb2f80d5fa02f
MD5 f24cd00b29778fe332bfe89602d8f17d
BLAKE2b-256 11d4b6a615e792e503fc26b27986d4b18d5da636f3b1f5cbfea1b4282b9a0d93

See more details on using hashes here.

File details

Details for the file trustoriginality-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for trustoriginality-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60b1275f47ce48d3136d0be56d476cb9407ca48f72a021d938bf0e46f0178c9e
MD5 2f6a7a45ecda4d34085c6e777a952e67
BLAKE2b-256 1d6435387fd3c4fe3f585f7a8abd53bb8dc0a3dd799b973b818beaae265b5430

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page