Docs
Developer docs
Integrate apps and agents with one Switchboard key. Machine-readable OpenAPI + llms.txt included.
Authentication
Bearer keys, scopes, customer OAuth.
Call modes
Thinking tiers, proxy, hub-native, MCP, OpenAI-compat.
Envelope
data, meta, cost vs price.
Headers
SB-* attribution and idempotency.
Errors
Codes, retry rules, MCP failures.
MCP for agents
tools/list and tools/call on the cell.
TypeScript SDK
@switchboard/sdk client and proxy helpers.
Guide for coding agents
llms.txt discovery order and forbidden patterns.
One hub key. Provider secrets stay in the cell. Response
datais still the third party’s shape — Switchboard wraps it withmeta(cost, price, request id, outcome).
For coding agents: start at /llms.txt (or this folder’s llms.txt), then load openapi.yaml. Prefer Markdown pages linked from llms.txt over scraping HTML.
Quick start
- Mint a caller key in Control Room (scopes = connectors / models you need) and publish LKG.
- Set env:
SWITCHBOARD_BASE_URL=https://us1.switchboard.example # no trailing slash
SB_KEY=sb_live_… # or SWITCHBOARD_API_KEY
- Call (hub-native):
curl -sS "$SWITCHBOARD_BASE_URL/v1/call/twilio.send_sms" \
-H "Authorization: Bearer $SB_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: sms-1" \
-d '{"To":"+15550192","Body":"hi"}'
- Or use thinking tiers (recommended for product AI):
curl -sS "$SWITCHBOARD_BASE_URL/v1/proxy/switchboard/chat/completions" \
-H "Authorization: Bearer $SB_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"thinker","messages":[{"role":"user","content":"hi"}],"max_tokens":64}'
Choose a mode
| Mode | Path | When |
|---|---|---|
| Thinking tiers (A0) | /v1/proxy/switchboard/… |
One model knob: anybody / thinker / expert |
| Provider proxy (A) | /v1/proxy/{connector}/… |
Keep Anthropic / OpenAI / Gemini / Mistral SDKs |
| Hub-native (C) | /v1/call/{connector}.{op} |
Stripe, Twilio, Buffer, HubSpot, … |
| MCP | POST /v1/mcp |
Agents / tool loops |
| OpenAI-compat (B) | /v1/chat/completions |
Smoke only — raw JSON + SB-* headers |
Doc map
| Page | Audience |
|---|---|
| authentication.md | Keys, OAuth, scopes |
| call-modes.md | Modes A0/A/B/C + proxy baseURL rules |
| envelope.md | data / meta / error |
| headers.md | SB-*, idempotency, region |
| errors.md | Error codes + retry rules |
| mcp.md | Agent JSON-RPC tools |
| sdk-typescript.md | @switchboard/sdk |
| agents.md | How coding agents should use these docs |
| changelog.md | API / envelope change log and deprecation policy |
| openapi.yaml | Machine-readable API contract |
Hard rules (do not skip)
- Apps authenticate only with Switchboard. Do not put OpenAI / Stripe / Twilio keys in product repos when the hub owns the hop.
- Do not point Anthropic / Google / Mistral SDKs at
{cell}/v1(OpenAI-compat). Use/v1/proxy/{connector}. - Do not double version prefixes on proxy
baseURL(see call-modes.md). - On envelope errors,
dataisnullanderroris set — never treat “has meta” as success. - Side-effect ops need
Idempotency-Key.