Skip to main content

Scalekit official Python SDK

Project description


Official Python SDK

PyPI version License: MIT Python versions

Scalekit is the auth stack for AI apps - from human authentication to agent authorization. Build secure AI products faster with authentication for humans (SSO, passwordless, full-stack auth) and agents (MCP/APIs, delegated actions), all unified on one platform. This Python SDK enables both traditional B2B authentication and cutting-edge agentic workflows.

🤖 Agent-First Features

  • 🔐 Agent Identity: Agents as first-class actors with human ownership and org context
  • 🎯 MCP-Native OAuth 2.1: Purpose-built for Model Context Protocol with DCR/PKCE support
  • ⏰ Ephemeral Credentials: Time-bound, task-based authorization (minutes, not days)
  • 🔒 Token Vault: Per-user, per-tool token storage with rotation and progressive consent
  • 👥 Human-in-the-Loop: Step-up authentication when risk crosses thresholds
  • 📊 Immutable Audit: Track which user initiated, which agent acted, what resource was accessed

👨‍💼 Human Authentication

  • 🔐 Enterprise SSO: Support for SAML and OIDC protocols
  • 👥 SCIM Provisioning: Automated user provisioning and deprovisioning
  • 🚀 Passwordless Authentication: Magic links, OTP, and modern auth flows
  • 🏢 Multi-tenant Architecture: Organization-level authentication policies
  • 📱 Social Logins: Support for popular social identity providers
  • 🛡️ Full-Stack Auth: Complete IdP-of-record solution for B2B SaaS
  • 🐍 Pythonic API: Clean, intuitive interface following Python conventions
📚 Documentation • 🚀 SSO Quickstart • 💻 API Reference

Pre-requisites

  1. Sign up for a Scalekit account.
  2. Get your env_url, client_id and client_secret from the Scalekit dashboard.

Installation

Install Scalekit SDK using your preferred package manager.

pip install scalekit-sdk-python

Usage

from scalekit import ScalekitClient

sc = ScalekitClient(
  env_url, 
  client_id, 
  client_secret
)

# Use the sc object to interact with the Scalekit API
auth_url = sc.get_authorization_url(
  "https://acme-corp.com/redirect-uri",
  state="state",
  connection_id="con_123456789"
)
Minimum Requirements

To use the Scalekit Python SDK, you must have the following:

Component Version
Python 3.8+

Tip: Although Python 3.8 meets the minimum requirement, using a more recent version (such as Python 3.9 or later) is advisable.

Examples - SSO with FastAPI

Below is a simple code sample that showcases how to implement Single Sign-on using Scalekit SDK

from fastapi import FastAPI, Request, Response
from scalekit import ScalekitClient
import uvicorn

app = FastAPI()

sc = ScalekitClient(
  env_url, 
  client_id, 
  client_secret
)

redirect_uri = "http://localhost:8000/auth/callback"

@app.get("/auth/login")
async def auth_login(request: Request):
  auth_url = sc.get_authorization_url(
    redirect_uri,
    state="state",
    connection_id="con_123456789"
  )
  return Response(status_code=302, headers={"Location": auth_url})

@app.get("/auth/callback")
async def auth_callback(request: Request):
  code = request.query_params.get("code")
  token = sc.authenticate_with_code(
    code, 
    redirect_uri
  )
  response = JSONResponse(content=token)
  response.set_cookie("access_token", token["access_token"])

  return response

if __name__ == "__main__":
  uvicorn.run(app, port=8080)

📱 Example Apps

Explore fully functional sample applications built with popular Python frameworks and the Scalekit SDK:

Framework Repository Description
FastAPI scalekit-fastapi-example Modern async Python API framework

🔗 Helpful Links

📖 Quickstart Guides

📚 Documentation & Reference

🛠️ Additional Resources

License

This project is licensed under the MIT license. See the LICENSE file for more information.

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

scalekit_sdk_python-2.8.0.tar.gz (489.9 kB view details)

Uploaded Source

Built Distribution

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

scalekit_sdk_python-2.8.0-py3-none-any.whl (521.5 kB view details)

Uploaded Python 3

File details

Details for the file scalekit_sdk_python-2.8.0.tar.gz.

File metadata

  • Download URL: scalekit_sdk_python-2.8.0.tar.gz
  • Upload date:
  • Size: 489.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scalekit_sdk_python-2.8.0.tar.gz
Algorithm Hash digest
SHA256 d7e7c56729b64220ba39248605f56f507977983d18f5cb449c7f2b5f3b52f3db
MD5 f3e3574514a05be3c97c8ae186280d23
BLAKE2b-256 0529ba64806bb93d7184af8e61a8128d3607b5dff499985c99ce79ac8a9587bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for scalekit_sdk_python-2.8.0.tar.gz:

Publisher: release.yml on scalekit-inc/scalekit-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scalekit_sdk_python-2.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for scalekit_sdk_python-2.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82994cb116e93fd75134662b7b5345b6efa549799963f1af6c93a2a209ef2647
MD5 156376a16d283d1593839a8dc5a7b822
BLAKE2b-256 2751180f7c5f2b4591ae7e52117ec85217c3602c70ab5899916d1839484bf9f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for scalekit_sdk_python-2.8.0-py3-none-any.whl:

Publisher: release.yml on scalekit-inc/scalekit-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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