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.
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.
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.
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 ?? "") 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"
}' Pass any catalog model ID. Switchboard handles upstream routing, retries on 429, and failover across provider keys.
claude-sonnet-5: frontier general-purposeclaude-opus-4-8: frontier agent / long-formgpt-5.5: frontier general-purposedeepseek-v4-flash: baseline, cheapestkimi-k2.6: long-context
The full live catalog is one call away: client.models() in the SDK, or
GET /v1/switchboard/models with your key.