Skip to content

SDK Installation

SDK Installation

Download our official SDKs for Python and JavaScript - no package manager required.

Info

How it works: Download the SDK file to your project folder, then import it. No pip/npm install needed.

Python SDK

Step 1: Install the required dependency

pip install requests

Step 2: Download the SDK to your project folder

# Navigate to your project directory first
cd /path/to/your/project

# Download the SDK file
curl -O https://www.xybern.com/static/sdk/xybern.py

# Now you have xybern.py in your project folder

Step 3: Import and use in your Python script (must be in same folder)

# your_script.py (in the same folder as xybern.py)
from xybern import Xybern

client = Xybern(api_key="xb_your_api_key")

result = client.verify(
    content="AI generated text to verify...",
    source={"type": "llm", "model": "gpt-4", "provider": "openai"}
)

print(f"Trust Score: {result['trust_score']}%")
print(f"Fairness Score: {result['bias']['fairness_score']}%")

Project structure:

my_project/
├── xybern.py          # Downloaded SDK
├── your_script.py     # Your code that imports xybern
└── ...

JavaScript SDK

Option A: Browser (easiest)

Just add a script tag - no download needed:

<!DOCTYPE html>
<html>
<head>
    <script src="https://www.xybern.com/static/sdk/xybern.js"></script>
</head>
<body>
    <script>
        const client = new Xybern({ apiKey: 'xb_your_api_key' });

        async function verify() {
            const result = await client.verify({
                content: 'AI generated text...',
                source: { type: 'llm', model: 'gpt-4' }
            });
            console.log('Trust Score:', result.trust_score);
        }

        verify();
    </script>
</body>
</html>

Option B: Node.js

Step 1: Download the SDK to your project folder

# Navigate to your project directory
cd /path/to/your/project

# Download the SDK file
curl -O https://www.xybern.com/static/sdk/xybern.js

Step 2: Require and use in your script

// app.js (in the same folder as xybern.js)
const { Xybern } = require('./xybern.js');

const client = new Xybern({ apiKey: 'xb_your_api_key' });

async function main() {
    const result = await client.verify({
        content: 'AI generated text...',
        source: { type: 'llm', model: 'gpt-4' }
    });

    console.log(`Trust Score: ${result.trust_score}%`);
}

main();

Project structure:

my_project/
├── xybern.js          # Downloaded SDK
├── app.js             # Your code that requires xybern
└── package.json

Success

That's it! The SDK file must be in the same directory as your script. No global installation needed.

Warning

Important: Keep your API key secure. For production, use environment variables instead of hardcoding.