01
Protocol translation
Convert between OpenAI Chat, Anthropic Messages, and OpenAI Responses so the agent never changes clients.
Switchyard is a Rust proxy and library that routes requests across providers and translates between the OpenAI Chat, Anthropic Messages, and OpenAI Responses formats. Point Claude Code or Codex at a local model and neither side has to learn the other's dialect.
| Agent sends | Backend receives |
|---|---|
| POST /v1/messages Anthropic Messages |
POST /v1/chat/completions OpenAI Chat |
| system: top level string | messages[0] with role system |
| stop_sequences: [ ] | stop: [ ] |
| content: block list | content: string or parts |
Convert between OpenAI Chat, Anthropic Messages, and OpenAI Responses so the agent never changes clients.
Random routing, LLM-as-classifier routing, a signal-driven stage router, or an algorithm you write yourself.
Prometheus metrics cover requests, errors, latency, tokens, and the routing overhead the proxy itself adds.