Switchboard on macOS Alpha preview

One API for every frontier model. The Swift SDK is in alpha. APIs may shift before GA, and the catalog and pricing are still being tuned.

Building in Python? Read the Python quickstart →

1. Get an API key

Switchboard keys start with swb_. Create and revoke them in Switchboard account settings. The plaintext key is shown once on create, so copy it into your environment immediately.

Create your key
2. Install the SDK

Add the package to your Package.swift:

dependencies: [
    .package(url: "https://github.com/valni-labs/switchboard-swift", from: "0.6.0")
],
targets: [
    .target(name: "MyApp", dependencies: [
        .product(name: "Switchboard", package: "switchboard-swift"),
    ])
]

The library product is Switchboard. The SDK lives at valni-labs/switchboard-swift, and valni-labs/SwitchboardDemo is a clone-and-run macOS app showing a full integration.

3. Make your first call

Set SWITCHBOARD_API_KEY in your environment, then:

import Switchboard

guard let apiKey = ProcessInfo.processInfo.environment["SWITCHBOARD_API_KEY"] else {
    fatalError("Set SWITCHBOARD_API_KEY in the environment")
}
let client = Client(apiKey: apiKey)

let response = try await client.inference(Inference.Request(
    model: "claude-sonnet-5",
    messages: [
        .system("You are a senior Swift engineer."),
        .user("Write a one-liner that flattens [[Int]] into [Int]."),
    ],
    user: "end-user-id"
))

print(response.content ?? "")
4. Prefer raw HTTP?

One endpoint serves every model in the catalog:

curl https://switchboard.valni.app/v1/switchboard/inference \
  -H "Authorization: Bearer $SWITCHBOARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "messages": [{"role": "user", "content": "Hello, Switchboard."}],
    "user": "end-user-id"
  }'
5. Pick a model

Pass any catalog model ID. Switchboard handles upstream routing, retries on 429, and failover across provider keys.

The full live catalog is one call away: client.models() in the SDK, or GET /v1/switchboard/models with your key.

Next