Router, Gateway and Agents API docs
Everything to call Router directly, wire up LiveKit or Pipecat through Gateway, connect an MCP agent, or track a breaking change.
Quickstart
Every Router request sends Authorization: Bearer $PATCHBOARD_API_KEY. Every POST also sends an Idempotency-Key. Get a key from the console — new accounts start with $100 in signup credit.
curl https://router.patchboard.online/v1/models \
-H "Authorization: Bearer $PATCHBOARD_API_KEY"Use routing: { mode: "auto", objective: "balanced" } on a request for managed selection, or provide an explicit provider and model to pin a route. Router is a native contract, not a hostname replacement for an OpenAI SDK.
API reference
Router exposes typed operations for model discovery and for each stage: speech transcription, LLM responses, and speech synthesis.
/v1/modelsDiscover currently routable models and their capabilities.
/v1/stt/transcriptionsSpeech-to-text, batch or streaming.
/v1/llm/responsesLLM turn generation with routing objectives.
/v1/tts/speechText-to-speech, returns raw audio in the requested encoding.
The canonical Router HTTP contract is the relayapi OpenAPI 3.1 document mirrored from the Gateway repository. Unknown paths return route_not_found with HTTP 404; known paths called with the wrong method return method_not_allowed with HTTP 405 and an Allow header. Every response advertises the default edge quota through RateLimit-Policy; application-generated 429s add Retry-After and a normalized error envelope.
LiveKit
Native Gateway services for provider-direct voice and a managed Router LLM. Point an existing LiveKit agent session at Gateway instead of a single provider SDK.
from livekit.agents import AgentSession
from patchboard_gateway.livekit import LLM, STT, TTS
session = AgentSession(
stt=STT(credential_source="auto"),
llm=LLM(model="auto", objective="balanced"),
tts=TTS(credential_source="auto"),
)Pipecat
The same Gateway credential and routing model, wired into a Pipecat pipeline’s STT, LLM, and TTS services.
from pipecat.pipeline.pipeline import Pipeline
from patchboard_gateway.pipecat import LLMService, STTService, TTSService
pipeline = Pipeline([
STTService(credential_source="auto"),
LLMService(model="auto", objective="balanced"),
TTSService(credential_source="auto"),
])Agent skill (MCP)
The public Docs MCP server is a read-only Streamable HTTP endpoint. It requires no authentication: initialize the connection, list resources, read patchboard://docs/index, then open the matching documentation resource rather than guessing a page or tool name. Account data and write tools stay on the protected operational MCP endpoint, using OAuth or a Patchboard bearer key.
claude mcp add --transport http patchboard https://mcp.patchboard.online/mcpThe get-started skill is for governed voice-front-desk tasks with explicit approval gates before purchases or calls to a human.
Gateway repository
Gateway is the open customer-side runtime: it runs in your workload, keeps BYOK provider credentials in your process, and exposes one local streaming protocol across providers for LiveKit and Pipecat. The public package inside the Gateway repository — relayapi — is also the canonical HTTP, SSE, and WebSocket wire contract that the hosted Router mirrors its OpenAPI document from.
Gateway can call providers directly, use Patchboard-managed routes, or combine both in the same session — see About for how Router and Gateway divide the work.
Versioning policy
The API versioning and deprecation policy defines compatible /v1 changes, an RFC 9745 deprecation signal, a minimum 90-day Sunset window, typed errors, and rate-limit fields on every response.
- Additive changes (new fields, new optional parameters, new routes) ship without a version bump.
- A breaking change ships behind a new version and carries a Deprecation header and a Sunset date on the old one, for at least 90 days.
- Typed error envelopes and RateLimit-Policy / Retry-After headers are part of the stable contract, not incidental.
See the changelog for dated, versioned changes as they ship.