Routing & passthrough
Routing & passthrough
Two ways to call Respan: a unified router or a provider-native passthrough.
Respan exposes two different endpoint shapes. Pick whichever fits the SDK or tool you already use.
Every request through either shape is automatically logged.
Unified router
The unified router accepts the OpenAI Chat Completions and Responses API formats. You point any OpenAI-compatible SDK at https://api.respan.ai/api/ and call models from any provider by changing the model slug.
Endpoints:
See Create chat completion and Create response for the full schema.
Provider passthrough
Passthrough endpoints accept the provider’s native request and response format unchanged. Use them when you want to keep using the provider’s official SDK or CLI without switching to OpenAI-compatible code.
Anthropic
For the Anthropic CLI or Claude Code:
Google Gemini
For the Gemini CLI:
Google Vertex AI
Which one should I use?
- Use the unified router if you want one SDK and one base URL across providers, want to use Respan features like inline routing or fallbacks, or are starting fresh.
- Use a passthrough if you already have provider-native code, want a provider’s CLI (Claude Code, Gemini CLI) to flow through Respan unchanged, or need a feature only the provider’s native API exposes.
Both can be mixed in the same project. For example, route your app’s OpenAI SDK calls through the unified router and route Claude Code through the Anthropic passthrough.
Pin a provider for a passthrough call
By default a passthrough request resolves to its native provider (Anthropic passthrough goes to Anthropic, etc.). To keep a passthrough’s request shape but route the call to a different provider (e.g. send Anthropic-format requests to Vertex AI or Bedrock), use the X-Respan-Route-Provider header. See Providers & models for details.