Skip to main content

Python SDK for the Sidearm API — protect media from AI training, detect AI content, and search for stolen work

Project description

sidearmdrm

Python SDK for the Sidearm API. Protect media from AI training, detect AI content, search for stolen work.

Install

pip install sidearmdrm

Quick Start

from sidearm import Sidearm

client = Sidearm(api_key="sk_live_...")
job = client.protect(media_url="https://example.com/art.png", level="maximum")
result = job.wait()
print(result)

Protection

# Preset level (auto-selects algorithms)
job = client.protect(media_url="https://...", level="standard", tags=["portfolio"])

# Run specific algorithms by name
job = client.run(algorithms=["nightshade", "glaze", "hmark"], media_url="https://...")

Job Polling

Async endpoints return a Job handle with built-in polling:

# Wait until done (default 120s timeout, 2s interval)
result = job.wait(timeout=120, interval=2)

# Manual poll
status = job.poll()

# Resume from a previous job ID
resumed = client.jobs.handle("job-uuid")
resumed.wait()

Algorithms

all_algos = client.algorithms.list()
audio = client.algorithms.list(media_type="audio")
open_algos = client.algorithms.list(category="open")

Detection

# AI content detection (async)
ai_job = client.detect.ai(media_url="https://...")
ai_result = ai_job.wait()

# Fingerprint detection (sync)
matches = client.detect.fingerprint(media_url="https://...", tier="perceptual")

# Membership inference
mem_job = client.detect.membership(
    content_ids=["uuid-1", "uuid-2"],
    suspect_model="stable-diffusion-xl",
    method="combined",
)
mem_result = mem_job.wait()

Search

results = client.search.run(media_url="https://...", type="perceptual", limit=10)
history = client.search.list(limit=20)

Media Management

media = client.media.register(media_url="https://...", mode="basic")
library = client.media.list(limit=50)
asset = client.media.get("uuid")
client.media.update("uuid", original_media_url="https://...")
client.media.delete("uuid")

Rights and Billing

rights = client.rights.get("media-uuid")
billing = client.billing.get("account-uuid", start_date="2026-01-01")

Error Handling

from sidearm import Sidearm, SidearmError

try:
    client.protect(media_url="...")
except SidearmError as e:
    print(e)          # Human-readable message
    print(e.status)   # HTTP status code
    print(e.body)     # Raw response body

Context Manager

with Sidearm(api_key="sk_live_...") as client:
    job = client.protect(media_url="https://...")
    result = job.wait()

Requirements

  • Python 3.9+
  • Single dependency: httpx
  • Full type annotations (py.typed)

License

MIT

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

sidearmdrm-0.6.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

sidearmdrm-0.6.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file sidearmdrm-0.6.0.tar.gz.

File metadata

  • Download URL: sidearmdrm-0.6.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for sidearmdrm-0.6.0.tar.gz
Algorithm Hash digest
SHA256 c29e0b5d0e76606a4202786f4b1d39bddd05cc364a3a0cc1f81ddb3a9899172e
MD5 cffb076e398dd0372e5df4f7acaa7166
BLAKE2b-256 c1c0716474df6c6a882bc6f39f130970cb08f620ae1cb848493ba4ab0737e9e3

See more details on using hashes here.

File details

Details for the file sidearmdrm-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: sidearmdrm-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for sidearmdrm-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3edfe120e04fe6c3a05c94c6e11462a707484e5c49b0b56a2860fdcab9c3ba5e
MD5 29829eff75d0b9fc2da205aa81e0118d
BLAKE2b-256 24f7ae7663572caf94b923bda3d8956b45108f949105c73b553e84eb1f127453

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