Back to Documentation

Gateway Overview

The AI Gateway is a unified interface for managing all your AI provider connections with built-in security, caching, and observability.

What is the AI Gateway?

The Bait Al-Aman AI Gateway acts as a secure proxy between your applications and AI providers like OpenAI, Anthropic, Google, and more. It provides a single endpoint for all your AI requests while adding security, monitoring, and cost controls.

Key Features

Multi-Provider Support

Connect to OpenAI, Anthropic, Google, Azure, and more through a single API.

Automatic Fallbacks

Automatically route to backup providers when primary providers fail.

Security Scanning

Scan all inputs and outputs for security threats and PII.

Response Caching

Cache responses to reduce costs and improve latency.

Quick Example

const response = await client.gateway.chat({
  model: "gpt-4",
  messages: [
    { role: "user", content: "Hello!" }
  ],
  fallbackModels: ["claude-3-opus", "gemini-pro"],
  security: { scanInput: true, scanOutput: true }
});

Next Steps