Vendo SDKs
SDK Reference

Python SDK

vendo-sdk v1.0.0 — install, public surface, and reference links.

Package

Packagevendo-sdk
Version1.0.0
PyPIpypi.org/project/vendo-sdk
Sourcegithub.com/runvendo/vendo-sdk-py
ChangelogCHANGELOG.md
RequiresPython 3.9+

Install

pip install vendo-sdk

# With HTTP session helper (requests):
pip install "vendo-sdk[http]"

# With async support (aiohttp):
pip install "vendo-sdk[async]"

Public surface

Module-level shortcuts

import vendo

vendo.token(slug)                        # str — fetch single token
vendo.tokens(slugs)                      # dict[str, str | None]
vendo.session(slug)                      # requests.Session (requires [http])
vendo.connect_url(slug, return_to=None)  # str (Vendo mode only)
vendo.is_vendo_mode()                    # bool

Class-based client

from vendo import Vendo, AsyncVendo

client = Vendo(api_key=None, base_url=None)
client.token(slug)
client.tokens(slugs)
client.session(slug)
client.connect_url(slug, return_to=None)
client.invalidate(slug)

# Scoping
client.for_request(headers)  # → Vendo (Vendo mode only)
client.for_user(jwt)         # → Vendo (Vendo mode only)

# Sub-APIs
client.connections           # ConnectionsAPI
client.integrations          # IntegrationsAPI
client.billing               # BillingAPI (Vendo mode only)
client.events                # EventsAPI (Vendo mode only)
client.webhooks              # WebhooksAPI (works in both modes)
client.sso                   # SSOAPI
client.deployment            # DeploymentAPI
client.reconciler            # ReconcilerAPI

Async client

from vendo import AsyncVendo, aio

async with AsyncVendo() as client:
    tok = await client.token(slug)
    conns = await client.connections.list()

# Module-level async shortcuts:
await aio.token(slug)
await aio.tokens(slugs)
await aio.connections.list()
await aio.integrations.list()
await aio.billing.balance()

ConnectionsAPI

client.connections.list()          # list[Connection]
client.connections.get(slug)       # Connection | None

IntegrationsAPI

client.integrations.list()         # list[Integration]
client.integrations.get(slug)      # Integration | None
client.integrations.env_vars(slug) # list[str]

BillingAPI (Vendo mode only)

client.billing.balance()           # Balance

EventsAPI (Vendo mode only)

async with client.events.subscribe() as stream:
    async for event in stream:
        print(event.kind, event.data)

WebhooksAPI

client.webhooks.verify(headers, body, max_age_seconds=300)  # WebhookEvent

ReconcilerAPI

vendo.reconciler.bootstrap(env_file, mapping)
vendo.reconciler.start(env_file, mapping, on_change=None)   # Reconciler

Errors

from vendo.errors import (
    VendoError,
    NotConnected,
    NeedsReauth,
    AuthError,
    RateLimited,
    BalanceExhausted,
    SpendCapExceeded,
    UpstreamError,
    ValidationError,
    IdempotencyConflict,
    VendoOnlyFeature,
    IdentityNotPresent,
)

See Concepts: Errors for usage.

Testing utilities

from vendo.testing import MockClient, MockAsyncClient, fake_connection

The async aio.* shortcuts and the sync vendo.token() share the same in-process token cache. You can call either path interchangeably without double-fetching.

On this page