VendoVendo Docs
Getting started

Swift quickstart

Add the Vendo Swift package and fetch your first token in 5 minutes.

Install

In your Package.swift:

// swift-tools-version: 5.9
import PackageDescription

let package = Package(
    name: "MyApp",
    platforms: [.iOS(.v15), .macOS(.v12)],
    dependencies: [
        .package(
            url: "https://github.com/runvendo/vendo-sdk-swift",
            from: "1.0.0"
        ),
    ],
    targets: [
        .target(
            name: "MyApp",
            dependencies: ["Vendo"]
        ),
    ]
)

Requirements: iOS 15+, macOS 12+, tvOS 15+, watchOS 8+, Swift 5.9+.

OSS mode (no account needed)

Set the conventional env var for each integration. In Xcode schemes or your process environment:

OPENAI_API_KEY=sk-...
TELEGRAM_BOT_TOKEN=12345:abcde
import Vendo

// In BYOK mode pass any non-empty string as apiKey
let vendo = try Vendo(apiKey: "byok")

let openaiKey = try await vendo.token("openai")   // reads OPENAI_API_KEY
let botToken  = try await vendo.token("telegram") // reads TELEGRAM_BOT_TOKEN

Vendo mode (OAuth refresh + managed keys)

Set VENDO_API_KEY in the environment. Keys start with the vendo_sk_ prefix and are sent as Authorization: Bearer <key> to the proxy.

VENDO_API_KEY=vendo_sk_...
import Vendo

let vendo = try Vendo() // reads VENDO_API_KEY from env

let openaiKey   = try await vendo.token("openai")
let connections = try await vendo.connections.list()
let balance     = try await vendo.billing.balance()

Bulk tokens

The return type is [String: String?] — slugs with no resolvable credential map to nil:

let tokens = try await vendo.tokens(["openai", "anthropic", "slack"])
// ["openai": Optional("sk-..."), "anthropic": Optional("sk-ant-..."), "slack": nil]

Per-slug override (escape hatch)

Set VENDO_TOKEN_<UPPER_SLUG> to short-circuit the resolution chain for a specific slug. This wins over both Vendo mode and the BYOK env var, and is useful when testing a custom integration that isn't in the catalog:

VENDO_TOKEN_MYTOOL=sk-test-...
try await vendo.token("mytool") // returns the override value

Next steps

On this page