Metadata-Version: 2.2
Name: isgenai
Version: 0.1.0
Summary: Python client for the isGenAI check API: AI-image and AI-text evidence, Content Credentials (C2PA), AI labels and saved prompts, no API key needed for the documented endpoints.
Author: isGenAI
License: MIT License
        
        Copyright (c) 2026 isGenAI
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://isgenai.com
Project-URL: Documentation, https://isgenai.com/api
Project-URL: API reference (OpenAPI), https://isgenai.com/openapi.json
Project-URL: Support, https://isgenai.com/contact
Keywords: ai detector,ai image detector,c2pa,content credentials,ai text detector,isgenai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# isgenai

Python client for the [isGenAI](https://isgenai.com) check API. Send an image, a public URL, a passage of text or a piece of code to `POST https://isgenai.com/v1/check` and get back the JSON result: AI-image and AI-text detector evidence, Content Credentials (C2PA), AI labels in metadata, saved generation prompts and known-copy matches, each finding with its source.

- Standard library only (no dependencies), Python 3.8+.
- No API key is needed for the documented public endpoints. Record checks (Content Credentials, AI labels, saved prompts) are unlimited; the public API allows a few AI scans per day per IP address.
- Paid plans (from US$5 a month) add monthly AI scans; pass the key from https://isgenai.com/account as `api_key`.
- Checks are private by default (`privacy="private"`, `public_receipt=False`): no public report is created unless you ask for one.

## Install

```bash
pip install isgenai
```

## Use

```python
import isgenai

# A local image (PNG, JPEG, WebP, AVIF, TIFF, up to 20 MB)
result = isgenai.check_file("picture.png")
print(result["public_result"]["headline"])

# A public image or page URL
result = isgenai.check_url("https://isgenai.com/examples/saved-details/with-saved-details.png")
for item in result["evidence"]:
    print(item["class"], item["outcome"], item["summary"])

# Text
result = isgenai.check_text("Paste the paragraph you want to check here. Longer passages give steadier results.")
print(result["public_result"]["summary"])

# Code
result = isgenai.check_code("def add(a, b):\n    return a + b", language="Python")
```

Every function returns the parsed JSON as a `dict`. The shape is documented in the OpenAPI file at https://isgenai.com/openapi.json and on https://isgenai.com/api. Useful keys:

| Key | Meaning |
| --- | --- |
| `public_result.headline` / `summary` | The headline isGenAI shows, with the caveat that applies |
| `verdict` | The machine-readable verdict |
| `evidence[]` | Each finding: `provider`, `class` (`cryptographic_provenance`, `declarative_metadata`, `explicit_disclosure`, `probabilistic_detector`, `historical_match`, ...), `outcome`, `strength`, `summary`, `details` |
| `disclosures[]` | AI disclosures read from the page or file |
| `adapter_runs[]` | Which detectors ran and their status (`available`, `not_configured`, `rate_limited`, ...) |
| `ai_scans` | Scans used, limit and remaining for the caller |
| `receipt` | Present only for public checks (the public report) |

### Options

All functions accept `privacy` (`"private"` or `"public"`), `public_receipt` (bool), `api_key`, `endpoint` and `timeout`. `check_file`, `check_url` and `check_text` also accept `deep=True` for a slower, more thorough pass where available.

### Errors

Non-2xx responses raise `isgenai.IsGenAIError` with `.status`, `.code` and `.body`:

```python
try:
    isgenai.check_text(text)
except isgenai.IsGenAIError as exc:
    if exc.status == 429:
        print("Daily public scans used up; add an api_key or try tomorrow.")
    else:
        print(exc)
```

## What a result means

A missing Content Credential or label is not proof that a person made the image: metadata is often removed when files are re-saved or uploaded. A detector score is a probabilistic estimate, not a verdict. isGenAI reports exactly what was found and names the source of every finding. Methodology: https://isgenai.com/checker-methodology

## License

MIT. Not affiliated with any AI model vendor.
