Unified AI Gateway
Access 40 models from 6 providers through a single OpenAI-compatible API. Built-in auth, credits, rate limiting, and real-time analytics.
const response = await fetch('https://api.layers.dev/v1/chat', {
headers: {
'Authorization': 'Bearer lyr_live_...',
},
body: JSON.stringify({
model: "anthropic/claude-sonnet-4.5", // Change anytime
})
});Production-ready infrastructure that scales with your application
No vendor lock-in. Change from Claude to GPT-4o by updating a single parameter. Perfect for A/B testing and cost optimization.
Transparent credit system with real-time tracking. No hidden fees, no minimum commitments. Start free with 50 credits.
Built-in authentication, rate limiting, and error handling. Deploy with confidence knowing the infrastructure is battle-tested.
Real-time analytics showing costs, tokens, and performance per model. Understand exactly where your budget goes.
Drop-in replacement for OpenAI SDK. Migrate existing applications by changing only the base URL and API key.
Access models from Anthropic, OpenAI, Google, Perplexity, and more. Always up-to-date with new releases.
Start free, scale as you grow
$0/month
$20/month
$100/month
$200/month
Compare the traditional approach to the Layers advantage
| Feature | Direct Provider APIs | Layers |
|---|---|---|
| Multi-Provider Access | Multiple SDKs | |
| Unified Authentication | Separate keys | |
| Consolidated Billing | Multiple invoices | |
| Usage Analytics | Scattered dashboards | |
| Rate Limiting | Manual implementation | |
| Switch Models | Code changes required | One parameter |
Get up and running in less than 5 minutes
curl -X POST https://api.layers.dev/v1/chat \
-H "Authorization: Bearer lyr_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4.5",
"messages": [{"role": "user", "content": "Hello!"}]
}'Join developers who've consolidated their AI infrastructure with Layers. Start with 50 free credits today.