BoxAgnts Introduction (7) — OpenAI API and Anthropic API BoxAgnts has built a model-agnostic abstraction layer that lets users switch between AI providers—including OpenAI, Anthropic, and Google Gemini—by changing a single parameter. The system normalizes each provider's unique API format, authentication, and streaming protocol into unified `ProviderRequest` and `ProviderResponse` types, supporting over 30 providers through native and OpenAI-compatible implementations. The `LlmProvider` trait and `ProviderRegistry` handle all internal conversion logic, enabling seamless model swapping without altering upper-layer code. The 2025 AI model market is in full bloom. But each provider has its own API format, authentication method, and streaming protocol. BoxAgnts' design goal: users switch models by changing just one parameter, with all internal logic remaining unchanged . This article dissects this abstraction across four levels: LlmProvider trait defines a "model provider"Everything starts with the interface definition: // boxagnts-api/src/provider.rs async trait pub trait LlmProvider: Send + Sync { fn id &self - &ProviderId; // Unique identifier fn name &self - &str; // Human-readable name async fn create message // Non-streaming request &self, request: ProviderRequest, - Result