Skip to main content

Authlane Python SDK

Typed, server-only access to user-scoped integration tools. Authlane supplies definitions and a fresh short-lived, access-only credential lease at invocation time. The tool then calls GitHub, Slack, Google, or another provider directly from your process—provider traffic never passes through Authlane.

Install

Python 3.11+ is supported.

pip install authlane

Framework adapters remain optional:

pip install 'authlane[agno]'
pip install 'authlane[langchain]'
pip install 'authlane[openai-agents]'
# or all adapters
pip install 'authlane[all]'

First user-scoped tool call

from authlane import Authlane
from authlane.adapters import generic

with Authlane(api_key="ak_...") as authlane:
    listed = authlane.user("user_123").tools.list(adapter=generic())
    if listed.error:
        print(listed.error.code, listed.error.message, listed.error.hint)
    else:
        result = listed.data["github_create_issue"].invoke(
            {"owner": "acme", "repo": "product", "title": "Ship it"}
        )
        if result.error:
            print(result.error.code, result.error.message)
        else:
            print(result.data)

Listing tools fetches definitions only. It does not fetch provider credentials. Each invoke() requests its own fresh credential lease and sends the provider request from this Python runtime. All public operations return Result[T]; expected API, validation, network, provider, and adapter failures do not raise.

Let an end user connect services

session = authlane.connect_sessions.create(
    external_user_id="user_123",
    allowed_services=["github", "slack"],
    allowed_origin="https://app.example.com",
)

if session.data:
    print(session.data.url)  # open in a redirect, popup, or hosted connect UI

allowed_services=[] means every service currently enabled for the tenant. Authlane stores a concrete snapshot for that session, so services enabled later are not silently added.

Framework-native tools

Use the same user-scoped flow with any adapter:

from authlane.adapters import agno, langchain, openai_agents

agno_tools = authlane.user("user_123").tools.list(adapter=agno())
langchain_tools = authlane.user("user_123").tools.list(adapter=langchain())
openai_tools = authlane.user("user_123").tools.list(adapter=openai_agents())

The returned native tool objects preserve the canonical name, description, and JSON Schema. Their callbacks remain bound to user_123; credentials are acquired only when the framework invokes a tool.

Async

from authlane import AsyncAuthlane
from authlane.adapters import generic

async with AsyncAuthlane(api_key="ak_...") as authlane:
    listed = await authlane.user("user_123").tools.list(adapter=generic())
    if listed.data:
        result = await listed.data["stripe_get_customer"].ainvoke(
            {"customer_id": "cus_123"}
        )

Authlane and AsyncAuthlane also expose typed services, connections, capabilities, credential_leases, connect_sessions, and raw tools resources. Keep the API key and all SDK use on trusted server infrastructure.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

authlane-0.1.0.tar.gz (50.3 kB view details)

Uploaded Source

Built Distribution

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

authlane-0.1.0-py3-none-any.whl (55.0 kB view details)

Uploaded Python 3

File details

Details for the file authlane-0.1.0.tar.gz.

File metadata

  • Download URL: authlane-0.1.0.tar.gz
  • Upload date:
  • Size: 50.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for authlane-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a638c5f3ef66111e31e9d3676367ee8c452eb538c951dbb23131bff4d4468c83
MD5 307dd5aaa1c983fb52663d4a2bb1fbda
BLAKE2b-256 bf1ab08cdc2ccf120a945e0c7052c93ad92677365e7bb260fefb751385e13d77

See more details on using hashes here.

File details

Details for the file authlane-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: authlane-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 55.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for authlane-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2cfe4d39055ce05e7c187806c19bf29d59720067bc0830f1ceded73d4759be70
MD5 563b8a66e30fb4af1d4dc4e17b2a2ded
BLAKE2b-256 0f745845a07087193ab470039239800e311c450e51f45340e57012d3069d460b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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