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.

1. Get an API key

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.

Create your key
2. Install the Swift SDK

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.

3. Make your first call

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."}]
  }'
4. Pick a model

Pass any model in the catalog as provider/model. The Worker handles upstream routing, retries on 429, and failover across provider keys.

The full live catalog is exposed by the Worker (the model picker UI ships post-alpha).

Next