Skip to main content
Bifrost schemas define the structure for:
  • Request/Response data across all providers
  • Configuration interfaces for accounts and providers
  • Plugin interfaces for custom middleware
  • MCP tool definitions for external integrations
  • Error handling with detailed error types
OpenAI Compatibility: Bifrost follows OpenAI’s request/response structure for maximum compatibility. This ensures easy migration from OpenAI and consistent behavior across all providers.
Complete Reference: All schemas have detailed GoDoc comments in the source code. This guide focuses on practical usage patterns.

Core Request/Response Schemas

BifrostRequest

The primary request structure for all AI interactions:

BifrostResponse

The unified response structure across all providers:

Message and Content Schemas

BifrostMessage

Unified message structure for conversations:

MessageContent

Flexible content structure supporting text and multimodal inputs:

Configuration Schemas

BifrostConfig

Main configuration for initializing Bifrost:

ModelParameters

Request parameters for fine-tuning model behavior:

Tool and MCP Schemas

Tool Definition

Structure for defining AI tools/functions:

ToolChoice Control

Control when and which tools the model uses:

Interface Implementations

Account Interface

Provider configuration and key management:

Plugin Interface

Custom middleware for request/response processing:

Logger Interface

Custom logging implementation:

Error Handling Schemas

BifrostError

Comprehensive error information:

Common Usage Patterns

Provider Selection

Available providers and typical models:

Request Building Patterns

Common request patterns:


Source Code: For complete schema definitions and GoDoc documentation, see the core/schemas directory.