Skip to main content

models2go

ML Security Models as a Service - CLI and Python SDK

Scan URLs, emails, and files for threats using machine learning models.

Installation

pip install models2go

Getting Started

  1. Get an API key at models2go.com

  2. Configure the CLI:

m2g config --api-key YOUR_API_KEY --url https://api.models2go.com

Or use environment variables:

export MODELS2GO_API_KEY=your-api-key
export MODELS2GO_URL=https://api.models2go.com
  1. Verify it works:
m2g health

Quick Start

CLI Usage

# Scan a URL for phishing
m2g scan url https://suspicious-site.com

# Scan an email
m2g scan email -b "Click here to verify your account!"

# Look up any threat indicator (auto-detects type)
m2g lookup 8.8.8.8
m2g lookup evil-domain.com
m2g lookup abc123def456...

# Check file hash against malware database
m2g hash 44d88612fea8a8f36de82e1278abb02f

# Check domain for DGA
m2g dga asdfjkl123xyz.com

# List available models
m2g models

# Output as JSON
m2g --json scan url https://example.com

Python SDK

from models2go import Models2GoClient

client = Models2GoClient(api_key="your-api-key")

# Scan URL
result = client.scan_url("https://suspicious-site.com")
print(f"Prediction: {result['prediction']}")
print(f"Confidence: {result['confidence']:.1%}")

# Scan email
result = client.scan_email(
    body="Click here to verify your account",
    subject="Urgent: Account verification required"
)

# Look up threat indicator
result = client.lookup("192.168.1.1")

# Check file hash
result = client.lookup_hash("44d88612fea8a8f36de82e1278abb02f")

Configuration

Set your API key via environment variable or pass it directly:

export MODELS2GO_API_KEY=your-api-key
export MODELS2GO_URL=https://api.models2go.com  # optional

Admin Key (default)

The CLI is preconfigured with a default unlimited admin key for local control:

m2g_admin_default_key_change_me

You can override it via MODELS2GO_API_KEY.

System Unlimited Key

The API also initializes a system-wide unlimited key for internal integrations.
Default (override with MODELS2GO_SYSTEM_KEY env var):

m2g_system_default_key_change_me

CLI Config File

# Show config
m2g config

# Set defaults
m2g config --api-key YOUR_KEY --url http://localhost:8000

# Set profile-specific defaults
m2g config --profile dev --api-key DEV_KEY --url http://localhost:8000
m2g config --profile prod --api-key PROD_KEY --url https://api.models2go.com

# Switch profiles
m2g use dev

API Key Management

# List keys
m2g keys list

# Create a key
m2g keys create --name "Demo Key" --tier indie

# Get a key
m2g keys get m2g_abcdef12

# Revoke a key
m2g keys revoke m2g_abcdef12

# Delete a key
m2g keys delete m2g_abcdef12

# Usage stats
m2g keys usage m2g_abcdef12 --days 30

# Rotate a key
m2g keys rotate m2g_abcdef12

# Set allowlist permissions
m2g keys permissions m2g_abcdef12 --allowlist /api/v1/security --allowlist /api/v1/health

# Regenerate admin key (revokes existing admin keys)
m2g keys admin-regenerate

Available Models

Model Endpoint Description
URL Phishing /api/v1/security/phishing/url Detects phishing URLs
Email Phishing /api/v1/security/phishing/email Detects phishing emails
DGA Detector /api/v1/security/dga Detects algorithmically generated domains
Hash Lookup /api/v1/security/hash Malware hash database (892K samples)
IP Reputation /api/v1/security/ip/{ip} IP threat intelligence (156K IPs)
Unified Lookup /api/v1/security/lookup Auto-detect and lookup any indicator

Exit Codes

The CLI uses exit codes for easy scripting:

  • 0 - Clean/benign
  • 1 - Threat detected (phishing, malicious, etc.)
m2g scan url https://example.com && echo "Clean!" || echo "Threat detected!"

Links

Release files for models2go 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for models2go 1.0.1
File Size Uploaded
models2go-1.0.1.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for models2go 1.0.1
File Interpreter ABI Platform
models2go-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.7 kB

Release files / models2go-1.0.1.tar.gz

Download URL models2go-1.0.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
614c9e156e3f22fcc5b1a9a40b21cc2bb90e3cfd92011ee974f2329221f691d7
BLAKE2b-256 checksum
How to use checksums
6c1a2bfd9b419cde0c18f396ea00b8d2cc23ed2ea8540475832f87e7068a41dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / models2go-1.0.1-py3-none-any.whl

Download URL models2go-1.0.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae07975a21bc4f925f0aafdf77f534880cffdde655a7e86a053e8f6ee52c5791
BLAKE2b-256 checksum
How to use checksums
b53f9c498e3d54979cb39aa19fe71e499fb74236b172f5e8b25a4bedcaacfe05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page