Comprehensive guide for building HTTP integrations for Bifrost. Learn how to create new API-compatible endpoints that translate between external service formats and Bifrostβs unified interface.
β οΈ IMPORTANT: Before developing an integration, thoroughly read the Request Flow Documentation and System Overview to understand:
- HTTP transport layer architecture and request processing pipeline
- Integration patterns and GenericRouter design
- Error handling and response formatting
- Security considerations and validation requirements
GenericRouter
architecture.
Key Feature: All integrations should support multi-provider model syntax using ParseModelString
, allowing users to access any provider through any SDK (e.g., "anthropic/claude-3-sonnet"
via OpenAI SDK).
1. Route Configuration (router.go)
GenericRouter
pattern:
2. Type Definitions (types.go)
transports/bifrost-http/main.go
:
router.go
with route configurationstypes.go
with request/response typesParseModelString
to enable βprovider/modelβ syntaxParseModelString
:
model: "anthropic/claude-3-sonnet"
routes to Anthropicmodel: "openai/gpt-4o"
routes to OpenAImodel: "vertex/gemini-pro"
routes to Google Vertexmodel: "claude-3-sonnet"
uses your default provider