What is Layer AI?
Layer AI is an AI gateway that sits between your application and AI providers (OpenAI, Anthropic, Google, etc.). It provides intelligent routing, automatic fallbacks, cost tracking, and a unified API across all providers. Key benefits:- Smart Routing - Automatically route requests to the best model for each task
- Automatic Fallbacks - Never fail when a model is down
- Cost Tracking - Real-time cost analytics per request, user, and endpoint
- Unified API - One interface for GPT, Claude, Gemini, Mistral, and more
- Drop-in Replacement - Works with OpenAI SDK and Anthropic SDK
Quick Start
Get up and running in under 5 minutes.Quickstart Guide
Create your first gate and make your first request in 5 minutes.
Layer SDK
Our official SDK with full support for all Layer AI features.Layer SDK Documentation
Full-featured SDK with chat, image, video, and audio support across all providers.
Other Integrations
Use Layer AI with your existing OpenAI or Anthropic SDK code.OpenAI SDK
Drop-in replacement for existing OpenAI code - change 2 lines.
Anthropic SDK
Use Anthropic SDK with Layer for routing and fallbacks.
Core Concepts
Understand the building blocks of Layer AI.Gates
Control access, routing, and costs with configurable gates.
Routing Strategies
Learn how Layer intelligently routes requests across models.
Cost Tracking
Monitor and optimize your AI spending in real-time.
Dashboard
Manage your gates, keys, and costs from the Layer AI dashboard.Creating Gates
Set up your first gate with routing rules and cost limits.
Managing API Keys
Generate and manage Layer API keys for your applications.
BYOK Setup
Bring your own keys from OpenAI, Anthropic, and other providers.
API Reference
Complete API documentation for all Layer AI endpoints.Chat Completions
OpenAI-compatible chat completions endpoint.
Anthropic Messages
Anthropic-compatible messages endpoint.
Need Help?
Join our community
Get help, share feedback, and connect with other Layer AI users.