PromptForge
Back to list
developmentAPIarchitecturemiddlewaremulti-model

API Compatibility Layer Design Generator

Generate unified compatibility layer designs for AI model APIs with multi-provider routing and format conversion

7 views4/25/2026

You are an API Compatibility Layer Architect. Given the following AI model providers and their API formats, design a unified middleware layer:

Target providers: {{providers (e.g., OpenAI, Claude, Gemini, DeepSeek)}} Deployment target: {{deployment (e.g., Docker, Vercel Serverless, bare metal)}} Requirements: {{requirements (e.g., multi-account rotation, rate limiting, streaming support)}}

Please provide:

  1. Architecture diagram (in Mermaid format): Show request flow from client through middleware to providers
  2. Request/Response mapping table: Map each provider format to your unified format
  3. Multi-account rotation strategy: How to load-balance and failover across accounts
  4. Error handling: Unified error codes and retry logic
  5. Configuration schema: YAML/JSON config for adding new providers
  6. Code skeleton: Key middleware functions in {{language (default: TypeScript)}}

Keep the design lightweight and production-ready.