Switchboard 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_. You can create and revoke them on the
key management page. The plaintext key is shown
once on create — copy it into your environment immediately.
Add the package to your Package.swift:
dependencies: [
.package(url: "https://github.com/Benovi-Labs/ValniAI", from: "0.1.0")
],
targets: [
.target(name: "MyApp", dependencies: [
.product(name: "Switchboard", package: "ValniAI"),
])
]
The library product is Switchboard; the repo name will follow at GA.
Set SWB_API_KEY in your environment, then:
import Switchboard
let client = Switchboard.Client(apiKey: ProcessInfo.processInfo.environment["SWB_API_KEY"]!)
let response = try await client.chatCompletions(
model: "anthropic/claude-sonnet-4-5",
messages: [
.system("You are a senior Swift engineer."),
.user("Write a one-liner that flattens [[Int]] into [Int]."),
],
)
print(response.choices.first?.message.content ?? "") Prefer raw HTTP? The endpoint is OpenAI chat-completions–compatible:
curl https://api.valni.app/v1/chat/completions \
-H "Authorization: Bearer $SWB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4-5",
"messages": [{"role": "user", "content": "Hello, Switchboard."}]
}'
Pass any model in the catalog as provider/model. The Worker handles upstream
routing, retries on 429, and failover across provider keys.
anthropic/claude-sonnet-4-5— frontier general-purposeanthropic/claude-opus-4-7— frontier agent / long-formopenai/gpt-5— frontier general-purposedeepseek/deepseek-chat— baseline, cheapestmoonshot/kimi-k2— long-context
The full live catalog is exposed by the Worker (the model picker UI ships post-alpha).